The perils of rolling your own
Join the DZone community and get the full member experience.Join For Free
it’s well understood that no matter what you smoke , whether regular cigarettes, “low-tar”, cigars, hookahs or even medicinal (or illicit i suppose) marijuana: inhaling smoke will screw your lungs up pretty good. for my part, i smoked hand-rolled cigarettes, which is probably one of the worst options: no filter to take out anything at all.
in 2002 i moved from the uk to boulder, colorado in the us. for those that don’t know, there’s probably no place else on earth with a more militant anti-smoking stance than boulder:
"in 1995... boulder voters made national headlines and created a local uproar by expanding the city’s smoking ordinance to ban smoking in all indoor public place... the boulder dinner theater had to get a special dispensation so an actor could light up on stage, as called for in a play ."
from insider's guide to boulder and rocky mountain national park by by ann alexander leggett, roz brown
as it turned out this was actually a great thing for me. it helped make quitting smoking and attempting a significant lifestyle change considerably more possible. nonetheless, the first time i went to a gym and tried to run (for just sixty seconds!) i swear i nearly died. humiliatingly, the gentleman on the treadmill next to me, easily older than my father, was barreling along at 6mph and hand been doing so for the last twenty minutes.
i definitely learned the hard way that rolling your own is bad.
i think this lesson translates into software development too. it’s often tempting to “roll your own” frameworks for various software development needs. at one point in time this was especially true for web applications. i’ve been to party this. several years back we wanted an mvc web framework with ajax support. there weren’t any at the time, or certainly none our lead engineer liked. so a couple of the guys i worked with wrote one. it was a cool project; fun and intellectually stimulating as well as educational. and we got to do things the “right” way, no more tolerating those parts of other frameworks we didn’t like. but it became the biggest albatross around our neck.
when you build your own proprietary framework there are several key problems:
- nobody's going to maintain it but you. this starts off as fun -- nobody else is "screwing" with your code, but quickly becomes a bind. in our situation in particular, with the ajax/mvc web framework there was the never ending tedium of browser compatibility issues.
- dubious value. is building general purpose frameworks *really* what you want to be paying your engineers to do? is that *really* the business you’re in? is it *really* the best use of their time?
- it's hard! sure, building 80% of the framework you think you want isn't too hard. but try finishing it. try polishing it. that last 20% is tough.
- eventually the originators leave. you may think you've got the institutional knowledge for your framework well shared. but i'm willing to bet that if the main driver behind your home grown solution leaves it'll start to rot. a year later (if that) everyone will hate it. not much longer and it'll be the reason why nothing can be done and everything about your product sucks (this is often melodrama but try countering it effectively...)
- new employees have never heard of it. so they have to learn it. and, obviously you can’t hire anybody with experience in using it.
- it lives...and lives and lives. once you have products depending on your framework, extricating yourself from that can be difficult and costly. just try convincing non-engineers that you spend time fixing this problem.
these are big problems and not to be underestimated. based on my experience you should think very, very hard before you decide to commit to investing in building your own framework for anything.
the mvc/ajax web framework we built years ago still limits us even today.
it was ok for the experienced highly-skilled programmers that built it. it was great for them to build rich one-off applications with. the trouble was, the business needed us to build dozens and dozens of cookie cutter applications…all similar but slightly different.
the trouble with that kind of work is that one doesn't tend to use experienced, highly-skilled programmers for it (or if you do, they don't stay around for long).
so then of course we had a framework that was hard for most of its users, and certainly wasn't geared to churning out cookie-cutter applications. they were frustrated and it was overly complex for the actual task at hand. part of the consequences of that was we suffered the same defects and problems in the cookie-cutter applications over and over again. and it took longer than it needed to build them and longer than it needed to test them.
once again, i learned the hard way that rolling your own is a really bad idea. we should have built a tool for building cookie cutter apps, not a general purpose web framework. quickly and reliably turning out cookie cutter apps was the business we were in, not web frameworks.
p.s. if you've still got that itch to build a framework, how about contributing to an open source one instead?
Published at DZone with permission of Jon Archer, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.