Sunday, December 9, 2012

It's not cake we are baking

I recently watched a talk on Vimeo where Christin Gorman talks about how cookie dough relates to Hibernate; why use the generic, bloated and one-fits-all solution when you can mix together your own yummy cookie dough? We should aspire to be the Gordon Ramsey of software, not the college student who can only cook Ramen noodles. If you haven't watched or listened to her talk, you should; it's only a few minutes long, and she brings it really well. Go ahead, I'll wait.

When I first watched her talk, it rubbed me the wrong way, but I couldn't yet figure out the flaw in her plea. It recently dawned upon me that we are not in the business of baking cakes, but we are in the business of serving hungry people. And those people really don't care which ingredients were used to bake your cake; they only care about how it tastes, how fast it's served, and how much they're paying for it. And although the romantic in me really sympathizes with her view, the realist just can't. Over these few years only, each and every attempt of a hand-rolled ORM I've seen, ended with a horrible aftertaste. There is no way that you spend as much time building a good API from scratch as you do setting up an existing one. Writing and maintaining your own ORM is not a trivial thing to do, and there are already so many flavors* - from grandma's recipe to decadent supreme deluxe - to pick from, that it's hardly ever a justified decision. Read the package and choose the option that satisfies your daily caloric needs, and go from there. You can still sweeten, or swap some ingredients, before serving. And if you really can't resist - which is perfectly healthy, bake all the cake you want, at home. Maybe, one day, you can bring a successful one to work.

* NHibernate, Entity Framework, Dapper, Massive, Simple.Data, LLBLGen Pro, OpenAccess, SubSonic ...

6 comments:

  1. "And those people really don't care which ingredients were used to bake your cake"

    I beg to differ.

    ReplyDelete
    Replies
    1. *Most* people don't care?

      Please elaborate.

      Delete
  2. IMO most mistakes in software are not about how you bake the cake, but about using a recipe for cake when you actually need bread.
    This is also why a top chef needs to know a lot of recipes; this enables him to intuitively know how different ingredients can be combined to make the perfect dish when given a few ingredients...
    If you only know one way to make broccoli (i.e. steam it), you will never be able to tell whether that is the best way to prepare it...

    ReplyDelete
    Replies
    1. There's definitely truth to that as well. Let's assume she knew it was cake they wanted though ;)

      I agree with knowing lots of recipes, but I'm guessing that top chef will also try new ones out for himself, before he uses them for the public.

      Delete
  3. It's the old "Don't reinvent the wheel, unless you want to learn about wheels". Data access is a solved problem and an ORM is one of the solutions.

    ReplyDelete
    Replies
    1. ORM tries to solve all data access problems but I've yet to come across a project without a data related problem..

      Delete