Category programming?

Hoops to Jump Through

Whose idea was it for C++ classes that have virtual functions to not automatically have a virtual destructor? There is just no reason for this not to be the case. Not having a virtual destructor is just not going to ever do that right thing when you’re dealing with a polymorphic class. Most of the […]

disable_shared_from_this

About once a year I end up thinking that using boost::enable_shared_from_this is a good idea. And every time it ends up wasting almost an hour of my time. You see there’s a restriction on shared_from_this that disallows its use in the constructor of the object that is being shared from this. Unfortunately this restriction is […]

Blame the Management

So I’ve come up with a new reason that C++’s lack of garbage collection is problematic. The strange thing is that the reason is in one of C++’s usual sweet spots: performance. Really I should qualify the previous statement, I’m talking about performance in multi-threaded programs where you actually want your software to work in […]

Poor-man’s Closure

So C++ is lacking in some areas of modern programming language design, that’s not a big secret. But given the flexibility of C++ the question becomes: how hard is it to add missing features? Here I’m going to take a look at closures and lambda expressions. First off we can talk about closures. As far […]

Missing the point

OK, I’ll admit. I’ve jumped on the SICP bandwagon. I’ve worked through about half the book1 and am really liking it. Of course I’ve come to it a bit late to the book not being a computer science graduate, though it seems these days one probably wouldn’t get exposed to it anyway or so I […]

pointer-less?

One thing I remember about Java back when I was working on enterprisey sorts of things is that for a language that supposedly has no pointers it sure seemed like we got a lot of NullPointerExceptions. NullPointerException was definitely the biggest cause of production bugs followed closely by ClassCastException. So if a language is purported […]

Bacon

My Microwave oven really wants me to eat a lot of bacon. I’m vegan and live in California, I’m already quite aware that my culinary habits are not exactly in sync with those of the average American. Even so, every time I go to nuke a tofu dog my microwave dutifully reminds me of this […]