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.
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.