Jeff Atwood has stated “Nobody Cares What Your Code Looks Like“. If you read through the post and the comments you see a trend in the responses that appears to assume elegant / well written code and code that serves the end users are exclusive of one another. This really isn’t true at all, but more importantly, posts like this give the impression that they are. People find what they are looking for, but more often than not, we look for what supports what we already know or what we already feel. So, if I am an architect who believes that elegant code is a must, and part of my craft, then I will disagree with Jeff’s point. If I am a manager type who disagrees with my team’s constant demand to refactor, then I will happily reference Jeff’s point. But the challenge is not in picking a side – the real challenge is recognizing that you and your clients deserve both.
I find that the major hurdle in writing good code is not programmer knowledge or detailed specifications or a clearly understood end user - it’s discipline. As a matter of fact, if you look at a lot of the software engineering initiatives making a lot of noise in the programming world, you’ll notice a trend. RoR and their “Convention over Configuration” mantra, Microsoft’s Guidance Automation Toolkit and Extensions, even Unit Testing to a degree (pick your poison here) – they all strive to enforce (or give you the tools to enforce) an approach to writing code. Coding standards, code reviews – they do it to. They are all attempts at discipline surrogacy.
And there is a reason for this – discipline in programming is hard work. It’s not fun, glamorous, or even remotely engaging. It’s definitely not going to make you a blog superstar.
As a programmer / architect, all of these initiatives should tell us a lot about our craft and where it is currently falling short. Intuit has done a lot of work on PSP/TSP, and I was on one of the architectural teams that went through the program. While it is no silver bullet, it does give you great insight into how you program, what mistakes you make and, most interestingly, that you make the same mistakes over and over again. It was this process that made me realize how important discipline is in coding, and that the most dangerous attitude to have in programming is one of the creative genius. Don’t get me wrong, there is a ton of creativity in programming, especially at the architectural level. The danger lies in falling in love with your creativity and sacrificing your code or user satisfaction to the whims of your ego.
So don’t listen to Jeff, and don’t listen to the creative genius types – focus on discipline.