4 ms·
I find ternaries alone to be totally adequate.
by matt-attack 5y ago
I find ternaries alone to be totally adequate.
- TameAntelope 5y agoOh they work, but stacking them tends to make future reading of the code harder due to their increased complexity.
- kingdomcome50 5y agoNested ternaries can by structured to look a look like `if/else` if you put the `?/:` in the right spots. It's a balance. Extracting logic into new components (and often new files!) isn't exactly ergonomic either. I've found it's better to decrease readability if it makes understanding the logic more straight-forward (i.e. not hunting through several files to exhaust all possible outputs).