The Number One NIH Syndrome Sympton (or, How I learned to not invent wheels and learned to love 3rd party components.)
I try hard to not reinvent wheels. First, I’m lazy… really lazy. Second, I normally am trying to solve a problem unrelated to building wheels. Finally, if I built a wheel you’d probably never ever EVAR even think of using it.
Image stolen from: http://www.sciencenews.org/articles/20040403/mathtrek.asp
Let’s look at the number one NIH Syndrome symptom.
Symptom #1: So I decided to roll my own.
I was happily reading The Ideas in the Spring Framework for Java that covered the basics of Dependency Injection using Spring and linked to another article, Dependency Injection without Frameworks… which screamed of NIH and slightly ruined my day.
I had to do this really small app recently. I wanted to use dependency injection, which I have come to really like now, but it seemed absolutely ridiculous to dump the spring jar and the few megs of dependencies in a project that only consisted of 20-odd classes.
So I decided to roll my own.
99% of the time deciding to roll your own is a bad idea. Yes, 99%. That is science.
I really don’t like NIH Syndrome because costs you… or I’ll end up with your code and it’ll cost me, yup it’s that whole “Maintenance” thing. When you use a pre-built wheel/framework you probably can update to the latest binary compatible Jar if you find a bug. If you wrote it though… you must find the bug, debug your apps, recompile, etc… oh, and update the docs. What? No docs?
In the Spring Without Frameworks article, the author has this to say as a positive consideration of his “framework”:
This approach is much simpler than using a framework, but at the same time the whole mechanism is exposed for all to see and understand. The less experienced developers do not face some incomprehensible thing that works as if by magic, and actually have some chance of understanding the actual meaning of DI and IOC.
Ah, magic. I am one of those less inexperienced developers and have only been using Spring for several days now and the magic that happens when I follow the documentation is great. If something works and I don’t have to think about it, does that mean it is magic? Should I care? I don’t think so. Sure I can imagine that underneath the covers it’s doing reflection to create my object, but I just don’t care. I don’t need to know. If I want to learn how DI and IoC work, I’ll go read books, code a breakable toy and talk with members of my local user group. Basically, don’t make me think. Thanks. </rant>