Christmas Radio
[high] [low]
Last update:

The Three-Column Editor

The time for me to upgrade my text editor is long overdue. I've been using Codewright for many years. Holy crap, it might be eighteen years! I used it before it was bought by Starbase (who?) in 2000. Borland (who?) bought it in 2003 barely had enough time to put their name on the splash screen before it was basically murdered.

(Borland's story is so sad. They completely changed PC software development with Turbo Pascal and Turbo C. They had truly innovative software like Sidekick, Quattro, and Reflex. And somehow they just failed. Repeatedly.)

It's a testament to Microsoft that Codewright, a ten year old executable, still runs on Windows, and does so fairly well. It has some hiccups with the file open dialog, probably because it's been customized by Codewright. I can't imagine how painful it must be for MS to support software like this for so long. It's pretty amazing. But I fear for Codewright's viability as we reach ten years after its compilation date.

The editor I used before this one was the Sage Programming Editor, or SPE, whose executable was simply "p". I first started using this editor because it came from Polytron, who made the revision control system (PVCS) and make (PolyMake) we used where I first worked. It's so long ago that I don't remember how it came about, but I ended up doing a lot of the PVCS, Pmake, and editor stuff. I may have actually made the buying decision.

Both P and Codewright both had Brief key bindings. Brief was probably the premier DOS code editor of the 1980s. I don't think anyone has come up with a more efficient key mapping since then. I've put in many, many hours with Visual Studio, and I'm not nearly as efficient as I am in Codewright. The Brief keymap is (mostly) crazy good and there are some subtleties in how it operates that are just "right".

All of which is to say that I'm using an antique. And yet it still compares well or exceeds against today's common editors. On the whole, it's still better than Visual Studio. It only lacks in integration: it can't read VS solutions or projects made since 2006. And of course it could never be used for debugging.

I have tried emacs in the past. It is probably unmatched in terms of power, flexibility, and feature set. It's also completely impenetrable. Its key mapping is state of the art for 1982. I also tried gvim during my sabbatical and it didn't take. And though I can remap keys in these editors, it generally doesn't work out. For example, running gvim in visual mode all the time without glitching is an impossibility. Vimmers will say: If you gave yourself fully to the VIM you would become perfect. Maybe. But I don't think the Vim (or emacs) Way is a requirement to get that perfection. Could I work in emacs or gvim? Yes I could and have. But it's 2012: THE FUTURE. Why should I work with my arms tied behind my back?

And so I went back to Codewright. I wasn't getting anything more out of gvim than I was out of Codewright except the assurance that it'll work for many years to come. It's what I'm using at work and at home right now.

Huh. All of that was to be a brief one-paragraph introduction. Anyway...

The time has come for editors to do more. There is some motion in this direction. Visual Assist X for Visual Studio is a good example. It does syntax checks on the fly and puts wavy underlines under errors that it has detected. It allows refactoring/renaming of functions and variables. (If you use VS all day and aren't using VAX, you should go buy it now.)

Continuous syntax checking should be as standard as syntax coloring and auto-complete are today. (Though I think most implementations of auto-complete are still rather weak compared to what they could be.)

What's the next step? How about when I'm editing HTML or CSS and my cursor is on a color, being able to pop up a color picker? That would be pretty useful. What if I could see the actual code to a function in a popup. Sort of like "go to definition" but popped up right there rather than in a new context.

It turns out that Adobe (of all people) are doing exactly this as an open and free (as in beer) editor called Brackets. It's not good enough to use yet, but the video shows the promise of this kind of thing. The editing itself is based on a Javascript editor library called CodeMirror. (Sadly, this library doesn't currently support what I think of as a critical editor feature: rectangular selection.)

Another thing I've seen recently that I though was cool is Docco. Yes, it's yet another code documentation system, but it wins my heart for several reasons. First off, I love how it is side-by-side with the code. It's brilliant. It doesn't try to replace the code, it augments it. There are no required bits of syntax to dirty things up. It has some heuristics to attach comments to the code. So you can just start using it.

Take it a step further. Every programmer's monitor is too wide now. Either the extra space is filled with crap (like solution explorers) or a YouTube browser window. Let's use the space. Put the docco docs in the left side and the code in the middle. Want to add or change the comment? Click on the comment (I would probably use alt-left arrow) and edit it. Of course, you need to be able to flip in and out of this mode with a single keystroke. (The comments you add would actually be added to the original code file inline, but displayed on the left.)

On the right hand side of the screen are all of the syntax errors and lint warnings. Not just little markers, but the whole error message. Instant feedback, you'd able to see note and address it without mousing around. I suspect there are other things this area could be used for. (I will accept no excuse for non-interactive syntax checking. We live in the future now.)

I'll stop myself from continuing on because I fear I will start discussing how selections are broken in every single text editor except Codewright. I've already had to delete a paragraph about how to do auto-complete and I was just revving up.

The basic idea that urged me to write this was the three-column editor. Comments/Docs, Code, and Syntax/Reference. Somebody get on it.