Hacker News new | past | comments | ask | show | jobs | submit login
Ask YC: What editor/ide do you use to hack javascript?
10 points by vikram on April 5, 2008 | hide | past | favorite | 31 comments
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.



Steve Yegge wrote a new js mode for emacs: http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascr...


I'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:)


I'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.


he ported rhino's parser, ain't that cool?


For finding those kinds of mistakes use jslint (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.


there is flymake with Javascript configuration for emacs. I'll give that a try. http://www.emacswiki.org/cgi-bin/wiki/FlymakeJavaScript


I 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.


Agreed. 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).


Textmate 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.


I 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?


I use VIM too. What exactly do you find is a pain?


vim here with jquery too. working phenomenally well for me, though I understand there's no kind of js debugging built into vim. The matching braces highlight function is my debugging tool.


If I can be forgiven the self-link: 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.


Have you tried Aptana (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.


I'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.


You 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.


I 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.


This 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.


Any 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.



BTW 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.


*ix = emacs. win = syn text editor :: 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.


Jetbrains' 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.htm...


It seems Netbeans now has very good JS support [http://news.ycombinator.com/item?id=155670]


vim


Jedit usually, but an editor is an editor. As long as it looks nice and has line numbering, it's fine IMHO


Notepad++ is good for Windows; alternatively, there's a good Eclipse Javascript plug-in.


vim 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.


That 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.


Notepad.

Nah, just kidding; gvim


Textpad




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: