I Confess…
I’m a code perfectionist. I like nice code. Nicely formatted. Nicely structured. Nicely designed code. Of course, first and foremost, the code must do what it is designed to do; it must fulfill its functional spec. But any programmer worth hiring can make code work. It’s not terribly difficult to hack code together. But it takes a true craftsman with an emphasis on extraordinary craftsmanship to write good code.
Man, I am looking at some baaaaaad code today. Ugly. Let me run down the list:
- Untyped DataSets? Check.
- Poorly named functions? Check.
- Poorly named variables? Check.
- Cramming all code into one file? Check.
- Did I mention poorly named functions? Double Check.
- Inline SQL? Check.
- Using concatenation instead of StringBuilder? Check.
- Useless catch{} statements? Check.
- Seemingly random spacing of operators? Check.
- Using DataSets where a DataReader would be more performant? Check.
GaaAAAAaaaAAAAAaaaaaahhhh! It’s seriously killing me to have to mix this code together with mine…I feel the urge to go in there and rewrite every line of it. Damn, I’m a serious code perfectionist.
I look at this code and I’m reminded of the multi-threaded web server
that I wrote when I was in college. The whole thing was implemented in
like, 2 files! But heck, this isn’t college. I expect good code and
good coding practices from the developers I work with. Or am I wrong
to impose my perfectionist attitude on the work of others? As long as
it works, right?
I touched upon my madness in “Letter to a Colleague” (an actual email that I sent to a co-worker) and “On Enterprise Library“. It’s disheartening to see code like this; it’s actually somewhat painful for me because of “The Perfectionist Plague“. I mean, Enterprise Library isn’t the most interesting solution when it comes to object persistence, but it’s a “standard” in the Microsoft .Net space and comes with a nifty configuration UI that makes it super easy to use…why do people still resist?
I dunno…I was hoping that I’d get away from these types of bad practices that are common in consulting and large companies. I had hoped that going to a smaller shop would buy me more influence and a tighter developer community where we could develop to best practices and standards. I had hoped that it would be an opportunity to not only make cool stuff, but do it “the right way” and write clean, extensible, well partitioned codebases. I was hoping that I could get the company onto the Subversion bandwagon (it’s free, it’s fast, and it’s more stable than VSS by far). I was hoping that the developers would be open to object persistence alternatives like NHibernate or maybe EntitySpaces (or, dare I suggest, DLINQ?!? Only in my wildest dreams). I was hoping that I would meet up with developers interested in design patterns and forming a common design language.
But it’s not to be…yet. Maybe my expectations are just too high. I know I’m not the best developer in the world (I’m not that egotistical) and I’m certain that many would look upon my work as untidy, but there must be places out there where I’m expected to live up to expectations, not the other way around.
Actually, the worst part of it is that I just don’t know how to approach other developers in a way that doesn’t make me out to be a total ass (as I no doubt seem like now :-D). I dunno…I’m not good at making slight hints; I’m just too straightforward and brutally honest.
Sigh :-S
Perfectionism can be really bad sometimes. I have the same problem, but of a different kind. I tend to keep on making minute changes no-one will notice long after the work that needed to be done is done.
And I find it best to just be an arse sometimes. It helps clear things up.
Isn’t it a terrible affliction?
I wonder how "normal" people get by.