Photo by James Harrison on Unsplash

The Elusive Enum Trap

Enums are both powerful and ubiquitous in typed programming languages.

They enable you to construct easy-to-follow decision paths, based on their set of pre-defined values. Plus, if you have your linter/compiler configured correctly, you can catch non-exhaustive paths pre-runtime.

In programming 101, we learn the importance of good variable names. However, none suffer so greatly and routinely to…