What are they?
Coding standards are rules that enforce a certain style of programming. Coding standards address how long source code lines can be, where blank lines should be, in general coding standards specify the format and layout of your source code. This choice is completely arbitrary and does not affect how the code executes. However, just because coding standards are arbitrary does not mean they are unnecessary. Without coding standards your project's development time and maintainability will suffer. Your project should choose or define a coding standard that best fits your needs.
Coding standards increase the readability of your source code, help others understand what the code is doing and minimize coding errors. When there are multiple developers on a software project it is important that they all agree on a common programming style since they will be reading and adding to each others source code. It is always difficult to read someone else's code and try to understand what it is doing. It is very frustrating if they have used a style of programming that is unfamiliar. Coding standards increase productivity and efficiency within your group.
If some developers in your team want to use auto format tools to change the format of the checked in code be careful that these tools do not cause the versioning control system to mark every line as changed when the code is checked in. This completely defeats the version control systems "diff" tool and must be avoided. Pick a coding standard and have every developer follow it.
Indenting.
Indenting styles assist in identifying control flow and in making the code more readable, for example, this style:
if (hours <= = 24) {
do something;
} else {
do something;
}// if
is more readable than this:
if (hours <= = 24)
{do something;} else
Spacing.
Spacing or whitespace is ignored by compilers so it can be used to make your code easier to read. See the coding standards links below for examples.