Tuesday, June 24, 2008

What do you look for in a development environment?


It turns out that my core needs for an editor are very basic. Back when I first started constructing Cusp, I had three primary things that were absolutely necessary for me to consider it a useful tool:
  1. Syntax Highlighting. Above all else, I need this. Without basic coloring, I find code far far harder to work with, and any time I'm sshed into my server and forced to edit Lisp code in Emacs, the first thing I do is M-x font-lock-mode. In fact, I can get along pretty happily with this functionality alone in an editor, which probably why most basic text editors since Notepad make sure to include it. (Interesting note: for a long time Dr. Scheme did not have this functionality, and it made me a little embarrassed when recommending it to people.)

  2. Autocomplete. Saves typing, and precious (human) memory space. With this, you usually only need a general idea of what function you're looking for. Glancing through the list of functions is almost always faster than poking through documentation. This makes the editor and order of magnitude friendlier to people who are new to the language, and makes learning your way around the language much easier. And even now that I know Lisp fairly well, it lets me code faster and with fewer typos.

  3. Argument list assistance. Another important learning tool. You should never have to do something a computer can do for you, and one thing computers are way better at is memorizing function signatures. This saves time and a break in your workflow by looking up the documentation for you and telling you just what your function wants. (As a bonus, it really should include a quick bit of function documentation if available.) This sort of thing is great when you're, say, trying to sort out the differences between elt and nth.

    As an aside, this feature is one of the reasons I decided to bundle SBCL rather than CLisp. CLisp promptly forgets the argument names to a function, and can only tell me that it wants (elt arg0 arg1) and (nth arg0 arg1). SBCL is far more helpful, informing me that it wants (elt SEQUENCE INDEX) and (nth N LIST).

    As an additional aside, and because I just can't resist beating on Emacs, this information really should be displayed in a tooltip where you're typing (whether it goes above or below is a matter of taste). Making the user's eyes jump to the bottom of the screen and then seek out the cursor again is inefficient.

And that's all. Give me those in an editor and I'll be pretty well satisfied. Happily, these are also tasks that Eclipse makes very easy. Of course, since I was making a Lisp editor, parenthesis matching, integration with the runtime, and a REPL were also required, but that doesn't apply to most languages, and those were also fairly easily done. From there, it was a short walk to functional equivalence with SLIME.

So keep that in mind, editor-makers. Those three things are all you really need. And if you use Eclipse, all the hard work has already been done for you.

No comments: