Six things a text editor must do - or it's a one-way trip to the trash
Does your source code editor pass the Verity test?
Stob When I heard, in a tutorial video, the multi-platform programmer's editor Sublime described as "the cool kids' code editor" (or possibly "the Cool Kid's code editor" - the speaker didn't enunciate his capitals and apostrophes very clearly) I was puzzled. As the goto (or, rather, the call-by-reference) consultant on Agile Harlem Shake in the northwest corner of our floor, surely no such assertion could plausibly be made without first interviewing me?
Nothing would have come of this if TextPad, normally as reliable as a tax demand, had not crashed. Twice. Unprovoked. Editing piddly little config files.
I mean, in about 1998 I actually registered it with my own money. Possibly as much as £12. So I have invested nearly a quid for each year of ownership, and seen nothing back for my dosh except a few thousand hours of heretofore bug-free editing, and 20 or 30 new versions, including several major version upgrades.
This counts for nothing when there's a brace of bifurcated .ini files squirming about on my hard disk like sadistically razor-bladed earthworms. TextPad is going on a written warning, and this is me writing it.
Here's the programme. I am going to put TextPad and Sublime through Verity's Immutable, Scientific And Absolutely Perfectly Fair Six Point Programmers' Editor Test, and see who wins.
I am aware I am treading on sensitive and subjective ground here, so I am going to apply legendary Microsoft blogger Raymond Chen's anti-nitpicking strategy. I will attempt to anticipate and dismiss in advance every possible commentard objection, and leave the right-thinking reader with an impression of calm, reasoned rationality, and definitely not obsessive paranoia. Let's lay down some protective cover right now.
Anticipated Q. Does each editor support a "folding" feature to allow the user temporarily to "collapse" a block of code by clicking in the margin?
Perfectly Rational A. Who cares? If you don't want to look at it, why put it in your program?
Q. Does the editor support user extension via an internal, C-like macro language?
A. Oh, for heaven's sake. Welcome, Marty McFly, to 2013.
Q. Those two editors are cool, but what about...
A. No, I won't be testing your favourite pet editor. Because.
This last point applies especially if your favourite editor - like that of Dave, who sits behind me - happens to be Notepad++. Years ago I had a very bad run-in with it. It had an evil bug which silently truncated the replace buffer, which I did not discover until too late. Betrayed once, I have sworn a dreadful oath with real, post-watershed swearwords that I will never give it a second chance.
Besides, I don't like its icon.
Off the mark
OK, on with the test. The first of the Six Immutable Blah-di-blah.
1. A programmer's editor must get its backside off the disk and into the air in no time at all. No problems here, both candidates achieve this, with perhaps a hint of stickiness from Sublime.
If either program had failed this test, I would have had to regrade it as an IDE, and it would be game over. Counter nitpick: the technical definition of an IDE is, of course, "any text editor whose add-ons have sufficient time to paint cute loading messages onto the splash screen", but cut me some slack here.
By the way, I do realise that there are some people who fire up, say, Visual Studio 2010 to edit one command parameter in their batch files. They sit there stolidly, their faces cast greenish in the glow of their default Windows XP "grassy hills" wallpaper, their trains of thought necessarily shunted into weedy sidings of forced idleness.
Meanwhile, the hard disk rumbles ominously under the strain of fat, juicy .NET components dropping ploppily into vast expanses of RAM, like ambiguously sauced and -sourced meat products being poured into the strata of a low-budget, lasagne-style ping meal.
I do feel such persons are ill-advised.
2. You don't need to be an enthusiast to drive it.
I don't mind enthusiasts banging on about using "finger memory" to improve their productivity.
I don't like it much when they wag those memorial fingers and write long sermons on their blogs, rhapsodising about the importance of learning a core 35 keystrokes. But hey-ho.
I absolutely can't be doing at all with editors that contrive, by absurd UI design, to make the acquisition of these keystrokes a prerequisite to getting anything done.
It turns out that my brain was only fitted with 72 bytes of "finger memory"; furthermore it turns out to be EPROM, not Flash. I need to wipe out all the WordStar keystrokes from 1986 (Ctrl+Y to delete a line, anyone?) before I can add any more, and I have lost the ultra-violet wiping-out gadget (ask your dad) needed to achieve this.
Counter nitpick: If all this ranting this seems suspiciously like a repeat of my recent attack on R Pi, then: so it is.
Anyway, neither editor makes unreasonable demands in this direction. Another double pass.
3. Support for the languages that I use. Natch both editors offer syntax highlighting. TextPad looks pretty much like every other Windows programmers' editor since 1990 - basic syntax colouring against a white background.
Sublime, on the other hand, reveals Mac influences - it is a multiplatform beast - with a 'coloured chalk on a blackboard' appearance, vertical scope lines and a navigable-image doodad on the right-hand margin:
Another giveaway: Sublime comes with a set of colour schemes with names like Dawn, Expresso Libre, Monokai, Slush & Poppies and the Smell of Napalm in the Morning (I may have made one of those up). Contrast this with an equivalent list from a Windows product (in fact Delphi VCL skins): Carbon, Charcoal Dark Slate, Emerald Light Slate, Golden Graphite, Slate Classico and Dark Beige Slate Classico Carbon (I may have made one of those up). Talking of Delphi, I'll just, um...
One moment. Please wait one moment.
I don't believe this. Sublime comes with support for seven variations of TeX, five for the Rails framework, plus a selection of exotics like YAML and D, but NO support for Object Pascal. Not even as a Googlable freelance download. 'BEGIN' and 'END' are just random collections of characters as far as it is concerned.
Oh right, so you are really telling me, Sublime, that all the cool kids are frittering their lives away chaining together jQuery methods like digital daisies, when they could be experiencing the pleasure of the "Fish Facts" database using code that is very nearly unchanged since 1995? I must say I find that very hard to believe.
What's that? Anybody is free to devise their own syntax definitions? Don't come with that. I am far too busy and important for that sort of malarky. Minus one million points.
4. The editor should contain no implementation of Lisp. Self-explanatory - no need for a counter-nitpick here. Both OK, as far as I can tell.
5. Sooner or later, you need to skim through a huge log file. In the interests of science, and ignoring the danger of introducing some objectivity, I found a 74MB text file left over from Christmas, and tried loading it.
Sublime creaked, gasped, paused, debated... but didn't fall over. Scrolling from one end to t'other triggered a multi-second, fingers-drumming-with-impatience pause.
TextPad just ate it, chomp. Easy win to TeePee.