I had the opportunity to go to the JavaOne conference two weeks ago, in San Francisco. It was quite an experience for me as I had never been to a technical conference before, let alone one of that size. I’m not exactly a Java enthusiast, but I am a Java developer. I spend most of my day writing Java code, so going to all the presentations about making better Java code, as well as interacting with Java developers from all over the world, was really educational.
There were a lot of talks about static analysis tools, and FindBugs in particular. I’ve been using FindBugs on my Java code (and FxCop for my .NET code) for quite a while, but a few of the presentations gave me a much better idea of how powerful static code analysis can be. One of the best ideas is using special annotations that more clearly document the intended behavior of your code. Not only does this serve as additional documentation, it helps you design your classes better and helps out your code analysis tools. One of the first things I did when I got back was grab the latest FindBugs release and start sprinkling those magic annotations all over my code, and from now on I’ll be writing them in whenever I write new code.
I also got more in-depth exposure to the REST philosophy, which I had heard a lot about but not really thought about too much. I really like the idea, but until the tools get to the point where I can write up some sort of service description and generate client code like I can do with WSDL, I’m going to hang back a bit. Maybe WADL will catch on. I also got a better explanation of OpenID than I had gotten previously, and I’m really impressed. I like that it’s so simple, and that it can still integrate with technologies like CardSpace in a way that adds value to both sides. I searched for an open implementation of an OpenID provider that uses CardSpace, but it doesn’t look like any exist yet.
Another, less explicit theme at the conference was that the Java community has noticed the great design of C# and the .NET framework and are trying to fit some of that back into Java. I’ve always felt that C# was “Java done right”, and the number of JSRs (Java Specification Requests) that I saw for C#/.NET features is a testament to that. JavaSE 5 already added annotations (attributes), generics, foreach, enums, variable length arguments lists, and autoboxing, all features from C# 1.0 or 2.0. The stuff that’s being discussed for JavaSE 7 and beyond includes “superpackages” that look a lot like assemblies, continuations, a “using” statement, generics that don’t use type erasure, indexers, and switching on strings. I think this is great - C# made a lot of great improvements that were no doubt based at least in part on experience with Java, so it’s natural for Java to get back some of that. I didn’t see much talk of any of the C# 3.0 features like LINQ, object and list initializers, extension methods, etc. I did see some talk about incorporating lambda expressions, though, which would be pretty nice.
Despite the fact that the Java language has some catching up to do, one glaring advantage of Java over .NET became apparent to me while I was there. I’m not talking about the platform-independence advantage, though that is certainly there - I don’t think I could imagine building a large, scalable distributed service with Windows machines. No, what I’m talking about is the community. That’s not to put down the large and active .NET community, it’s just that the Java community is huge. And especially through open source, there’s just a lot more going on. I feel like a large part of this is that Sun and other Java leaders have been willing to incorporate the community’s best products into the standard toolset. Products like ant, Eclipse, Spring, JUnit, and even JRuby are accepted tools. Meanwhile on the .NET side, you’re basically taking whatever Microsoft gives you. And while that can usually be good, Microsoft runs the risk of ignoring the direction people are actually heading in.
In the end, I left the conference with much the same opinion of Java that I had in the beginning. Java is a tool, and a good tool, but not a particularly exciting tool. It does have some exciting features (I love JMX), and after my week in the Moscone Center, I feel like I can be more competent at creating Java-based software. Maybe I just haven’t worked on the right Java projects. I hope as my experience with the platform grows, I’ll be able to contribute more, either through this blog or through open-source projects. And who knows, maybe one day I’ll really feel like a Java Guy.