Cleaner Code For A Better Tomorrow
Wednesday, August 5th, 2009 Blog, Coding for Seo, Programming, SEO, Website Design by adminCleaner Code For A Better Tomorrow
(why code indenting, commenting is important)
The actual thing, which works behind our web page, is the coding and it makes possible the smooth running of any website. When a programmer writes a computer code he addresses to two things, one is the machine that is actual computer and other is the human beings. For machine, this code is known as syntax and it should be according to the proper instructions, while for human it is simple coding, which should be clear enough that the coder or any other person can read it at any time of emergency or in some other situation. Sometimes, the co
der itself need to read the code in order to know about some error or some other person can also need it for its personal use. So, in both the cases if the code is written in such a manner that it is comprehensible, then it will save you from big trouble.
If the code is written in such a way that it is readable to humans and machines both, then it means you will not face any difficulty in your website. The best way to make the code clean is to format it, like; if the code lines are to long, then break it in smaller lines, so that they are easily understandable by every one. Another way to format the code is to indent the code. Code indenting is important because it gives the coding a structured look, which make it easy for the reader to read and navigate through the code. This thing also help in identifying that which part of the code is incorrect or not written well. However, one can do the indention to his own choice but this should always be according to the indentation rules, so that some other reader can also understand the indentation.
Another way to make the clean code is the use of frequent comments in the documentation of the coding. This thing helps the reader or any other user who wants to see any error or want to see the code for their personal use, and then they will come to know about certain things through these comments. These comments are usually written in the plain language, which are also embedded in the coding. This helps in the quick identification of certain tasks and help in getting the proper information. The comments, which are embedded in the code, are ignored by the computer and they are just for the human beings to use in certain situations.
If there are not proper uses of comments, then this can be problem for the reader at later stages. Effective use of comments always give a conceptual summary of block code, which also explain most complicated codes use in the whole coding and also explain its subjective constant values. There is no need to repeat the simple and obvious things in the comments because this will make the hassle and it will be difficult to ensure which comment belongs to which code. So try to make the comments to the point, by avoiding the repetition of exact code.
