Geeks With Blogs
Lee Brandt's Blog You're only as smart as your last line of code

We’ve all done it at one point or another. We’ve all looked at some code we were left by another developer and thought, “WTF was this guy thinking?!?” We tend to  automatically assume that the developer before us was a complete amateur. These kind of developers give us all a bad name. It’s absolutely no wonder that clients don’t trust us. With code like this, who could blame them for thinking we are all hacks.

The problem is, the customer never reads our (or their) code. If the customer has any inkling that our predecessors were incompetent, it’s because we GAVE them that idea. Most customers would know good code from keyboard knuckle-banging. All too often in our field, we are quick to judge someone else’s code. We judge code that ispartyondudes left behind without any thought given to the context that the code was written in. The problem is, without context, there is no way to judge accurately.

There have been several times in my career, that I have looked at code developed by a previous coder and decided it was crap and I was going to rewrite it. But after a major refactor or re-develop, I discover the REASON the code looked like crap. There was some strange requirement or hurdle that caused an otherwise competent developer to do something wholly terrible. I’ve done it myself. I’ve felt the crunch of deadline and thought, “This is really crappy, but I’ll have to come back and fix it later, when I have time.” It never gets fixed. I never have time. If I DO have time, I am usually thinking about the future rather than reworking something that I was less than pleased with.

Sometimes it IS plain inexperience. The previous developer came across a situation she had never encountered before and she did what she had to do to make it work and deliver on the customer’s requirements. Sometimes it’s our inexperience. Sometimes that code that looks totally crappy is quite elegant and beyond our experience level, and our inexperience leads us to assume that the code is poorly written.It’s easy to judge an athlete the day after the game, but I am on the sidelines and I don’t have all the facts. We must remember when looking at others’ code, that we do not have all the facts. We must remember that we have the benefit of hindsight, and usually much more information than the developer who originally made that call had when they made it.

We must also remember that our customer gets their impression of our competency as a profession, by how we conduct ourselves professionally. Accusing previous developers of being amateurs or stupid, only makes our profession look bad. Look at code left to you by previous developer with soft eyes.

“Be excellent to each other, and.. PARTY ON DUDES!!!” ~ Abraham Lincoln in Bill & Ted’s Excellent Adventure.

Posted on Monday, August 3, 2009 9:54 PM | Back to top


Comments on this post: Let He Who Is Without Sin…

# re: Let He Who Is Without Sin…
Requesting Gravatar...
Very aptly put. :)
Left by Chris Braybrook on Jun 09, 2010 1:06 PM

Your comment:
 (will show your gravatar)


Copyright © Lee Brandt | Powered by: GeeksWithBlogs.net