Saturday, December 19, 2009

How concerned are you about Good Code?


I'm starting to read Clean Code by Robert Martin. *

Honestly, it makes me realize how unprofessional can we developers be regarding our Code. The book starts by stating that Code is even more important than meeting a deadline or documenting our requirements. Bad code can make your development team reach productivity zero!

One phrase I really liked compares our attitude toward coding practices with hand washing and doctors:

"When hand-washing was first recommended to physicians by Ignaz Semelweis in 1847, it was rejected on the basis that doctors were too busy and wouldn't have time to wash their hands between patient visits." (chapter 1)

How professional are you acting as a developer on your daily activities? For example, lets say that "washing hands" while coding is:

- unit test your code, and automate those tests.
- code on a readable way
- make sure your code can be understood by any other peer, not just a genius like you :-)
- functional test your code on your developer machine.
- check if you are adhering to architectural and coding guidelines.
- refactor so that you minimize duplication and reduce coupling.
- ask humbly for help to other developers
- tell the truth, always.

So... are you "washing your hands"?

Many of us tend to craft bad code for meeting deadlines, but the truth is that making messy code slows us down. Bob Martin says (and I concur) that "the only way to meet a deadline - the only way to go fast - is to keep the code as clean as possible at all times".

This book seems like fun!

Thanks to Mike Vizdos for the recommendation!