khaines / enigo.com wrote:
> I came to that line.
> 
> I looked at it.
> 
> I called it stupid.
> 
> Sure, it's concise, but what did I gain by making it so concise over 
> making it so that it was clearly readable a year and a half later?

Here, have a cookie. A Cookie of Clarity. It has extra doses of golf 
urge repellent.

Usually, the problem is the "clever" solution was stupid since the 
start. I see nothing clever about just randomly stuffing some logic into 
as few characters as possible - (ab)using the syntax flexibility makes 
sense when you can achieve let's say a reordering of the terms that's 
more natural (not necessarily quick) to read than the more common would 
be. That example line of code just requires me to keep the whole ternary 
conditional operator in my head as I try to mentally evaluate the condition.

Ternary operators are inherently evil whenever nested, although a bit 
more terse in the good term when used as a single expression. Putting 
the "else" result on a newline and indenting the ? with the : considered 
sexy, I find it very easy to visually separate the condition and the 
different results then using the quadrants split up by the operator.

David Vallner