Uglier Than Ugly
Posted by Patrick on Monday, October 26, 2009Mon, Oct 26, 2009
c/c++

Bartosz Milewski gave me a good chuckle this morning. Here's a slightly paraphrased excerpt from his video presentation.

C++ is an ugly language. I don't think I need to convince anyone of that. It's an ugly language and we love it because it gives us performance, mostly.

But there are some parts of C++ that are uglier than ugly: template meta-programming. There was no official design. It was discovered in the language.

I don't know if you watch these shows about survivalists on television. There's this guy who goes to a desert or to the ocean a dingy and he makes these contraptions that can distill water with a plastic bags and some stones, and maybe some sticks and so on. This is what template meta-programming is in C++. It's just a feat of engineering using whatever you have available at hand. You're desperate. You're far away from civilization. And this is what you do.

Having done some template programming of late, I strongly relate to this feeling. Actually, I tend to feel a bit like this just doing general C++, especially after coming from spending some time in languages like Ruby.

Hopefully Apple's Blocks extensions to the C family of languages will take root. I've banged my head against far too much horrible code to get around the lack of closures.