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.

Tech writer with +1M views. Sharing my opinion and what I learn. .NET backend engineer in FinTech. New YouTube Channel https://bit.ly/3vxqNHj

Tech writer with +1M views. Sharing my opinion and what I learn. .NET backend engineer in FinTech. New YouTube Channel https://bit.ly/3vxqNHj