News for hackers. Stuff that matters.
Re:When are enums not a code smell? by dtech on Monday November 22, 2021 @09:35AM (#29306679)
This might have been valid in 00's Java/C#. However, most modern languages and even Java 16+ have good Enum support and exhaustiveness checks, making them very convenient and safe to express a limited set of possible values.

In contrast, an alternative like polymorphism + a visitor is safe, but excruciatingly verbose and hard to follow and modify.

There are no comments on this comment yet.