September 2004

« August 2004 | Main Index | Archives | October 2004 »


When coding, I like my conditional expressions to be affirmative. It just feels cleaner to me somehow to say if (bob.isHavingANiceDay()) instead of if (!bob.isHavingABadDay()). There's one fewer mental reversal you have to make to understand the intent, and the code itself just feels positive, shinier and more optimistic about life.

This is one reason I have a guilty appreciation of languages that provide unless alongside if. It's entirely redundant syntactic sugar, but it lets me keep my happy, affirmative expressions. But that's not what I'm talking about now.

Java's handling of nulls conspires to make it impossible for me to write a conditional that I'm truly happy with. I generally write if (foo != null), which is a sad, negative expression that paradoxically really means "if foo is really there", which is positive! So while the expression itself is negative, the most positive code ends up in the "if" side of the conditional, and the negative "oh dear, I couldn't find it" code ends up in the else block where it should be.

If I turn the conditional around and write if (foo == null) I get is a positive expression that's really negative, and my code ends up the wrong way round!

As a result, I can never be happy.

Languages where null is false make me happy.

I am aware how sad this whole post makes me sound.

Found this link on to an article where Empire Strikes Back director Irvin Kershner generally approves of the changes made to his movie in the Special Editions.

What really struck me, though, was the following paragraph:

Kershner, who spoke at a recent press day for the DVD release of the Star Wars trilogy, said that he had to introduce philosophical content subtly when he initially worked on the film. That subtext was the key to the success of Empire, which is widely considered to be the best Star Wars movie. "I thought of myself as if I was living under communist Russia, ... where the writers and filmmakers always make two films—one for the censor and one for the audience who will understand what they are saying," Kershner said. "I did not think of it as science fiction. To me, it was a fable and a fairy tale. I wanted kids to love it, but I also wanted adults to find levels of meaning. There are many metaphorical concepts in it and many things that are symbolic, but I was more interested in the psychology of the characters. And I think that is what affects people."

And that is why Lucas shouldn't have been so self-indulgent and should have got someone else to direct the prequels. I still think he should have parceled them out between Joss Whedon and David Fincher. And maybe given the third to David Lynch, just to definitively piss everyone off. :)

Continuing on from: Applications that Changed My Life: screen

The most recent application to change the way I use computers has to be Quicksilver. When you first sit down with Quicksilver, it looks like a clever application launcher. You type command-space and a few letters (or initials) of the application you want to run, and Quicksilver finds and runs it. Very useful, and sure beats tracking the application down in the Finder (or in Windows' ever-changing start menu, in which I can now officially find nothing without searching for five minutes). That said, LaunchBar did that before Quicksilver, and LaunchBar didn't change my life.1

Back in the 90's, during the perpetual floating flamewar between the command-line faithful and the new GUI upstarts, the mainstay of the CLI argument was the power of the pipe. By joining these little tools together, you could do lots of useful things, very quickly.

Quicksilver is the best tool I've seen so far that takes the pipe and makes it part of a GUI. Hidden just under command-space are all your applications, files, contacts, bookmarks and more, and a growing collection of tools to do interesting things with them.

As a trivial example:

Step one: grab a file:

Step two: pick an action:

Step three: pick a target:

Et voila! At every point, Quicksilver will help you with a smart type-ahead find that remembers what you do most often, and pushes those options to the top of the list.

43 folders publishes a lot of useful Quicksilver hints and tips, and also had a recent interview with the creator of Quicksilver that contained these gems:

43 Folders: What are the unique challenges of developing for a Mac audience?

Alcor: We are a very outspoken and discerning bunch. Apple has pretty much spoiled us rotten, Half want speed and half want functionality, but everyone seems to want class. The mix of old school mac and unix users has led to very diverse expectations, but despite their fervor the users are tolerant of inconveniences, eager to troubleshoot, and quite innovative. A lot of the better features of QS came from requests.

43 Folders: What is the best power user Quicksilver trick that nobody uses (or knows about)?

Alcor: Hard to say. People seem to keep finding features that were coded at 5 in the morning and promptly forgotten, so the problem is that nobody knows about them. The best new ones are probably the search contents action and the ability to collect multiple items with comma (B30). It is kinda buggy at the moment, but it will become more and more useful as support for that syntax propagates down to all the plugins.

A co-worker once complained that Quicksilver had ceased to function: because the application is still in beta, copies expire after a month or so to force you to keep current. His complaint wasn't so much that Quicksilver stopped working, it was that his Powerbook was unuseable without Quicksilver. That's pretty high praise.

1 LaunchBar is now playing catch-up, growing to do the same sorts of things Quicksilver does, but it seems to lack the hacker spirit.

Occasionally, an application comes along that changes the way you use your computer. One of those applications that, if you sit down at a computer without it installed, you feel you're working with one hand behind your back.

screen is one such app. Screen is an old-school Unix app that takes control of your terminal (that text-only thing the command line appears in), and uses it to... display a terminal. Which would be rather pointless except that screen can run multiple terminals at once. ctrl-a c creates a new terminal, ctrl-a n switches you forward between terminals, and ctrl-a p switches you back. ctrl-a [number] jumps you straight to a numbered terminal.

This was an absolute god-send back when I was at University, and most of the Internet access came through a DOS full-screen terminal emulator. If you wanted to do more than one thing at a time, you either had to mess with fore- and back-grounding processes, or run screen.

I still find screen essential, even with a GUI that can display as many terminal windows as I want. Like tabbed browsing, screen protects me from an infinite explosion of terminal windows. And unlike tabbed terminals, screen runs in the context of wherever I happen to be ssh'd to, so when I open a new terminal, it's already where I want it to be.

Screen's greatest strength, though, is portability. In Unix, your terminal is irrevocably attached to some session or device. If you log in over a serial line, it's attached to that line. If you telnet or ssh in, your terminal is bound to that telnet or ssh session. In screen, however, all your terminals are owned by the screen process. The session-bound terminal is just being used as a way to display them. Which means screen can detach itself from one terminal, and attach itself to another.

Practically, that meant that for a period of about eight years, I ran my (digital) life through a single screen session. Terminal 0 was tail-ing my procmail logs, so I could see at a glance what email was arriving. Terminal 1 was mutt, where I read my mail. Terminals 2-4 were various IRC networks. 5+ were used for whatever else I happened to be doing at the time.

Wherever I went: home, university, then various jobs, even overseas, I could ssh into satori, my trusty server, run screen -dr to detach the screen from its previous terminal and re-attach it to my current login, and pick up what I was doing precisely where I left off: IRC connections intact, half-written email still waiting for inspiration.

It was like having a virtual computer that I could carry with me, and take out wherever I happened to end up, so long as there was a computer with ssh access. (Random note: many organisations that firewall off every other port will leave ssh open. This is because system administrators are often people like me.) I became an expert at typing "putty download page" into Google, so I could access my life from random Internet cafés.

It speaks wonders for the ongoing usefulness of the text terminal. While you could possibly do the same thing with GUI apps over VNC, the port wouldn't be open, and if it was, the latency would kill you.

These days, however, I am GUI-bound. My portable digital context is the Powerbook. It's prettier, but maybe not quite as convenient: I have to carry it around in a backpack instead of just having it float out there on the ether.

Continued in: Applications that Changed My Life: Quicksilver.

I was experimenting yesterday with the Rome syndication feed parser, so I plugged it into my development copy of Javablogs, and ran an update against the 900-or-so registered feeds. Despite the claims on the Rome site that Informa's API is "too complicated to grasp and use", replacing Informa with Rome was almost entirely a matter of replacing class-names and renaming one or two method calls. Maybe we just don't use the complicated stuff.

Anyway, Rome worked fine. On one hand, I think there were two or three feeds that Rome parsed but Informa was barfing on, on the other hand, the Informa version we use in Javablogs is six months old.

What I did run into again was a problem I'd also reported to the Informa guys six months ago (and hacked in a quick and dirty solution locally), and that was subsequently fixed.

Once upon a time, when RSS 2.0 was young and the Internet was wild and free, there was a lot of discussion about adding an XML namespace to RSS 2.0. A URI was proposed (, and for a while, even, Dave Winer's Scripting News RSS feed was published in this namespace.

Soon after, though, the namespace disappeared. The namespace proposal never showed up in the official spec. Nevertheless, it existed. For one brief shining moment, it existed; and that which is made can never truly be unmade. The RSS 2.0 namespace survives in the wild to this day, mostly (as far as I could determine) in various old versions of Blojsom templates.

everybody knows
everybody knows
you only live a day
but it's brilliant anyway.
      —Elliot Smith, Independence Day

Which means that RSS parsers expecting RSS 2.0 elements to be in an empty namespace will die in weird and interesting ways.

This is why I think the Pilgrim/Ruby1 approach to RSS parsing is the most effective. Don't write separate parsers for each RSS version. Throw the whole mess of tags into a pot and seive out the ones that look like they might be meaningful.

It's ugly, but at least it works in the wild.

1 Oops. I got the feed parser and feed validator confused. Sorry Mark.

Me, June:

Invite codes are a really smart way to control growth. After a few weeks, anyone “in the know” enough to really want a Gmail account, can have one. At the same time, Google can control the service’s rate of growth. There’s no explosive rush, and if anyone notices something isn’t scaling as well as it should, they can throttle back the issue of new invitations until the problem is solved, without too many sleepless nights.

Scoble, today:

I met Chris Uhlik of Google. He's the program manager of Gmail.... I asked him why they only give out a few Gmail accounts at a time. Remember, I thought it was sheer marketing genius. Turns out it wasn't. Turns out they don't have enough server capacity to deal with everyone who wants an account. So, when they buy a new server and get it installed they hand out another round of invites.

(As an aside, who do you have to shag to get invited to FooCamp?)

My mother's in England at the moment visiting friends and relatives, so I'm doing my usual thing of looking after the apartment and keeping the cat company while she's gone. It ends up taking me twice as long to get to and from work, but the cat's fun to have around, and at least this time I remembered to bring the X-Box over as well.

Anyway, last night, my mother came to me in a dream...

...looked around, and told me the place really needed a vacuum.

I told her I'd get it done before she got back.

She seemed satisfied.

The most obvious difference between real essays and the things one has to write in school is that real essays are not exclusively about English literature. Certainly schools should teach students how to write. But due to a series of historical accidents the teaching of writing has gotten mixed together with the study of literature. And so all over the country students are writing not about how a baseball team with a small budget might compete with the Yankees, or the role of color in fashion, or what constitutes a good dessert, but about symbolism in Dickens. -- Paul Graham, The Age of the Essay.

Not to pick on Graham again, but it's a bad sign when an essay about how to write essays loses you in the first paragraph. Not content with this feat, Graham proceeds to beat this straw man of the education system to death for another 1200 words before saying anything particularly interesting about essay-writing.

Maybe I'm wrong, and the American education system is totally screwed up, but when I was at school, essay-writing wasn't solely the domain of English Literature classes. All the humanities subjects were assessed through essays, and even some of the sciences had essay-like components.

Even focusing solely on English; where I went to school (Western Australia), the subject was taught as a hybrid of literature and writing: one week you would write an essay on, yes, symbolism in Dickens; the next you would write a short story about medieval peasants; the next you would write an opinion essay on whether violence in television is really such a bad thing.

In the last two years of high school, you had the opportunity to continue to study English or move to English Literature. All the smart kids did Lit, because WA's oldest university didn't recognise English as a qualification.

The sneaky part was that at the end of year 12, in your Tertiary Entrance Exams, you were allowed to sit for English regardless of whether you'd studied the subject1. Many students did. The Literature students inevitably blitzed the English exam, scoring 95-100% with no preparation. Obviously, switching to Lit. hadn't done their general English skills any damage.

But what does this really have to do with Graham's essay? Not much, in the end. The leader about the history of Literature in schools was completely unnecessary for the rest of the piece. That's right: an essay about writing essays started with 1200 words that when they weren't wrong, they were irrelevant, and when they weren't irrelevant, they were just plain dull. Which leads me to my first piece of advice:

Start Strongly

The beginning of an essay is the most important part. This is where you have to draw the reader's attention, and establish your credibility. Even if you (as Graham does) have credibility with your readers before the essay even begins, you still need to establish that it extends to whatever it is you are now writing about.

I don't mean you should start explaining what your qualifications are. Actions speak louder than words (even when, strictly speaking, those actions are words as well). Don't say why you should be considered an authority: say something that by itself establishes your authority.

(I also recognise that I'm sort of breaking my own rule here. Mail me a stamped, self-addressed envelope, and I will send back a picture of me not caring.)

Which, in turn, leads me to:

Know Your Areas of Competence

Traditionally, knowledge is defined as "justified, true belief." When you try to share your knowledge in your essay, you have to impart your justified belief to others, so they will also accept its truth. The weaker your belief, or the weaker your justification, the less successful you're going to be having it accepted as knowledge.

Some of my most embarrassing blogging moments have come when I've stepped outside those things that I know, but have (usually through arrogance) not toned down my strident belief. Inevitably, I get taken down several notches as a result.

If you're writing outside your zone of competence, outside those things you truly know, it's time to introduce a tone of inquiry to your essay. Stop stating what is, and admit what might be. Own up to any grey areas in advance. You will in fact be more persuasive that way.

Have a Point of View

Graham quite rightly points out that an essay doesn't have to be the defense of a particular position: an essay should be written in the spirit of inquiry. (Something that shouldn't surprise anyone used to school essay questions that inevitably started or ended with "discuss". Is the American education system really that bad?)

Equally true, though, is that essays should be interesting, and nobody writes an interesting essay on a subject they have no opinion about. So when in doubt, have a point of view, and argue it.

That said, you don't have to finish an essay with the same opinions with which you started it. One of the reasons Bowling for Columbine was a much better movie than Farenheit 9/112 was that the latter was the didactic pursuit of a single viewpoint, while the former portrayed an evolving point of view. Watching the process by which someone changes their mind can be more engaging, and more convincing.

Finally, and to move from substance to form:

Aim For 1000 Words.

When I was at University, the ideal length for an undergraduate essay hovered between 3000-4000 words. The single exception was first-year Philosophy. First-year Philosophy essays had to be 750 words. This is because Philosophy tutors are smart. 750 words forces students to be brutal about culling unnecessary words, and significantly cuts down the professors' workloads. Most students managed to say the same thing in 750 words that they would have in 3,000, minus a mass of flowery verbiage.

I find when I'm reading material online, each article is allotted a relatively small time-slice. Even when I have time to spare, the web is very unforgiving to long pages of text. Unless an article is very engaging, the longer the article is, the more I will scan instead of reading it. 1,000 words seems to be my sweet-spot, both for reading and writing blog posts.

If you have something that just can't be expressed in 1000 words, consider breaking your essay into multiple parts, where each stands well enough alone to convince people to queue up the next, and have the attention clock begin again. Alternatively, consider writing a 1,000 word "Readers Digest" post, and link to a longer, complete version (perhaps a PDF that readers can print out and read on the train).

1 This practice was discontinued the year I took my TEEs.
2 While Moore's politics often agree with my own, I don't want to argue them here, and they are largely irrelevant to the point I'm making with this example.

Consider me freaked out.

I came home today and emptied my mailbox. Lo and behold, there was an interesting item within: a large orange envelope, hand-addressed, posted from within Australia. It had been diverted via some Sydney Post Office because the sender had forgotten to include my apartment number, but it had finally reached me.

Opening the letter curiously, I found two printed sheets of paper. At the top of the first was printed:

My name is Dave Rhodes, and in September 1997 I lost my job.

Well, bugger me.

Not only is this the first time I've seen Dave Rhodes in the wild since the late 90's, it's the first time I've ever seen him in print, rather than cross-posted to ten thousand different newsgroups.

The letter had been carefully Australian-ised. Rhodes seems to have moved to Perth, and the obligatory testimonials were from Sydney, Adelaide and Brisbane. And apparently, so long as you write a handwritten note containing your name, address and the words "please accept this $10.00 gift", it's all legal and above board!

The potential gain had gone up, too: the 1988-vintage Rhodes claimed to have made $50,000 each go up the pyramid for a total of $400,000, while the modern-era Dave made $70,000 a pop for a total of $1.1 million.

I checked the name at the bottom of the list: one Carolyn Jardine from Maryborough, Victoria. The postmark on the letter was also from Maryborough, so I figured I should probably ring and let her know that she was facing a possible $12,000 fine if someone less lazy than I decided to report this.

She didn't seem particularly surprised.


Because I seem to be getting lots of random hits on this, and some people don't seem to be able to understand sarcasm, I'll just add:

The Dave Rhodes scam, and all variants of it, are against the law.

If you don't believe me, ask The West Australian Government.

There is no magic wink and nod you can apply to a pyramid scam to make it legal. Whatever you do, whether it's saying you're trading addresses, or including a note saying the money is a gift, or writing the letter in red ink while singing Advance Australia Fair, it's still a pyramid scam, and it's illegal, and if someone decides to prosecute, you'll end up paying a really big fine.