Interesting article you wrote there!
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. ✔️
Personally, 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..
Kotlin when statement/expressions FTW
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.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.