3 ms·
$x=a if (condition) then $x=b If you think of programs as logic then I see the lines above as a logical expression written in CNF conjunctive normal form
by emorning3 2y ago
$x=a
if (condition) then $x=b
If you think of programs as logic then I see the lines above as a logical expression written in CNF conjunctive normal form, where each line is a clause.
whereas this...
$x = condition ? b : a;
...is like a nested logical expression.
And breaking the program down into clauses makes it easier to understand, for humans and computers.