6 ms·
I agree. I've never used ternary notation regularly so it always takes me out of the flow when I'm trying to decipher someone else's source.
by dpritchett 17y ago
I agree. I've never used ternary notation regularly so it always takes me out of the flow when I'm trying to decipher someone else's source.
- mdg 17y agoI cringe when I see a simple if-else, which does nothing but assign a value to a variable depending on the condition. That is the best use case for a ternary operator, in my opinion. However, I have noticed that I tend to use them liberally, and have since reverted back to if-else when there is something more than "simple" going on in the condition or post-condition.