CCoding Style - Consistency and Idioms
Revision as of 09:30, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
Consistency and Idioms
- Consistency leads to better programs.
- If formatting varies unpredictably, or a loop over an array runs uphill this time and downhill the next, or strings are copied with strcpy here and a for loop there, the variations make it harder to see what’s really going on.
- But if the same computation is done the same way every time it appears, any variation suggests a genuine difference, one worth noting.