3 ms·
As much as I have qualms about Java, if there is one thing that it perfectly nailed, it's enums. The Java enums can be as concise as the C/C++ one but since it
by laureny 13y ago
As much as I have qualms about Java, if there is one thing that it perfectly nailed, it's enums.
The Java enums can be as concise as the C/C++ one but since it's also a class, you can add all kinds of interesting stuff to decorate it such as constructors, getters, type converters, etc... Really a pleasure to work with.
- bhickey 13y agoI have a single gripe with how Java handles enums. They would be safer to work with if it was invalid to write a switch statement with a missing case and no default. I see a lot of code like: switch (foo) { case Bar: ... case Baz: ... default: throw new IllegalArgumentException(); }
- Too 13y agoI don't know the state of lint-tools for java but for C and C# most lint-tools do this check.