Actions

EmSys

CCoding Style - Be Clear2

From EdWiki

Be Clear ...

Some constructs seem to invite abuse. The ?: operator can lead to mysterious code:

child = (!LC&&!RC)?0:(!LC?RC:LC);

It’s almost impossible to figure out what this code does without following all the possible paths through the expression.

if( LC == 0 && RC == 0 )
    child = 0;
else if( LC == 0 )
    child = RC;
else child = LC;