Geek Noise pointed to a tirade against the Cult of Performance that brought to mind a criticism that Jet had of my 10 Rules of Performance entry. The points raised are very well taken – it can actually be more damaging to obsess about performance prematurely than to obsess about it too late. The point that I’m arguing for is moderation. For some reason, developers like to live at extremes – either they’re this way or that, never in the middle. Either they never think about performance or they are completely obsessed with it. Instead, I’m arguing that performance should be a part of the development process and the thought process, but not the only consideration. (If it was, most applications would never ship.)
I suppose this is all human nature, if you look at the way that people tend to polarize in other areas. The title for this entry comes from a speech Polonius gives his son Laertes in Hamlet in which he’s purporting to give him some life advice. Since Polonius is sort of a doddering old windbag, most of the speech boils down to useless platitudes along the lines of be smart, but not too smart; be nice, but not too nice; be rich, but not too rich. However, he does end with a good bit of advice that, nontheless, has got to be the most difficult to follow:
This above all: to thine own self be true,
And it must follow, as the night the day,
Thou canst not then be false to any man.
If you think about it, a lot of my performance advice boils down to a variation on this theme. Most of what I argue for is to stop and take the time to understand the true nature of your application and work with that. Obsessing about the performance of code you haven’t even written yet doesn’t fall into that category…