FrustratingnessRepresentative Plugs

Code Beauty

January 8th, 2008

Had a meeting at work in which several huge changes to the way our software is developed were discussed, including (I shit you not) a move from CVS to SourceSafe in order to allow us to do file locking and avoid merging. As if that was an advantage.

But the change that shook me most was a relaxing of our coding standards with the view that if you write code and it passes tests, then who cares if your code is formatted nicely. I can see how that would have come up. The company where I work is fanatically anal about things like code reviews and coding standards. Reviews for even trivial changes need to get past two extra pairs of eyes before even getting close to the repository, and sometimes it’s hard to see the benefits behind the percieved delays to ever-present deadlines. If you forget to put a curly brace on its own line, then you can expect another half hour before your revised changes get passed by your reviewers. These new changes are born out of this frustration, but they are disasterously misguided.

Writing effective code is more than a conveyor belt of tasks that need to be completed. Finished code is more than a green tick on your unit testing app. Code-writing is a craft, and there are good craftsmen and bad ones. It takes discipline to write code that conforms to strict standards and doing it right becomes a kind of art form. Good code is a beautiful, wonderful thing.

So the next time you are writing code and think that it doesn’t matter where you break your long line, or wether your variable name takes the same form as your other variable names, think again. To have the discipline to create beautiful code is something worth working on and worth having. If you can have that discipline, which is the discipline to take pride in your work, then you will have the discipline to do everything else that follows - writing thorough unit tests, documenting decisions in the code as you make them and all the other hundreds of ancient good practices that developers often like to quote blindly.

It’s connections like this, between caring about correctly indenting your lines, and the quality of the final product, that are hard to see at first glance. I only hope someone high up in my company makes that connection before we throw away some very valuable pickiness when it comes to the appearance of our code.

Entry Filed under: Uncategorized

1 Comment Add your own

  • 1. Rob  |  January 8th, 2008 at 6:31 pm

    I feel for ya. There are few things worse than trolling through someone else’s badly formatted, confusingly labeled code.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories

Links

Recent Posts

Calendar

January 2008
M T W T F S S
« Dec   Feb »
 123456
78910111213
14151617181920
21222324252627
28293031  

Posts by Month

Posts by Category

Meta