|
I've seen tons of buggy code in Java that would likely have been a lot more solid (and easier to have written) if Java had closures. Try out a language with easy and extensive closure use, and it becomes clear. It's EASIER to program with closures. It's easier to write more READABLE and more SOLID code.
That said, I think function types are a bad idea. Single method interfaces would work just fine, and it's easier to define the semantics around them. And someone else pointed out recently on a blog that JavaDoc turns into a nightmare for function types as parameters or return types.
Yes to pretty closure syntax (and with the Ruby-esque block version, too). No to function types.
|