CCoding Style - Use the natural form for Expressions
Revision as of 09:30, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
Use the natural form for Expressions
- Write expressions as you might speak them aloud
if( !(block_id < actblks) || !(block_id >= unblocks) )
- Each test is stated negatively, though there is no need for either to be. Turning the relations around lets us state the tests positively.
If( (block_id >= actblks) || (block_id < unblocks) )
- Now the code reads naturally.