4 ms·
> somehow JS devs have decided switch statements are bad huh. You obviously haven't played with Redux yet, it's basically switch statements all they way. The
by Illniyar 10y ago
> somehow JS devs have decided switch statements are bad
huh. You obviously haven't played with Redux yet, it's basically switch statements all they way.
The JS community is the biggest programming community in the world, there is no way you can lump anything on the community as a whole.
- timbuckley 10y agoIndeed, I've never seen anyone use anything but switch statements in Redux reducer functions.
- labrador 10y agoRedux is a wonderful piece of software and of course I use switch statements. I was referring to this question on reddit/r/javascript which kind of boggled my mind. I didn't know there were people advocating against switch statements. https://www.reddit.com/r/javascript/comments/2582qv/is_switch_ever_a_good_idea_in_javascript/ https://www.reddit.com/r/javascript/comments/2582qv/is_switc...
- Forlien 10y agoDid you link the wrong page? It looks like they are advocating switch statements.
- labrador 10y agoIf you read down, there are people against them. I didn't know this was a thing. The top comment is saying of course, switch statements are fine. There are other posts if you search for switch in r/JavaScript. This one is probably more indicative: https://www.reddit.com/r/javascript/comments/3a4ras/how_often_do_you_use_the_javascript_switch/ https://www.reddit.com/r/javascript/comments/3a4ras/how_ofte...