Geeks With Blogs
The Ranting's Of A PsychoCoder Inside the mind of A PsychoCoder

When writing code I would have to classify myself as a coding perfectionist, which can be a good thing, and at the same time a bad thing. When creating a project, I have found myself writing code for an entire work day (8 hours for the most of us, sometimes longer if it's a pressing release), then I go home and research what I was working on during the day.

During that research I find that I could have done something a little better, maybe add a little more speed to the processing, maybe use a couple less clock cycles that before, and think to myself "Man why didn't I think of doing it that way?". So what do I do the next morning when I get to work, you guessed it, I rewrite as much as I have to to implement what I read the night before, trying to squeeze the last bit of performance out of my process.

The good point about being a perfectionist is this, beings that I'm aways striving for perfection in my code and applications ensures that my code is always efficient, my objects are always destroyed once they're no longer needed, my processes don't cause memory leaks, its all around efficient programming. This is something all programmers should strive for, though sadly, not all do, but thats a topic for a different post.

The good point of being a coding perfectionist can also turn out to be the bad point, those of you who are also coding perfectionist will relate to what I'm about to say. Imagine living your life always thinking about the code you wrote earlier that day, the day before, 2 weeks ago, a month ago, you get the picture. Imagine always running it through your head to see if you could have done something different, made a loop more efficient, moved a Global to inside a method to free up that small amount of memory. Now imagine you do this 24/7, even weekends, well thats me.

Coding is such a part of me that I strive for perfection, even at the cost, some say, of my sanity, and any social life I could ever hope for. I know it's a given that all programmers should strive for efficient, perfect code, but I haven't found the happy medium between looking for that coding nirvana, that ideal loop or pointer or class, and my own mental stability. Now I'm not saying I'm mentally unstable, that was, at the time, the best word I could come up with. I have all my mental faculties, I can spell my name, hell I can even remember my address :) But sometimes I spend so much time obsessing over my code, how to make it better, how to make it faster, that I often lose track of time and place for long periods of time.

In fact, this is my first blog post since my surgery because Ive spent so much time writing code, then re-writing it to make it better, then re-re-rewriting it to make it even faster, and so much time looking for better, harder things to program that I almost forgot all about this blog. Take today for instance, at the time I'm writing this post its 29SEP 8:17 AM PST, and I've been at my computer since 4AM PST, and, you guessed it, Ive been coding this entire time. Ive been rewriting code Ive written for this clients Social Network site, trying to make it cleaner, faster, better than before. I live by the "We can re-build it, we have the technology" theory: If something can be coded, it can always be coded better.

I have obsessed over this code so much, that quite frankly, I'm almost past my deadline date, simply because there were parts I just knew I could improve on, a loop that could be made smaller, moving functionality to a class or a Web Service, something, anything, to make it faster than before. And believe it or not, I accomplished my goal, I took away about 2.3 seconds of processing time in a couple database queries. Now I know some of you are going to say "2.3 seconds, was it really worth all that effort for such a small improvement?"

And my answer to you is a resounding yes. Think about it this way, if you improve a process by 2.3 seconds, now multiply that by, say 500 users at once, thats quite a few clock cycles you've saved on a little 2.3 second decrease in processing time. But also, to a coding perfectionist, improving a process by a mere 2.3 seconds is what we live for, its what drives us 24/7, that is indeed our coding nirvana. When we're able to accomplish this we feel as if we've conquered the world, and we know it's going to be a good day for us.

So remember, being a coding perfectionist is a double edged sword, though it turns out great, efficient code, it also turns out exhausted, obsessed coders. There's a reason I've had the name PsycoCoder for so many years, and that name is my personal badge of honor. Now I'm off to write some more "perfect" code :)

Posted on Sunday, September 30, 2007 8:30 AM General | Back to top

Comments on this post: Are you a coding perfectionist?

# An oness on slowness
Requesting Gravatar...
I can relate. 2.3 seconds is huge. After tweaking the queries and code it's good to test out different indexing.
Left by Lorin Thwaits on Sep 30, 2007 8:19 PM

# re: Are you a coding perfectionist?
Requesting Gravatar...
I would be worried that you're sacrificing readability for speed. How maintainable is your code?
Left by Chris Eargle on Oct 01, 2007 8:12 AM

# re: Are you a coding perfectionist?
Requesting Gravatar...
Actually my code is very maintainable. I work on a team with several other developers and no one has ever complained about the maintainability of my code :)
Left by Richard McCutchen on Oct 01, 2007 11:40 AM

# re: Are you a coding perfectionist?
Requesting Gravatar...
Cool. I asked because the hardcore, squeeze out cycles, guys I've known have written stuff that's very hard to decipher. They use tons of comments, but those comments would be completely unnecessary had the code been readable instead of clever. (Note, xml comments are different, as they're used to generate documentation).

Not that you are like that, it's just a perfectionist in that area worries me due to prior experiences =).
Left by Chris Eargle on Oct 02, 2007 7:06 AM

# re: Are you a coding perfectionist?
Requesting Gravatar...
Hi. Nice topic! Thanks
Left by BMW body kit on Nov 24, 2007 6:15 PM

Your comment:
 (will show your gravatar)

Copyright © Richard McCutchen | Powered by: