On 06/01/12 10:10 AM, David Riley wrote:
On Jan 6, 2012, at 1:07 AM, Charlie Carothers wrote:
> I absolutely loathe "OK, if I knew for sure the ternary was faster,
> I
might grudgingly use it in an interrupt routine but I would not be
really happy about it!
I actually like the ternary statement and think it
reads a lot
clearer, as long as it's simple conditions (e.g. "foo = bar ?
baz :
NULL;" or the like, certainly nothing that needs to occupy more than one
line; I even start to get nervous when parentheses get involved).
However, I've found that a lot of people who are otherwise quite good
programmers are totally unfamiliar with it, so I tend to avoid using it
in anything I'll have to share.
Sometimes it's clearer and sometimes it's not. I will use it when I want
an expression and not a pointless obfuscating control structure :)
--Toby
> - Dave