Scott
1 min readMay 12, 2020

--

One downside is that if there are extensions of Bool and other bool methods they won’t be applied to your enum. This could be also be considered going against the DRY principle, therefore it’s more code to maintain as well. Also, since you are using dot notation, you could just as well use computed properties on a bool extension to get the exact same effect. Further more it has a smell to create a whole new object for the sake of a single types naming use because bools can be used to represent many things hence being a type. For example are you going to create a unique enum for hasvalues, isloading, willTurn, etc or if you would just add more computed properties to your enum, why wouldn’t you just add those properties to a Boolean? Also when you start to pass around your instance of this enum, and you need to pass arguments as bool you will have to keep using dot notation for it everywhere.

--

--

No responses yet