On 6 Nov 2002 at 4:46, CBFalconer wrote:
There is NEVER any reason for an empty else.
Clarity, perhaps? What would be your preference for rewriting:
IF a THEN IF b THEN c ELSE { null } ELSE IF d THEN e;
...without the empty ELSE? This represents the logical conditions:
* c iff a and b * e iff not a and d
It could be written without an empty ELSE as two statements:
IF a AND b THEN c;
IF NOT a AND d THEN e;
...but that wouldn't be equivalent if "a" was a function with side-effects (e.g.). Alternatives might be a Boolean variable for the value of "a", or encapsulating the second IF statement in a BEGIN-END block. Whether those are clearer than the empty ELSE is problematic (although an empty ELSE surely should be commented).
-- Dave