In software development, they say there’s no single correct method to get something done. I firmly believe that, and live to prove that statement every single day with every piece of code I write. But recently I’ve been re-doing or touching up code that belonged to other people who were, umm, less experienced and it hasn’t been pretty. Sure, it technically worked, but not very well and with great effort for minimal return.
I hate hearing people say “the last person who worked on this had no idea what they were doing” because that’s a pretty broad statement. There are tons of reasons why something may look like it was done sloppily, but never assume that it was done that way because the author was clueless. Sometimes developers are forced to do “committee” work, which is always a losing proposition. A couple of years ago the Red Sox did “Closer by committee” and they couldn’t keep a lead after the 7th inning. The same goes for development by committee - the end product is almost invariably of lower quality than if an artistic type was left to create freely.
I call this an art form because you can do things a whole bunch of different ways, and the beauty of the work is always subjective. I’ve seen that your work, depending on your raw skill, will be either admired or reviled depending on who views it. But that shouldn’t immediately lead to the assumption that the artist had no talent, it just wasn’t the kind you recognize. This is where coding standards come in. I’m not including a URL because standards change from language to language and project to project and I wouldn’t want to confuse my poor readers (all 2 of them).
The reason I’m writing this is because, like I said at the intro, I got some of that sort of code recently. I had bid on a job, and it ended up taking almost twice as long to complete because by the time I dug into the meat of the app, it was too late - it was pretty clear that more than one person had been in there and not adhered to any coding standard. Of course, because I put in a bid and made an estimate, I’m pretty much locked in to what I had originally quoted, plus or minus a few (maybe 10) percent.
So, what was this about coding standards? Well, for the uninitiated, it’s basically a list of dos and dont’s that define the basic structure, architecture, documentation, and layout of code. Everything from file naming standards, to how many spaces you indent, to whether you use OTB {}’s or not, to which system calls you’re allowed, etc. Generally the syntactical stuff is pretty much the same everywhere you go, and only varies depending on the personal preferences of the team or project leader. This is the structured side of programming as an art form. I don’t know about you other programmers out there, but I can recognize beautiful code from a mile away.
What happens when there are no standards in place? Well, you under-bid jobs, among many other things. But eventually it costs people money. I’ve worked for places with no standards in place, and it got messy very quickly and created a lot of turnover. In this case, I will have to come in over my estimate, which means I will have to charge my client more, which means they’ll have to charge their customers more to make up for what they spent. And you know what this all adds up to, right? Poorly written or documented code is bad for the economy, which means the terrorists win. And you wouldn’t want that, now would you?