in reply to Re: Two simple code style advice questions (tye)
in thread Two simple code style advice questions
But I've come to find ternaries to often be less quick/easy to read than something like:
I am with BrowserUK here, and I am happy to see you are using the "I find" instead of the way to often used "it is better to" (here in the monastery), as many idioms that are easy to parse by person A causes headaches to person B.
Personally I would try to avoid statement modifiers to any cost. I hate them. They make me read code exactly opposite of what the author meant.
I have no trouble reading (nested) ternary operations. Maybe too used to those from doing C.
You also doing java? Where 42 == $n is quite often preferred over $n == 42 because of "string".equals ($n) implies NULL checks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Two simple code style advice questions (short)
by tye (Sage) on Jan 18, 2013 at 17:44 UTC |