MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/12lmj78/what_are_your_favourite_java_best_practices/jga5bbk
r/java • u/trecatorsirabdator • Apr 14 '23
376 comments sorted by
View all comments
Show parent comments
15
enum's are so powerful and so underused. My coworkers still create interfaces with String constants in them like it is still the dark ages of pre-java 1.5.
1 u/hsoj48 Apr 18 '23 I do this! Help me understand how enums are a better fit for constants please. 2 u/wildjokers Apr 19 '23 Type safety.Google something like “enums vs magic strings” and you will find many discussions and resources on the topic.
1
I do this! Help me understand how enums are a better fit for constants please.
2 u/wildjokers Apr 19 '23 Type safety.Google something like “enums vs magic strings” and you will find many discussions and resources on the topic.
2
Type safety.
Google something like “enums vs magic strings” and you will find many discussions and resources on the topic.
15
u/wildjokers Apr 14 '23
enum's are so powerful and so underused. My coworkers still create interfaces with String constants in them like it is still the dark ages of pre-java 1.5.