Wicket and generics and the end of Java
 
We are currently having some pretty serious trouble with Java generics in Wicket-land. There is lack of agreement among both the users and the developers of Wicket concerning how or possibly even whether to apply generics at this point. I’m optimistic that some practical and workable solution will be reached, even if not everyone is happy with the result. But that last part (not everybody being happy) is a real problem that goes far beyond Wicket.
Having a single situation where not everybody is happy with the implementation of something as basic as type safety is a major problem in that situation. However, at this point I think there is a much bigger problem looming in the background: the viability of Java  generics and possibly even Java itself. If this were the first time I had seen smart people spend enormous energy spinning their wheels with generics, that would be one thing. But this is now part of a larger pattern I’m seeing from project to project and company to company. At my last job, probably more time and brainpower was spent fussing with generics than any other single thing. You can spend enormous amounts of energy adding generics to something only to find your only option is to remove it all (or worse, gradually and iteratively find the maximum you can do before it all collapses). And the trap is so intricate that even seasoned developers can find themselves suddenly and unexpectedly stumped, bringing everything to a grinding halt.
I used to think we were wasting time with all these endless discussions of closures and that we should be working on some kind of mix-in or type arithmetic architecture. Now, I still think we’re wasting time on closures, but it’s completely clear to me that generics is the biggest problem in Java. In fact, if the problem can’t be solved in such a way that ordinary programmers can write and not just use generics, I think Java has (in the words of somebody who I never ever thought would say this about Java) “jumped the shark”.
Thursday, May 22, 2008