James Montgomerie’s World Wide Web Log

The Fallacy of Premature Optimization

From a link on Hacker News (the occasionally interesting “Reddit for Erlang, Lisp and Haskell using proto-entrepreneurs”), this 2006 ACM Ubiquity article:

Every programmer with a few years’ experience or education has heard the phrase “premature optimization is the root of all evil.” […] Unfortunately, as with many ideas that grow to legendary status, the original meaning of this statement has been all but lost

I would not agree with all the proposed solutions to the problem, but I do agree with most of the observations.

One of the most frustrating things I found when working on performance at Apple …


Syntax of the Future Past

There is a fair amount of complaining on The Internets at the moment about Objective-C and Apple’s choice to use it for the iPhone. Many newcomers to the ‘platform’ (if I can apply a singular name to Mac and iPhone development) are finding the language - and the Cocoa frameworks based on it - very confusing. Just how can a language with sooooo many square brackets! be at-all easy to use, after all?

This provoked some deja-vu. Hadn’t, my vague memories asked me, this complaining been done before? I seemed to remember some talk of an “alternate syntax” for Objective-C based…


Every Inch of My Love (Every Centimetre in the UK)

A-Hot-Peice-of-Grass-1.jpg

This weekend, I cleaned out the ex-belongings of the previous residents of our flat that had been sitting in the sort-of-corridor-area outside our door since we moved in (if you’ve been in our flat, you’ll know what I mean). Amongst the waitressing clothes, semi-broken electronics and Christmas ornaments was this mysterious and highly dubious looking CD. With curiosity (and a healthy dose of trepidation), I played it today. I was mightily surprised.

It turns out that the clue to what’s on it is in the title, not so much the imagery.

For your listening pleasure: eMusic, iTunes (UK), iTunes (USA).…


In Case of Software Emergency…

Crashes.png

“Which one accurately depicts the way your software treats the user in the event of an emergency?”

From Jeff Atwood’s www.codinghorror.com. I am not sure I agree with the article completely, but I love the imagery.


PWD in the Title Bar (or, “a Regex Adventure in BASH”)

PWDInTheTitleBar.png

In which a five-minute hack to put the current working directory in the title bar of the Terminal descends into hours learning the surprising arcanities of BASH.

Like most developers, I spend a lot of time at my computer living in Terminal (and the rest Xcode)*. I have what might be a strange tendency to open a new Terminal window for each new task, I think so that I don’t have to lose the context in my current window. This means that after I’ve finished doing something (or in the middle, when I look at the screen and my obsessive-compulsive side…