TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Javascript Refactoring without an IDE

18 pointsby justinlillyover 11 years ago

3 comments

afandianover 11 years ago
This doesn&#x27;t really look like a &#x27;proper&#x27; refactor to me. It&#x27;s a blanket &#x27;all strings and attributes&#x27; isn&#x27;t it? How does this apply to &#x27;real world&#x27; code?<p>1 - What if I&#x27;m using an external library so I have some exceptions?<p>2 - What if I want to keep strings with underscores in them? Can it detect those strings that are used to reference as attributes and those that aren&#x27;t?<p>3 - What if I&#x27;m using an external library so I have some exceptions?<p>4 - What if I have two entirely separate &#x27;classes&#x27;&#x2F;prototypes but they share a common attribute name. What if I want to update one but not the other?<p>I&#x27;ve spent a lot of time writing in static and dynamic languages and I intuitively don&#x27;t believe that you can do &#x27;proper&#x27; refactors in dynamic languages (although it&#x27;s not something I&#x27;ve gone out of my way to look into).<p>I&#x27;d love to be proved wrong.
评论 #6560646 未加载
bpodgurskyover 11 years ago
If you do feel like booting up an IDE... Intellij&#x27;s Javscript refactoring is really impressive.
justinlillyover 11 years ago
Was discussing this in #node.js on freenode and someone suggested looking at Tern as well. It seems to be a bigger, though more powerful, library.<p>Blog post that was suggested: <a href="http://marijnhaverbeke.nl/blog/tern.html" rel="nofollow">http:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;blog&#x2F;tern.html</a>