And when ?: is properly embedded in an expression:
f( p+(a?b:c)+q*(d?e:g))
then I'd really like to see your version using if/else.
Ignoring the visual clues provided by the indentation that there is a
divergence of execution control, your complex statment, while contrived,
doesn't explain why you are doing what you are doing. Why is it that you
might need to total what amounts to different values under *four* different
circumstances?
/* explanation 1 */
if (descriptive_condition_1)
descriptive_name_1 = descriptive_name_2;
else
descriptive_name_1 = descriptive_name_3;
/* explanation 2 */
if (descriptive_condtion_2)
descriptive_name_4 = descriptive_name_5;
else
descriptive_name_4 = descriptive_name_6;
/* explaination 3 */
descriptive_name_7 = descriptive_name2 * descriptive_name_8
vert_object(descriptive_name_9 + descriptive_name_1 + descriptive_name_7);
Notice how much more room there is for comments. Each operation is
logically split into smaller units that can be individually commented
and understood before preceding. Furthermore, the additional and constructive
use of variable names provides even more information about the values that
we are using. This approaches self documentation.
You are so impressed that you saved a little bit of typing; but, what
happens down the road when we find that there are three numbers that could
be associated with x or that if a, we really need to do three things to
know that x should be? Then you have rearange all of this section of
code (not to mention the comments) to accomadate the changes instead of
just adding additional steps to the single unit that is functionally
affected by the change.