TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Javascript Refactoring without an IDE

18 点作者 justinlilly超过 11 年前

3 条评论

afandian超过 11 年前
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 未加载
bpodgursky超过 11 年前
If you do feel like booting up an IDE... Intellij&#x27;s Javscript refactoring is really impressive.
justinlilly超过 11 年前
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>