6 ms·
Ask YC: What editor/ide do you use to hack javascript?
I've used emacs so far, though it's good at syntax highlighting. I would like something that can show glaring mistakes, like calling a function with the wrong number of arguments, or referring to a variable which hasn't been defined. Thanks.
- trevelyan 19y agoI could use some suggestions as well. I'm using VIM and doing most of the AJAX work manually (with JQuery). js is a pain though -- anyone know a better way to get this stuff done?
- alexsolo 19y agoSteve Yegge wrote a new js mode for emacs: http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascr...
- aston 19y agoI've been trying it out. Not bad, especially the error highlighting. The only downside is that you have to stop typing to get syntax highlighting.
- capablanca 19y agohe ported rhino's parser, ain't that cool?
- chollida1 19y agoI've been using this for the past few days. It works well for me, though I should add the caveat that I would normally use emacs anyway so the learning curve wasn't exactly steep:)
- marrone 19y agoFor finding those kinds of mistakes use jslint (http://jslint.com http://jslint.com), though it doesnt catch calling a function with the wrong number of arguments (which may be what you intended anyways). If you download the source you can easily write a custom command in vim or emacs to run the current buffer through jslint.
- vikram 19y agothere is flymake with Javascript configuration for emacs. I'll give that a try. http://www.emacswiki.org/cgi-bin/wiki/FlymakeJavaScript http://www.emacswiki.org/cgi-bin/wiki/FlymakeJavaScript
- beforebeta 19y agoHave you tried Aptana (http://www.aptana.com/ http://www.aptana.com/)?. It's a full-fledged Web Development IDE. The JS Editor is especially good and allows for referenced js code lookups from inside html files. It's also available as a regular eclipse add-on.
- vikram 19y agoI've just tried this, and it looks good. The code-completion feature is pretty good. Turns out it's good enough that I can ignore the need for a debugger. Probably will need to buy pro as the sftp feature is disabled in the community version.
- kuldeep_kap 19y agoYou should try using a combination of firebug (js debugger) and good editor rather finding a complete IDE package. Thats wht i do and it quite works for me.
- woid 19y agoI love firebug for DOM inspection and CSS prototyping. But I want to do debugging inside same enviroment where I write code. The main reason why I use Aptana is their remote debugger which connects IDE to firebug and allows you do debugging inside the IDE.
- vikram 19y agoThis is what I use at the moment. But, I find that the cycle is too long. I end up spending 10-15 minutes on something that could have been caught in real-time with something with auto-complete or a debugger.
- st3fan 19y agoJetbrains' IDEA 7.0 has SUPER support for Javascript. With features like error highlighting, refactoring, code completion, code formatting, etc. More info a http://www.jetbrains.com/idea/features/javascript_editor.html http://www.jetbrains.com/idea/features/javascript_editor.htm...
- DanHulton 19y agoIf I can be forgiven the self-link: http://www.danhulton.com/blog/2008/01/16/integrate-js-lint-into-komodo-edit/ http://www.danhulton.com/blog/2008/01/16/integrate-js-lint-i... I use Komodo Edit, the free IDE from Activestate. (I'm not associated with them, I just love their editor. Okay, well, they quote me, but once again, because I love their editor.) It supports javascript out-of-the-box, will read into your source files and update it's code hints based on YOUR functions, and can be told to parse the libraries you use and provide coe hints for THOSE functions, too. The only thing I wish they had built-in was the ability to lint it, but I go over how to add that in my article above. And in fact, you can go one step further and use Douglas Crockford's actual (much better) jslint, provided you have rhino installed. I'll have instructions on how to do that up on my blog eventually.
- astrec 19y agoI use textmate which has some nice macros for js, jquery, YUI (all of which I use), plus most of the other toolkits. I round it out with jslint and firebug. If you're on a mac it's a pretty compelling package.
- dimitry 19y agoAgreed. Textmate also has bundles for jslint (every time you save your JS file, a little tooltip will tell you is there are errors and/or warnings).
- tlrobinson 19y agoTextmate also makes it easy to pipe your text through any command line program... want to sort a few lines? Select the lines, Command-Option-R and enter "sort". It's quite handy.
- edw519 19y agoTextpad
- mikeryan 19y agoBTW Javascript functions accept a variable number of arguments so hopefully none of them will tell you when you've called a function with the wrong number of args.
- laktek 19y agoAny of you know of good JS debugging plugins for gEdit ? Its also good for JS editing with automatic indention and syntax highlighting. Only thing I wish I had a built-in debugger. Yet I could cross over to Firefox to check with Firebug.
- caolan 18y agoJSLint plugin for gEdit: http://caolanmcmahon.com/blog/jslint_plugin_for_gedit http://caolanmcmahon.com/blog/jslint_plugin_for_gedit
- aschobel 19y agovim and firebug How do you write your js? I write a few lines and then test the functionality, reduces the scope of where I have to hunt down bugs.
- nostrademons 19y agoThat should be standard operating procedure in any language - makes it much easier to track down bugs and much harder to get into a state where you have to throw away lots of code because you broke everything. I usually write a few lines, refresh & test manually, write a JSUnit test case to cover what I just checked out, run tests & hope for a green bar, check-in, then repeat.
- axod 19y agoJedit usually, but an editor is an editor. As long as it looks nice and has line numbering, it's fine IMHO
- raju 19y agoIt seems Netbeans now has very good JS support [http://news.ycombinator.com/item?id=155670 http://news.ycombinator.com/item?id=155670]
- entelarust 19y agovim
- jamesbritt 19y agoNotepad. Nah, just kidding; gvim
- Kaizyn 19y agoNotepad++ is good for Windows; alternatively, there's a good Eclipse Javascript plug-in.
- shaunxcode 19y ago*ix = emacs. win = syn text editor :: http://syn.sourceforge.net/ http://syn.sourceforge.net/ I know you can use emacs in windows but somehow using emacs/cygwin etc. in that environment just feels wrong. Like spinning punk records at your upper class cousins wedding or something.