Actions

EmSys

CCoding Style - Use a consistent indentation and brace style

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Use a consistent indentation and brace style

Indentation shows structure, but which indentation style is best?. Pick one style, and use it consistently.

If( month == FEB ) {
    if( year%4 == 0 )
        if( day > 29 )
    else 		
    if( day > 28 )
	legal = FALSE;
}			
 
if( month == FEB ) {
    if( year%4 == 0 ) {
        if( day > 29 )
            legal = FALSE:
        } else {
            if( day > 28 )
                legal = FALSE;
        }
    }
}