Re: [Discussion] Implicitly backed enums
On Tue, 2024-05-21 at 18:48 -04:00, Bilge <[email protected]> wrote:
> >What would be the downside to having all "basic" enumerations actually
> being implicitly "backed" enumerations?
I'm not Larry but I see a lot of value in knowing that a unit value was explicitly constructed
in code, and where the value cannot originate from a conversion of some input. It is particularly
useful when refactoring in a large codebase to know that every way SomeEnum::A can be constructed
will contain an explicit reference to that case in code.
The uses you suggest are not without merit, of course! And that's why I'm also grateful
for backed enums as an option where they make sense (e.g. for values which are ultimately stored in
a database).
mjec
Thread (21 messages)