Ask HN: JavaScript dev environment ?
I finally decided to dive deeper in JavaScript.
Move away from simple JS and Firebug debugging. To large and more complex software for the front-end and explore the new opportunities in the back-end (Node.js and such)
What I need is not just an editor (vim will do) but rather a full environement where I can edit, run, test and debug JavaScript.
All recommendations are welcome.
(
36 comments
| 49 points
| on HN
)
I have tried Aptana, WebStorm (from Jet brains), textmate, bbedit, jseclipse, visual studio, vim. But still haven"t found what I am hoping to find.
I find the eclipse based solutions (Aptana and jseclipse) are too slow for my taste and while they do provide things like completion, it is fairly limited to the obvious things. Aptana probably does what you are looking for, it has a debugger that integrate with your browser.
I tought webstorm seemed better but it is also a bit slow and brings a bit too much with it. Give it a try it may be what you are looking it also has debugger integration.
I couldn't find any special editing facilities other than text highlighting and indentation in bbedit and eventually gave up. TextMate does it ok but since I am not that familiar with javascript and the libraries I am using, I was hoping for something that would let me edit and introspect things at the same time. its really comparable to what you could achieve with vim or emacs.
Regarding a "more full development environment," my good friend said the following to me:
IDEs can be nice, as they help you handle complicated code. On the other hand, they don't prevent you from writing complicated code in the first place.
What are people's opinions of ES4? I am using it to learn the good parts of Javascript. Is it recommended?
It doesn't have integrated debugging, it costs a lot, and people won't believe you when you tell them about it, however.
I'm curious about Visual Assist X - does it add more/better support for Javascript and/or jQuery?
I also use Aptana Studio on OSX when I do pure UI coding. It's not bad for pure JS/jQuery but their isn't much autocomplete support.
Edit: Side note on the cost of VisualStudio 2010 - I signed up for MS's BizSpark program and was given a free MSDN license including full copies of VisualStudio 2010, SQL 2008, etc.
While you're looking at Node, I also suggest you take a look at RingoJS (http://ringojs.org/). It should be easier to get started with & has debugging support.
Anyways, I use a decent editor (Notepad++ is a good one) for most code that doesn't need debugging (besides the good old trace statements) and for debugging I use eclipse.
In the latest version of Node.js (0.1.100) a console.log() was added.
This isn't a huge problem or reason not to use Firebug (which I would be totally lost without), just something to be wary of.
there, fixed..
http://www.youtube.com/watch?v=TH7sJbyXHuk
One of my pet projects is open source and tested with JsTestDriver [1], that should be a good starting point for learning more about how to test JavaScript in webapps.
I also like to use Sinon [2] for stubbing and mocking. The author of Sinon is also putting the finishing touches on a book about TDD-ing JavaScript.
EDIT: calendar-logic.js [4] an example of how you can extract and test logic in separate libraries. It's being used on figureoutwhen.com.
[1] http://github.com/augustl/figureoutwhen.com [2] http://cjohansen.no/sinon/ [3] http://www.amazon.com/Test-Driven-JavaScript-Development-Dev... [4] http://ditrw.com/calendar-logic-dot-js/
.
[1]: http://code.google.com/p/zen-coding/
3 screens: 1 with two windows for editing code, 1 to run Chrome and 1 for Chrome Dev Tools. Overkill? Nope, good to see it all in context.
I modularize code (bottom up dev style) and test each class / function before integrating with code body. Chrome Dev Tools is fantastic for tracking down CSS cascade probs, etc.
Other tools: Vim, Rhino book and www.w3schools.com for references. I develop only for Chrome / Safari (some FireFox) so can't suggest as for IE, Opera, etc.