3 ms·
How embarrassingly narrow-minded. Yeah, Java's enums are fully fledged classes. Which actually makes them extremely powerful and useful, more useful than enums
by brazzy 14y ago
How embarrassingly narrow-minded. Yeah, Java's enums are fully fledged classes. Which actually makes them extremely powerful and useful, more useful than enums in any other language. I've seen more than one C programmer unable to cope with such an extreme deviation from their bunch-of-integer-constants expectation.
- elehack 14y agoYeah, Java's enums are very powerful and useful. But in the context of a C-style language, I can understand the "what? these are enums. why do they have methods? and subclassing?" It might be good if they had a different name.
- brazzy 14y agoThe essential property (a type having a fixed number of named instances) is still there, so the name is fine. I can fully understand that someone used to C enums would go WTF at seeing Java enums for the first time. What makes it narrow-minded is when this leads you to rejecting them outright and writing blog posts to ridicule them.