First off, let me frame this post by asserting that I’m not a Microsoft hater - far from it, actually. I dig many of the dev tools (i.e. Viz Studio), the tablet pc os and their mobile technologies are pretty cool.
Additionally, the .NET family of technologies certainly has some really cool stuff buried in there. Beyond the CLR and some of the (potentially cool uses) other low level technologies, the overwhelming coolness to .NET is the well packaged framework. Building on the lessons learned from older frameworks and APIs (mfc, atl, win32, swing, jfc, yada) the Mother of All Frameworks arose. And we - the dev community collectively - clapped.
Who has written a low level C# service and not oohed and ahhhed over how simple it is to do such tasks as, oh, add performance counters (which are horribly nasty in raw win32), implement a windows service or access networking resources? I don’t care how low-level you consider yourself, you probably look on with a sense of awe with how slick the framework itself really is. Well done, ms, well done.
Ok, enough cheerleading … on to the rant aspect of this post…
There’s a certain allure to a shrink wrapped prepackaged dollop of code that I can’t deny exists. I mean, given a particular task, how cool is it to find a class or assembly or com object already written to solve said task? Sweet, I can go play some video game tonight and not be stuck at the office. A bit of that ain’t a bad thing, right?
Well, here’s my issue. A lot of developers I’ve met these days are completely addicted to drag-and-drop Wizardry. They have Wizarditis. Their approach to writing something new and outside of their comfort zone is “Show me the wizard!”
What’s a symptom of wizarditis, you query? Well, here’s a few, and I trust you can extrapolate from there…
- Do you break out in a cold sweat if you can’t find a free .NET assembly for sending secure SMTP mail messages?
- Do you head to monster.com if you are tasked with writing a TFTP server and your google searches come up shooting blanks?
- Do you lockup whenever a customer issue is brought to you that appears to be - Gasp! - inside the blackbox of one of your shrink wrapped bits of code you googled off the net?
If this is you, you may very well be among the afflicted. Never to worry, it’s not a terminal condition - IF you act right away.
My prescription for you?
The next time you have to solve a problem you have no experience with, write your own set of classes from the ground up. Every. Last. Line.
That’s right, the ground up. Use as little prepackaged code as you can get away with (search/sorting you get a pass) to accomplish the task at hand. And mind Occam’s Razor, make it only as complex as needed, no more. Code for contingency cases. Think about run time traces to make it diagnosable for field issues. Think about reuse. Use good OOP practices. Research the thing at hand first. Is a standards based protocol you need to work with it? Read the original RFC. Learn, dig, be curious.
Now clearly I’m not saying do this for every last thing. You have customers, you have a boss, you have deadlines. But every so often just say No to the “Wizard” approach to software. Dig in, understand stuff, learn and grow a little.
We’ll all be better for it.