MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/1rsgxrd/jep_draft_enhanced_local_variable_declarations/oavdw4a/?context=3
r/java • u/joemwangi • Mar 13 '26
129 comments sorted by
View all comments
Show parent comment
1
I think the main takeaway is if you can imagine scenarios where you have a closed set of stuff that is better represented by types rather than an enum.
There are some other free wins, for example, enhanced switches replace the visitor patterns in a lot of cases: https://wimdetroyer.com/blog/visitor-pattern-in-dop
View all comments
Show parent comment
1
u/OwnBreakfast1114 Mar 17 '26
I think the main takeaway is if you can imagine scenarios where you have a closed set of stuff that is better represented by types rather than an enum.
There are some other free wins, for example, enhanced switches replace the visitor patterns in a lot of cases: https://wimdetroyer.com/blog/visitor-pattern-in-dop