DEV Community

Discussion on: If (all) else is complicated, switch to switch?

Collapse
 
moopet profile image
Ben Sinclair

Because anyone who isn't used to seeing it will think it's a typo and then have to rethink what the function is doing.

Collapse
 
jmdejager profile image
🐤🥇 Jasper de Jager

But what if it is more common. At some point you would expect a turning point if there are no other downsides ofcourse.

Thread Thread
 
moopet profile image
Ben Sinclair

Generally I think people are trying to move away from functions that have a lot of conditionals, so it's probably not going to become more common.

Thread Thread
 
jmdejager profile image
🐤🥇 Jasper de Jager

good point, not a fan of them myself 😉