Hey Philipp!

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

The 6 lines of code were definitely overly simplified.

In this case with an object needing to have it's implementation changed due to state transitioning, it makes perfect sense to apply the State pattern.

And as we obviously know, if-else is a niche language feature that shouldn't be used.

Written by

Tech writer with 621K+ views. Sharing my opinion and what I learn. Danish C# backend engineer in FinTech. Ex Big4 senior tech consultant.

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