2 ms·
I frankly find the whole idea of the switch statement unfortunate. The switch statement in C has a really understandable compiled representation: linear code wh
by nine_k 3y ago
I frankly find the whole idea of the switch statement unfortunate. The switch statement in C has a really understandable compiled representation: linear code where you can jump into in the middle. It was fine in 1970. But in 2023 I'd expect introduction of pattern matching instead, which generalizes the idea much better. Python pulled this off successfully. Java pulled it off successfully. Lua could, too.