3 ms·
> What's a case where I'll have a problem if I don't use this decorator? If you are explicitly setting enum values, it causes accidental aliases (duplicate val
by dragonwriter 8y ago
> What's a case where I'll have a problem if I don't use this decorator?
If you are explicitly setting enum values, it causes accidental aliases (duplicate values) to be an error early rather than a source of (potentially subtle) problems later.
It also specifically communicates intent to other readers of the code, which can be just as important if your code has a lot of enums,some of which do use aliasing intentionally.
- DonaldPShimoda 8y agoI see, okay, this all makes sense. Thanks for the concise explanation!