I’m not going to tell you which editor you should use (Emacs). I’m not trying to feed the editor wars (Emacs 4evar!!!!1!!).
I do think that every programmer that cares about productivity should use a Real Editor, though. I’ve thought a lot about what that means. I could easily come up with a list of twenty tests that an editor should pass before it can be deemed a Real Editor. But the list would still be incomplete.
So I came up with a couple of heuristics instead. If your editor satisfies these two requirements, chances are it’s a Real Editor.
- You can record a series of edits, save the recording as a macro, edit the macro as a script, and then convert the script into a redistributable editor extension/plugin.
- The editor never, ever loses data.
Rule #1 implies a lot about the editor:
- It has a macro recording facility. If your job description involves editing a lot of structured text, there is a level of productivity that is impossible to achieve without either using an editor with macros, or employing a Virtual Assistant or intern to perform tedious repetitive edits. I don’t use macros every day but when I do, they save me hours of work.
- It is sufficiently introspective to convert keyboard commands into script statements. An introspective editor is an extensible editor. And an introspective editor is able to tell you about itself and its functions in ways that help you learn to use it better.
- It has a native scripting language. This is a prerequisite for having a healthy ecosystem of hacks, tweaks, and extensions.
Rule #2 should be a base-level requirement for anyone who is paid money to write code, but surprisingly, a lot of text editors focus on bells & whistles before they focus on the fundamentals. If an editor isn’t mature enough to safeguard your data even in the event of a catastrophic crash, it isn’t ready for production use.
I’m not saying that you have to pick a single editor and use it exclusively. Maybe there is an IDE which doesn’t quite qualify as a Real Editor but it has great refactoring support. But if you have been programming for a few years and you haven’t mastered at least one Real Editor, you are shortchanging yourself and anyone that depends on your output.
So. Are you using a Real Editor?
UPDATE: I’d be interested in getting a list together of all the editors that meet those two requirements. I know for certain that both Emacs and VIM do. I don’t have enough experience with other editors to list any others. Feel free to leave comments suggesting editors that satisfy the two rules.