I fall in the camp that nested ternaries are bad and should be refactored to make more sense to the casual reader so setting breakpoints on indented ternaries will never be in my code.
I find use cases for ternaries exceedingly rare. I only use them in trivial cases, like:
var foo = (useA) ? a : b;
Even then, I'm a lot more likely to do:
var foo = b;
if (use A) {
foo = a;
}
Pretty much only really use them when the case is trivial and there's an aesthetic benefit to keeping the whole assignment on one line (e.g. it's just one in a long list of things being assigned).
2
u/nschubach Mar 27 '15
I fall in the camp that nested ternaries are bad and should be refactored to make more sense to the casual reader so setting breakpoints on indented ternaries will never be in my code.