The achilles heel of Node.js: Refactoring
Wednesday, March 14, 2012 at 11:18AM 
Refactoring of Node.js code is awful, and I don't see it getting much better.
Working through a few smallish node projects it's become clear that there are lots of good solutions to many of the issues that people bring up about node, and more importantly, Javascript. My biggest issue early on was with the nesting of callbacks, but the excellent async library has make that a near non-issue. And other parts of Javascript I've come to know and love.
But when it comes to refactoring code, the problems inherent with dynamic languages come to the forefront. The IDE (in my case IntelliJ) can't rely on names and types to make refactoring easy. As a result, moving a function from one module to another is a scary experience. This is especially true if we're doing some JS magic where functions may be referenced by something other than their name.
The obvious response to this is that I should have better unit tests, and that's a given. But even still, running those unit tests would require me to manually make my own fixes based on the change. When I switched from C++ to Java, the refactoring support was one of the 'lightbulb' features that made me never want to go back. I get a little obsessive about my code; I want it to be beautiful; I want each of the pieces to be in the right place, making it readable, understandable, and just make sense. Without refactoring tools, that will be much more difficult.
