Following the Instructions on the Paint Can

I was chatting on the phone with a friend of mine a few days ago, and he described a project he recently inherited. It was the work of a half-dozen different developers, who each built their parts of the project in a completely different way with little to no communication between any of them. The code tells the story: you'll find the rank amateur; the pattern-a-holic; the global variable guy.


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2005/05/following-the-instructions-on-the-paint-can.html

The problem with software is that you build a doghouse and someone else sticks it on their 747. It could even be over-engineered for the intended purpose, but someone can always find an unintended use where it will truly suck.

You know while you’re working on fixing code like this you have to chuckle every once in a while or you’ll start crying lol. It’s amazing how many truly bad developers there are that still have jobs. Developers out there who don’t bother to read the “directions” e.g. “doing their homework first”. I’m not talking about dataset vs custom objects, just the CS 101 kind of work. Imagine a plumber who builds leaky pipes and customers keep calling him back year after year for more work. Wouldn’t happen but it does in the sofware world.

Please note though I didn’t mention inexperienced - we were all their once and we’re all inexperienced at some level. I was working on some visual studio integration last night and I was feeling very humbled!

But in the industry’s continual (and mostly ineffectual) effort to clean itself up with hundreds of versions of directions on how to build an application we still need to keep a couple morons around so I can stay employed :slight_smile:

Being honest here…how does a bad programmer know they’re writing bad code. It’s like a person with no fashion sense. Do they know or care…they just know they have clothes on so it should be acceptable. Same with programming…it worked…so it should be good.

I know I write my share of bad code. Sure, I write it off as crunched development time sometimes…but I try my best to not rush things. You have a certain set of base rules and a template you generally work from to help guide you along.

Do I have fashion sense? I’m not sure until someone else evaluates my code. Most of the code I write, I end up maintaining. Others that have had to maintain it have not mentioned to me that it was difficult to understand or “poorly coded”…so I think I’m safe.

Where do you learn to write good code? I read Jeff’s blog. :stuck_out_tongue: Read others that I believe are smarter than me and know their stuff (Scott Mitchell, etc.). Follow Microsoft’s Best Practices. I just don’t know…but you do the best you can with what you have…you and your knowledge. Does anyone you know really have professional training to be a developer?

I think you hit the nail on the head when you said you “know” when you right bad code but obviously the term “bad code” is very subjective to say the least. What I feel is bad code to me might be perfectly exceptable to other developers. It’s hard to draw the line between inexcusable bad code and plain old inexperience. Often times it’s a combination of the two whether you’re just starting or have 10 years in the field. You can’t be an expert at everything and everyone is going to make mistakes.

But when you’re talking about a bad developer in my mind they have certain traits that almost always lead to bad code:

  1. don’t do their homework. You know these developers, they don’t read any books, or read about best practices, or visit Jeff’s blog :slight_smile: , They just plain don’t practices their skills and their just there to collect their pay and do minimal work as possible (ok minimal work isn’t always a bad thing lol :slight_smile: )

  2. Don’t learn from their mistakes nor work to improve themselves. These are the people who run into the same glass door day in and day out and can’t figure out why their nose is always sore.

  3. No passion. seriously this is a big one for me. I hate working with other developers who don’t LOVE what they do. Whether your a developer or a plumber if you love what you do you’re going to be better at it.

I’m sure there are quite a few more I could list out but I guess the point is a bad developer will consistently produce bad code. I know that sounds really obvious but seriously think about the jobs you’ve had and think about that coworker that everyone has that has been at the company for years yet produces consistently bad code but nobody calls him a “bad developer”.

So all in all you’re always going to see bad code for whatever reason it may be but it’s the bad developers that frustrate the hell out of me. As much as it makes my life harder I can probably deal with the rank amateur and the pattern-a-holic guys but the global guy is the one who gets under my skin because he knows there is a better way but he’s too lazy to do it or doesn’t care to find a better way to do it.

In short do your homework and have a passion for what you do and you’ll always be payed well and respected for your work :slight_smile:

I am often put in the following situation:

Someone comes to me with dried paint roughly in the shape of a doghouse, they want me to fill in the doghouse underneath, but they want me to change the color of the paint, and, to be perfectly honest, what they really want is a 5 bedroom house for their family and they figure that since the doghouse is roughly the same shape as a person-house it should be easy to just make the doghouse-paint bigger right?

I’d LOVE to be able to just follow instructions for once.