It's not just closures: Another Ruby idiom shows up in Java
There has been a recent flurry of posts
discussing approaches to dealing with objects that aren’t there and methods that can’t be handled. Not to mention references back to implementing Monads as an alternative to explicit error-handling.
It’s all very refreshing, and valuable:
Ruby is growing from the fringe. And it looks like the Java folks are listening: JSR-666 has added
UnthrowableExceptions to its much-lauded
SchödingerExceptions.
The proposed syntax is familiar to Ruby programmers:
yoda (UnsupportedEncodingException) {
String s = new String(byteArray, "UTF-8");
}
Hmmm… Is this
something we’ve seen before?