

Ask YC: What editor/ide do you use to hack javascript? - vikram

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.
======
alexsolo
Steve Yegge wrote a new js mode for emacs: [http://steve-
yegge.blogspot.com/2008/03/js2-mode-new-javascr...](http://steve-
yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html)

~~~
chollida1
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:)

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

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

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

~~~
dimitry
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).

~~~
tlrobinson
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.

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

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

~~~
robmnl
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.

------
DanHulton
If I can be forgiven the self-link:
[http://www.danhulton.com/blog/2008/01/16/integrate-js-
lint-i...](http://www.danhulton.com/blog/2008/01/16/integrate-js-lint-into-
komodo-edit/)

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.

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

~~~
vikram
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.

~~~
kuldeep_kap
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.

~~~
woid
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.

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

~~~
caolan
JSLint plugin for gEdit:
<http://caolanmcmahon.com/blog/jslint_plugin_for_gedit>

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

------
st3fan
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...](http://www.jetbrains.com/idea/features/javascript_editor.html)

------
shaunxcode
*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.

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

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

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

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

~~~
nostrademons
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.

------
entelarust
vim

------
jamesbritt
Notepad.

Nah, just kidding; gvim

------
edw519
Textpad

