We write programs to instruct computers. When programming using a high level programming language like C++ or Java, we are using a syntax that is somewhat closer to human languages. However, we use these programs as inputs to either compilers or interpreters to be converted to computer understandable binary format. For this reason, as far as the program code adheres to the syntax of the used programming languages, the compilers and interpreters never bother about the layout or visual formatting of the program code. However, as human programmers, we ourselves need to bother about the aesthetics of the program code.
What is a Coding Standard?
A coding standard is a set of guidelines, rules and regulations on how to write code. Usually a coding standard includes guide lines on how to name variables, how to indent the code, how to place parenthesis and keywords etc. The idea is to be consistent in programming so that, in case of multiple people working on the same code, it becomes easier for one to understand what others have done. Even for individual programmers, and especially for beginners, it becomes very important to adhere to a standard when writing the code. The idea is, when we look at our own code after some time, if we have followed a coding standard, it takes less time to understand or remember what we meant when we wrote some piece of code.