Thank you! I like the approach of using a dictionary. However this way you can not combine cases One to Three, right? In our example I would be fine with it, but If we would have many cases, I would kind of dislike it.
Yes, that will force you to write all the cases into the dictionary - and it is a shortcoming of this approach. There are advantages for both approaches, just choose the most appropriate one each time...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you! I like the approach of using a dictionary. However this way you can not combine cases One to Three, right? In our example I would be fine with it, but If we would have many cases, I would kind of dislike it.
Yes, that will force you to write all the cases into the dictionary - and it is a shortcoming of this approach. There are advantages for both approaches, just choose the most appropriate one each time...