Go Black Sox!

Maybe someone will think I’m being unpatriotic or something, but the US is the biggest and the best at enough things so I think it’s kind of cool that little old New Zealand can still beat the US in a sport that’s no more of a specialty for them than for us.

Templates Considered Stupid

There are many reasons why C++ templates are awful, but I’m going to focus on one: duplication of code. If you define a template class and then instantiate that class with two different types, what you end up with is two completely separate sets of methods. It’s not that different than if you’d defined the class for one type, then cut and pasted and done a slightly-smart string replace of one type name with the other. Anybody who thinks about it for a while would know that’s what has to happen, but a lot of people don’t think about it. Besides being unaesthetic, all of those “hidden copies” of template methods and data structures, with their mangled names, create endless headaches for compilers. . .and debuggers. . .and profilers. . .and just about any other tool that needs to manipulate the code at any level. If you need to handle one type just a little bit differently – and the whole purpose of OOP is to make that easy – it’s back to good old “cut and paste” programming with all of its attended maintenance problems. The use of C++ templates as an inadequate substitute for real dynamic typing is like the use of Java interfaces as an inadequate substitute for real multiple inheritance; both might have seemed cool or convenient to someone somewhere, but the gyrations they’ve caused further down the line (e.g. adapter objects strewn throughout the Swing toolkit) reveal how broken the original ideas were. The worst thing about templates, though, is that they cause massive pollution of the processor’s instruction cache. It’s bad enough that templates and constructor/destructor invocation and overloading can turn a single innocuous-looking line of code into tens of thousands of executed instructions, but now those instructions execute more slowly as well.

Templates are evil. All of the optimization and programming-tool cleverness in the world doesn’t make that evil go away. Just say no to templates, and say yes to maintainable and efficient generic code done any other way.

Fun With Words

Here’s a great tongue-twister that Cindy and I invented during our vacation: subliminal minimal cinnamon synonym. Go ahead, try and say it.

What do you call a clever post-modernist remark? A po-mo bon mot. It’s funnier if you say it out loud and pronounce “bon mot” without the last letters like the French would. Or maybe not.

Road Humor

A decal displayed upside-down on the back window of an SUV:

If you can read this, please roll me over.

Libertarian Parable

Once there was a ladder, leading to economic prosperity. The rail on one side said “competition” and the rail on the other said “cooperation”. A communist came along and sawed off part of the “competition” rail; the ladder fell over. A passing libertarian laughed. “Silly communist,” he said, “everyone knows you should have sawed off the other rail instead.”

Sanibel Pictures

The pictures from Sanibel Island, along with some explanatory text, are here.

Back from Sanibel

Just got back from a week-long vacation to Sanibel Island (southwest Florida) in time to see most of the Super Bowl. Revivio moved while I was gone, so I get to unpack twice today and then I have quite a bit of catching up to do on email, weblogs, etc. I’ll post pictures when I can.