More on c++ Programming style If we write a program in an organized manner the programming as follows. Meaningful names for ibentifiers Identifiers identify different parts of a c++ program. It is therefore necessary that they meaningful names. The following guidelines would help while dealing with Identifiers. (a) Give meaningful names to all Identifiers, namely variables functions and procedures etc. for example total marks - sub1+ sub2+ sub3; where total marks refer to sun of total marks of different subjects. (b) Never used similar names like temperature and temporary they create confusion. Ensure clarity of experience Expression carry out the specified action they must therefore be clearly understood by the user clarity of expressions should never be compromised. Use comments and indentation Comments play a very important role as they provide internal doumentation of a program. Indentation makes the statements clear and readable. Sometimes commerce and indentation are not used to save program writing time but remember there should not be any compromise on readability are understandability. In c++ comments are given earlier by or brackets. Statement for matting style C++ is one of those languages which provides use free formatting style ( i.e. any number of statement can be written in one line using a statement separator). For example program to print number from 1 to 100 with statements. Include< iostream.h > Void main {} { for ( int - i- 1: i- 100 , i++ ) cout
Read Full Blog