Thanks for the article. I found myself switching to this pattern a while ago. Especially in one case where I had 3 binary flags controlling logic, a dictionary (Python) with 8 tuples of 3 True/False values was so much neater. The only thing I'm still struggling with is the best way to handle when the provided key isn't one that's expected, essentially the equivalent final "else".
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.
Thanks for the article. I found myself switching to this pattern a while ago. Especially in one case where I had 3 binary flags controlling logic, a dictionary (Python) with 8 tuples of 3 True/False values was so much neater. The only thing I'm still struggling with is the best way to handle when the provided key isn't one that's expected, essentially the equivalent final "else".