Why do you think that is a good idea?

I’d argue that the when statement + sealed class is perfect here because:

  • Faster to write and smaller change of forgetting to handle a case: Alt + Enter >> *Add remaining branches* in Intellij/ Android Studio generates all branches
  • Easy to read and debug
Image for post
Image for post

Hiring Android engineer shorturl.at/bivJO Clean coder, walker & biker. Hater of inefficiency

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