However,
I don't really agree with the switch case argument.
Arguably, it's way more clean looking when it comes to input handling. I tend to use it for preprocessing variables before transmitting them to a output or similar, it's nice to have them scoped.
Besides, 5 if conditions looks quite bad. Refactored to s switch case looks way better and much easier to read.
I'd probably also would love for the article to provide more proof of concepts to the arguments written.
I have to totally agree with @genspirit
up here. Even I always prefer Map, dicts against switch statements. I have updated the article accordingly. Do give a look and let me know.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Interesting article you wrote there!
However,
I don't really agree with the switch case argument.
Arguably, it's way more clean looking when it comes to input handling. I tend to use it for preprocessing variables before transmitting them to a output or similar, it's nice to have them scoped.
Besides, 5 if conditions looks quite bad. Refactored to s switch case looks way better and much easier to read.
I'd probably also would love for the article to provide more proof of concepts to the arguments written.
it's very nice anywho. ✔️
Kotlin
when
statement/expressions FTWPersonally, I'm a fan of just using a Map instead of a switch. For me switch statements just seem overly verbose and less intuitive.
Totally agree, switch is cleaner..
I have to totally agree with @genspirit up here. Even I always prefer Map, dicts against switch statements. I have updated the article accordingly. Do give a look and let me know.