Do write your own ORM

As part of my daily blog reads, I came across this article posted by Jimmy Bogard on Los Techies, and I find myself agreeing with the point, but disagreeing with the moral of the story. I understand the point he is making, that the problem has been solved and there are some great existing ORMs out there that can be leveraged, why re-invent the wheel yet again? But, as a developer, as someone who likes to take a problem head on and try and solve in the most efficient way I might want to tackle writing my own ORM. I think that if the business affords you the time to go ahead and write what you need, and you’ve looked at the existing ORMs and found them lacking, go ahead, go write your own.

Using an existing ORM affords you the time to concentrate on your domain, knowing the track-record of the software you choose gives you a comfort level that you just can’t get from your own software. Your SpiffyORM has to prove itself over time, you have to identify a whole subset of bugs and deficiencies not related to your core application. And to Jimmy’s point, this adds “cognitive weight” to the overall application.

Jimmy starts with saying that if you’re not Ayende or Greg Young that you just shouldn’t bother trying to write your own, but then proceeds to list three pieces of software that aren’t from these guys. For example, Massive from Rob Connery which I’ve read good things about. He didn’t stop at EF or NHibernate and say, “It’s done, we can’t improve”. He went ahead and did his own thing, and the result is a viable alternative ORM.

I don’t think we should be discouraged from writing software for ourselves, because others have already done it for us. If we as a race decided to stop driving forward with new ideas, where would we go? We already invented the car, it gets us from A to B, why should we try improving on that? Human beings learn through trial and error, from the moment we’re born, we investigate the world around us. So, why does this not apply to software?
Not everyone out there is going to set off down this path of discovery and come out with the next best thing, in fact I believe few of us are going to achieve that. But, if we don’t stop and ask ourselves “Can I?” (which should be closely followed by “Should I?”) then we might as well accept that we’re just monkeys tapping at keys, because the few pure genius developers among us do all the hard stuff, we don’t need to think for ourselves.

Leave a Reply