The Many Hats of Software Development

26 October 2005 at 14.02 • in Trifle, Programming

Lately, I’ve been wearing the program-manager hat: my work on Trifle has involved more conceptual design than coding. And of course, later there will be the developer hat, the tester hat, the tech-writer hat, the marketer hat, the customer-support hat, the bookkeeper hat… I’ve got a hat-rack’s worth and more of hats to wear. No wonder there aren’t many software developers going solo: most people just don’t want to wear all those hats.

But I’m looking forward to managing the whole thing, end to end. Though I never would have thought this way five or ten years ago, I now see that I’m not a just-sit-down-and-code kind of guy. I like to be involved in a medley of things, and in particular to connect with users through interaction design, through writing documentation, and through direct feedback.

And that’s what really excites me about developing and shipping an application on my own: it fits me. I can see myself doing this for a long while, and loving it.

Hog Bay Notebook

25 October 2005 at 16.27 • in Trifle, Programming • Comments (3)

My trip through the world of outliners led to Hog Bay Notebook. I’ve moved my to-do lists and associated notes from TextEdit to HBN, and it’s a pleasant transition. Managing and organizing items is now much easier, as is navigating between different sets of notes.

I’m still looking forward to moving all that to Trifle, though. Even though I can see the utility of the outliner model, it still rubs my brain the wrong way, somehow.

To HBN’s credit, though, it doesn’t enforce the restriction of one item, one place: you can create aliases for items. Even better, HBN gets the model right: an alias is fully equivalent to an item. If you delete the original, the alias remains intact. Try doing that in the Finder…

Kudos to Jesse Grosjean for a well-made, useful app. Even after Trifle is up and running, I suspect I’ll still find uses for Hog Bay Notebook.

Trifle and Outliners

17 October 2005 at 16.53 • in Trifle

Trifle isn’t an outliner, but it should be useful for similar information-organizing tasks. So, to catch up on where outliners are at these days, I’ve turned to Ted Goranson’s excellent column About This Particular Outliner. (It’s published as part of About This Particular Macintosh, of course.)

For the last two years, Ted has been reporting on the world of Mac outlining, past, present, and future. If you’re interested in organizing information on a Mac, it’s well worth reading. He draws out the philosophical differences between outliners so you can tell which one matches you, because, as he insists, the “best” outliner is the one that fits your brain.

And, really, that’s why I’m writing Trifle. Many existing outliners look good—powerful, elegant, full-featured—but for whatever reason, the outlining paradigm doesn’t work for me. Trifle is an experiment to see if similar power can be obtained without the hierarchy of an outliner.

Fast Enough

13 October 2005 at 09.32 • in Programming, Overleaf

Why would you choose to write an application in C when you have higher-level alternatives? I know I’d rather write less code and leave more of the grunt work to the computer. Too often, programming in C is premature optimization. At least, I claim to believe that, but then I fall into the same trap.

For Overleaf, I thought the main challenge would be making syntax highlighting fast enough. So I immediately chose to write it in Objective-C. (And yes, Objective-C, for all its merits, is still C at heart.) On top of that, I decided I should subclass NSTextStorage and implement my own attribute storage mechanism.

I wrote a bunch of code and made it work, but got fed up with Objective-C and decided to switch languages. I still thought that performance was the determining factor, so I looked toward compiled languages like Haskell and (Gambit) Scheme.

But then I started building a Python prototype of Overleaf, as a testbed for proportional-font indenting. I was still convinced Python would be way too slow, and it was—until I ditched my NSTextStorage subclass in favor of a simple delegate. Now it’s more than fast enough, and with a fraction of the code.

I’m sure you know the moral of this story: Premature optimization is the root of all programming evil. I keep harping on this subject, but that’s because—as this incident shows—I still need to get it into my head.

Indenting in Overleaf

11 October 2005 at 17.07 • in Programming, Overleaf

Here’s how I handle smart indenting in Overleaf, to keep the right things aligned even when using a proportional font.

The ground rules: Overleaf is a plain text editor, and loads and saves plain text files. It must consume and produce ordinary fixed-width indentation using spaces, so that Overleaf users can painlessly share files with users of other editors.

Given that context, I want to keep the plain-text representation of a file untouched, while I set attributes here and there to line things up. The text expansion attribute (see NSExpansionAttributeName) fits the bill: it allows me to stretch or squeeze text horizontally. All I have to do is calculate the correct expansion factor and apply it to a range of spaces, and I can line things up however I like. (And since spaces are non-printing, the stretching has no other visible effect.)

A simple rule helps calculate the expansion factor: one character should match one space. That is, if a line begins with four spaces, its fifth character should line up with the fifth character of the previous line. In practice, this means stretching the spaces to match the additional width of the non-space characters in the prior line.

This way, most things that line up in fixed-width mode will also line up in proportional mode. There are a few exceptions, the trickiest being line-internal indentation; the above rule doesn’t always work, and I haven’t found a clean solution yet.

All Those Trifles Add Up

5 October 2005 at 17.00 • in Trifle, Programming

I’ve been taking a few detours from the straight and narrow of Trifle development. I think they’ve been productive detours, though: I’ve contributed a couple of small patches to HOC (the Haskell-Objective-C binding), and I’ve concocted a simple Overleaf prototype to edit my Haskell code in. But now it’s time to get back on the main road.

When I restarted Trifle as a commercial project, I sketched out monthly milestones of where I want to be, with the deadline at mid-month. The first of those is ten days away, and, well… I’m not where I envisioned yet, but I still think I have a chance to make the deadline.

Of course, any arbitrary deadline is something of a guess, but without deadlines, nothing gets done. What can you do? It’s the essential paradox of software schedules.

Prototyping Overleaf

3 October 2005 at 21.16 • in Programming, Overleaf • Comments (2)

I’ve been hacking together a new Overleaf prototype on the side (using Python with PyObjC). It’s certainly no more than a prototype, but it is—just barely—usable. And in particular, proportional-font indenting works.

I’m still not sure if programming in a proportional font is worth building a full-blown editor for. The advantage of this quick-and-dirty prototype is that I can try it out and see whether I like it or not.

One thing that’s immediately obvious is that most proportional fonts have symbol characters that just don’t work for programming (though Georgia and Optima aren’t bad). For example, the classic ASCII arrows usually look terrible. I’m hoping that by using NSGlyphInfo, I can substitute in real arrows.