CCoding Style - Use active names for functions
Revision as of 09:30, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
Use active names for functions
- Function names should be based on active verbs, perhaps followed by nouns.
now = getTime(); , putchar(‘m’); , etc
- Functions that return a Boolean (true/false) value should be named so that the return value is unambiguous.
if( checkOctal( c ) )
doesn’t indicate which value is true and which is false, while
if( isoctal( c ) )
makes it clear that the function returns true if the argument is octal and false if not.