Archive

Posts Tagged ‘code’

Clean Code

“A Handbook of Software Craftsmanship” – this was the intriguing subtitle of Robert C. Martin’s book “Clean Code” that I picked up at the JAOO conference in Århus, Denmark, last October.

The book really served as an eyeopener for me, and it made me think about how I can improve in my craft as a software developer, and how I can help the people around me improve.

There are a lot of problems that can arise in your code if you are not careful when writing it. The book brings many different heuristics for how to make your code better, and I recommend it for anyone writing or reading software.

So how can we become better at writing clean code ourselves?

I think the first step is to become aware of the problems, and to see examples of both bad an good code. A book like this can of course help with that, but I think it is very important to have a forum where you can discuss coding techniques and issues with others. In our office, we’re trying to get this by having a software craftsmanship study group where we, about once a month, get together and discuss topics about our craft. We’ve started by going through the chapters of Martin’s book, and it has been creating some very good discussions so far.

I’ve noticed that since I’ve started to think more about clean code, I’ve changed my view of coding. Code that I used to find quite good doesn’t look so good any longer now that I’ve learned how much better it could be. I really appreciate code that is readable and maintainable, and I find that these factors usually are more important than other quality attributes like performance. This is of course not always true, but a great deal of our code is not run in critical inner loops, and I would much more have it well readable and maintainable than super fast.

Advertisements