Re:Using the switch(true) pattern in JavaScript
by TeMPOraL on Monday April 12, 2021 @06:21PM
(#26785913)
There should be a rule that forbids applying this reasoning to code that isn't triple-nested template SFINAE mess, or a code-generating-code-generating-code-generating-code Lisp macro.
This pattern isn't "cleverness", it's just a readability-improving trick that's cheap to figure out. The hundred seconds you spend on it seeing it for the first time is a one-time cost.
Re:Using the switch(true) pattern in JavaScript
by tantalor on Monday April 12, 2021 @03:49PM
(#26784247)
That's why I abstain when I'm oncall (or backup).
That's what the oncall bonus pay is for.
Re:Using the switch(true) pattern in JavaScript
by t-writescode on Monday April 12, 2021 @03:55PM
(#26784332)
Replace alcohol with 2 hours of sleep, then :)
You're going to hate your former cleverness then.