Archive for August 8, 2006

Programming Tip #10 - Follow the coding standards, avoid the common mistakes

Code reviews and code changes become time consuming when there is no discipline followed during the coding process itself. The discipline is more around following the standards itself. The following are the most possible causes I could think of in lack of discipline following the standards.

  1. The developer is unaware that there exists a coding standard.
  2. The developer understands there is a coding standard but does not know or understand what those standards are.
  3. Most important, very lethargic to follow the standards in the first place. This is the most common mistake I have seen. Following the standards need to become a habit, so that at one point you really don’t need a standards document to refer to, it comes automatically like how you don’t realize that you are balancing when you ride a bike.
  4. Procrastination to address standards and finally missing implementing it. Most of the time developers write a test code to make sure that the logic works. But finally that same code gets inserted into the actual code. My question is why not code to standards even while writing the test code? If it is useful, you can directly embed that in your code. If it is going to be a scrap code, so what you are making sure that you are getting the standards habit.
  5. Documentation - I know this is a left out area, why because when the thought comes “It is the logic, what is there to document it? anyone can read it and understand” The truth is, no it is not easy to understand, the approach and thereby logic differs from one person to another. A lot of things go in your mind when you code, the reviewer or another developer reading it will not know these. This is what I recommend on documentation. You don’t need to have a formal comment statement, make it casual, and add some funny text in between and at the same time try to convey the message. If you don’t cover documentation when you code, it will pile up and you will not be able to do it at the end. I have seen developers think for sometime for their own code when I ask them to explain the logic during code review.

 View all programming tips

Blink this Programming Tip #10 - Follow the coding standards, avoid the common mistakes at blinklist.com    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at blogmarks    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at del.icio.us    Digg Programming Tip #10 - Follow the coding standards, avoid the common mistakes at Digg.com    Fark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at Fark.com    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at Furl.net    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at NewsVine    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at reddit.com    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at Simpy.com    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at Spurl.net    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes with wists    Bookmark Programming Tip #10 - Follow the coding standards, avoid the common mistakes at YahooMyWeb

Comments      Cosmos


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.