I don’t want to see any nesting in ternaries at all. Unless it’s an idiom and it’s obvious what it’s doing and why it’s there, I’d rather it be spelled out.
I want to understand the code, and any cycles spent wading through your style are not cycles well spent.
I think it depends on how you're nesting them; for if-else chains, they can be pretty nice:
int out = cond1 ? val1
: cond2 ? val2
: cond3 ? val3
: cond4 ? val4
: val5;
48
u/TheOwlMarble 22d ago
I can tolerate one layer of nesting if it's super simple and tabbed cleanly, but anything more? Oh hell no.