Friends don’t let friends use middleware
November 8th, 2008This post is mainly for Christer Ericson, who has a great book and a blog with the longest name imaginable. I can’t believe I have to type all that!
I’ve not met Christer in person, only conversed by email and phone, but I think we’re kindred spirits. He has been described to me as an angry Viking and given post such as exhibit A and exhibit B that’s not terribly surprising.
To be inflammatory I wanted to leave the post just as: Don’t do middleware. Or if I was going to be clever, i’d paraphrase Bowie:
My mother said to get things done
You’d better not mess with middleware
I don’t know if I have anything constructive to add. Or profound. Or insightful. fmod and havok maybe the only exceptions to the rule, but even havok has its issues.
It’s the pieces of middleware that want to abstract all platforms and hide initialization from you and take over memory management and present scene graphs and pollute your code with “smart“ pointers that take offense to. (I’ve been battling with one for the past 2 days, trying to enable GCM replay support and it still doesn’t work! <grrrr>)
In my experience middleware is seductive in the beginning. You can quickly get a simple test up and running and management likes the quick progress you make and trading money for engineering effort sounds like a good thing. It’s all lust.
But that’s where the love affair usually stops.
You don’t get pass the quick hack and all those little issues you thought you could live with suddenly become barriers which you have to deal with in your code base everyday.
Using multiple pieces of middleware just magnifies the problem.
Each one has is own vector and transform class, its own array class, its own magic memory manager system that wants to take over all allocations. This leads to insanity and spending all your time converting between one representation of a transformation to another. (And they’re likely to have exactly the same memory layout)
Casey has a presentation that sums it up nicely.
On another note, I haven’t updated this blog in ages and I might melt it down for scrap. I’ve moved to Vancouver from Brisbane and should probably write about all the difference. But it would be only for my own gratification since no-one is reading this. Except for maybe Christer when I prod him to do so.
