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!


Rachel said...

Hi Oscar,

Really interesting read ... I like the "Now wash your hands analogy".

Keeping productivity up while still crafting good code is an ongoing battle. Being from a component vendor (DevExpress), I wondered if you, and the team you work in, use any 3rd party products like CodeRush and Refactor or R# in your quest to keep your code clean?

Great piece. I enjoyed the read :)


Oscar Centeno said...

Hi Rachel. thanks for writing!

Currently, we are not using any tool. I downloaded and tried CodeRush and I think these tools are really cool and a good programmer can really benefit from them.

My focus now is on teaching programmers on how to design good code.

I used to depend heavily on processes and tools, but I tend to forget the people... and I'm realizing that its esential to focus on people first.

I think that for a good programmer with good design skills, the next step is to use good tools.


賴彥美 said...

IS VERY GOOD..............................

Anonymous said...

Read all the related Posts:

64 Software Manual Testing Interview Questions

Answers To Common Job Interview Questions

Behavioral Questions In Interviews

Questions to Ask at an Interview

Competency based Interview Questions

Read all the related Posts:

How to avoid missing defect in Software Testing?

Defect Management Process

What is the difference between a Test Strategy and Test Plan?

Beginners Guide to ETL Testing

Step by step guide from Test Case Development to Test Execution