|
|
|
|
|
by specialist
3433 days ago
|
|
The compiler should be helpful. I love checked expressions, hate Optionals. I'll be happy when the language pimps stop trying to make Java look and act like a scripting language. Edit: I apologize if I've offended anyone with my opinions. I hope this helps. http://bit.ly/1S1943H |
|
They generally also break encapsulation (though you can kind of work around/sidestep this by making top-level visible errors more opaque)
Do you have a good reason you'd like to share for liking checked expressions? It seems like the reason you like it is because it's enforced by the compiler -- but I don't think this makes them the right choice, as the compiler could easily also enforce exhaustive handling of an Optional (or sum types like other languages).
If we limit ourselves to the case of Java 1.8, it is a fact that optionals are not checked by the compiler, so there is a solid benefit of using checked exceptions, solely that there is a compile time check of whether the exception was accounted for.