7 ms·
I personally find this _way_ less readable at a glance. Every argument you make against using switch statements I would make against doing this as well. When
by lsaferite 7y ago
I personally find this _way_ less readable at a glance.
Every argument you make against using switch statements I would make against doing this as well.
When you consider the semantics of the statements, using switch statements for this makes more sense than chaining ternary statements. Chained ternary statements is just a less readable if/else chain. Personally, if one of my guys chained a ternary like this I would immediately fail the PR.
IMHO at least.