i agree about the "first smell", the inverted condition, and fairly recently started doing the reverse:
$x=a
if (condition) then $x=b $x=a
if (condition) then $x=bI don't care that its not the most efficient way to do things, programming languages exist to make things easier for me.
$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.