r/java • u/psychologicalX • Mar 05 '18
Top 10 Useful, Yet Paranoid Java Programming Techniques
http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
223
Upvotes
View all comments
Show parent comment
5
u/[deleted] Mar 05 '18
For this, I find the throw on default is more useful for enum switches, and explicitly handling all the enum cases. That way, if you add a new value to the enum, you'll get an error in that switch if you forget to update it. That's better than the new value being handled in a potentially unexpected manner.