Why you should follow Coding Guidelines

Best piece of code is the one which is coded properly. What does 'properly' mean to you ? The very first answer I get is that the code should do what it is supposed to do. Very seldomly I get to hear that coding properly also means that the code is easy to read, modify, maintain and debug.

Writing code "properly" becomes more and more important as the number of developers working together on the same code base increases. First reality check happens when a fresh college grad joins a big IT firm and have a look at the vast amount of code laid out before him. If the code is not maintained and documented properly, his enthusiasm to work and collaborate get a big hit. On the other hand, if the code is following proper coding guidelines - this adds more to the juvenile spirit and he might start contributing to the project well before his Manager would have expected.

If you have ever worked or had a look at any open source project, you will realize the importance of following coding standards. If the code is not properly structured and documented, anyone else other than the original author will find it really difficult to accomodate the code in their own application. And what good an open source project is if others are not able to use it. So, always be ready to spend some thought over how to maintain the quality of the code from the first line you type.

Yet another benefit of following Coding Guidelines is that you minimizes the chances of bugs appearing because of syntax related issues. Consider this small code:

if (pList)

Now, there is a whole new functionality I have to add after do_something(), let us call it do_something_extra();

if (pList)

Do you see a problem here? My new function is getting called even if pList is not true - which may not be desirable. The problem would have easily been sorted out if the original code had used proper parenthesises. In this case, chances of making the same mistake which I made becomes a bit more difficult (however no one can beat a person who is hell bound on making mistakes knowingly).

if (pList) {

If you are still with me, then you do realize the importance of following Coding Guidelines. In case you want to know in detail about many such programming practices to follow, grab a copy of my book - "Hello World: Student to Software Professional " published by Partridge (A Penguin Random House Company). Now available worldwide on all the MAJOR ONLINE Stores - Amazon, Google Play, Flipkart, Barnes & Noble and many others.
comments powered by Disqus