|start | find | index | login or register | edit|
by earl, 4765 days agoNeal Gafter: "I'm co-author of a draft proposal for adding closures and local functions to the Java programming language for the Dolphin (JDK 7) release. An abbreviated version of its current state is reproduced below. It was carefully designed to interoperate with the current idiom of one-method interfaces." [via LtU@]
kinda 'one down, n to go' if java 7 really gets something like that. most notably, type inference (at least a very basic one) becomes more and more desirable.
an interesting aspect is how fundamental a change the introduction of closures really is. java the platform (aka the APIs, library, J2SE, your choice here) is an extremly extensive beast: at the moment roughly 3200+ classes/interfaces in 160+ packages. usage/design idioms crying for closures can be found in almost every package; think collections, networking, threading, swing, to just name a few. with the introduction of generics, the sun engineers did an admirable job of carefully sifting through most of the existing, sun-maintained core APIs and consistently adapting them to the new possibilities. certainly a very tedious task to do. but actually one to be repeated for any fundamental language addition, closures certainly falling into that category.
java's core APIs have long been a kind of reference for API design in the larger java ecosystem. overall, the J2SE APIs are quite well designed and have been made very consistent throughout the years (and java versions). i can only hope that closures really make it into java, preferrably rather sooner than later. but i further hope that sun is aware of its position and provides a strong set of best practices for closure usages, to at least somewhat prevent bad code/API design enabled by the new possibilities.
14 active users
|earl.strain.at • esa3 • online for 6769 days • c'est un vanilla site|