Hi Frederic!

Thanks for taking the time to read and reply to my story! Much appreciated :)

4 and 5 are all about creating extensible software, which is impossible with if-else.

4. Converting it into a switch does not help. The whole idea here is to remove if-else/switches entirely so that you can dynamically add new branches to the dictionary. As I also stated, the dictionary should come from somewhere else, and not be created inside the function.

5. It has seriously happened a lot in my career :)
It also does provide you with a super smooth way of just adding a new class in order to extend your application. It’s easy for all developers on a given project, when you don’t have to track down where to add another else-if statement.

Software Developer Manager | Big4 ex. FinTech | Writer with +1M views. Sharing my opinion & what I learn. YT channel youtube.com/c/NicklasMillard

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store