Ramblings and thoughts by a Mensch or two.

Sunday, June 08, 2008

Programmer's Editors: The Bad and the Ugly

This started out as a comment on this blog entry, which discusses the long-running "programmers editor war." If you don't know what that's about, or what vi or Emacs are, then you can skip this entry without missing anything important.

It's been a pet peeve of mine that no editor exists that really does everything "right," even at a first approximation. As much as I'm probably temperamentally an Emacs-user (of the classic Emacs-vi options), I just can't quite get past the fact that I need to use Lisp to script it (Lisp offends me aesthetically; I know it's powerful, but it's also painful)...or the fact that its UI design dates to the '70s. Engineers didn't really know much about good user interface design back then--that's the decade that produced interfaces so friendly that millions of people were inspired to let their VCRs flash 12:00 rather than attempt to set the clock, and microwaves so poorly designed you practically had to read the manual to use them. Since then there has been a lot of research and positive progress on good user interface design paradigms, and a common, accessible interface standard (or two..?) has evolved that most people can just sit down and use. Yet Emacs and vi still use the same basic interface they started with, and both present a pretty steep learning curve for people who grew up on Microsoft Word. Yes, I could learn to really use either, but so far I haven't really been motivated to. I know that each is quite powerful in its own right, but I'd like to see something powerful and accessible.

I've been obsessed with finding The Best Editor since at least the mid-eighties, if not all the way back to 1976...though if I'd had access to a computer back then, I'm sure I would have cared. My day job forces me to use Windows, but also involves work on the Mac, and I've been maintaining Linux boxes for my own use since at least 1997. I have played with Emacs, but, like Lisp, it tends to annoy me from a user-interface perspective. I studied under Don Norman when he was teaching at UC San Diego, and I don't have much patience for a user interface that requires instructions, no matter how powerful you can be if you learn it.

What I want to see is an editor with the power of Emacs, but the basic UI of TextMate (or Notepad++ on Windows): I want it to be as usable as a modern GUI-based editor, though at the same time able to be driven completely from keyboard (to the point of being able to type in functions and run them, Emacs-style). I want it to be scriptable in whatever language I choose to script it in. And I want it to load quickly and act lightweight and fast--it should spring to life immediately, and if there are 20Mb of scripts that it needs to load, it should do it in the background and not block until a command I try to execute needs some code that hasn't been loaded yet (and while we're at it, it should KNOW which commands I frequently use and load their supporting scripts first...). Notepad++ on Windows again is closest to that goal--it starts up super-fast, and yet is moderately powerful (even without the zillion plug-ins you can add to it--and here I mean more of a TextMate-level power rather than Emacs-level, but you have to start somewhere).

At some point I'm going to make an attempt at starting such a project--I seriously obsess about this. I'd want to start from a solid base, possibly Notepad++, though I can't say for sure since I haven't dug in its code base yet. Since I'd want real Linux support (Notepad++ works under Wine, I understand, but that hardly counts), and probably real Mac support as well, what I'd be contemplating might end up being a pretty serious fork, though as it's based on Scintilla, it should be able to work on all three platforms with some cajoling. (The wxWidgets port of Scintilla works on Windows/Mac/Linux) If someone knows of such a project, and it's one that actually satisfies my goals, I'd happily join and contribute--I don't feel the need to start a new project as much as the need to have the editor it produces. :)

In the interim I've been using Visual SlickEdit, which has its own issues, but at least it does a lot of things well, IMHO. I also use vi when I need to do Linux configuration, but I'm a perpetual-novice vi user, and am under no illusion otherwise. I've also played with gVim from time to time (it's still my default on the Mac these days), and yes, my fingers do get used to toggling between modes, but I still don't really like it.