Java 5 is better, but I still prefer perl, python, and lisp
Josh Bloch and Neal Gafter spoke at both Denver JUG and Boulder JUG last month. They gave a fairly thorough run-down of the features in Java 5 (that's what they're calling it now). If their show comes to your town and you want a quick boost into the Java 5 features, you won't be disappointed. There was plenty of code to give a flavor of how the new features improve your programming life.
It was interesting to look at Java 5 features after having programmed in perl and with bOP for the past eight months. I'll say out loud that I think they have made many improvements. They seemed rightfully proud of what they have created. But there's clerly a fundamental difference in values. Josh and Neal really appreciate the compiler and want it to do more work for the programmer. Whereas I'm getting much more value from tests these days. I suppose I shouldn't dis' compilers. Dynamic languages need 'em too. But in my experience with perl and python, the compiler is just the first set of runtime errors. :-)
Letting the 'for' loop also behave like 'foreach' is a great improvement. Coupled with type-safe collections you will have to do radically less casting. But I've also grown quite attached to perl's map and grep, and python's list comprehensions. These are related to foreach, but in many cases even more useful. Java still doesn't have them nor the first-class functions and closures needed to really appreciate what these language constructs can do.
Josh and Neal were quite excited about the new enumerations. Until I began work with bivio, I had never used enums. It was very nice to hear someone explain again when to use enumerations and why bother. I have been using enums for months now and implicitly know when to use them, but I don't know if I could have explained it until now. In case you are like I was, here's how I understand it. Enums are a collection of things that you might store in a table in a database except that you don't need to change the list of items at runtime. The example Josh offered was menus in your application. They're a group of related things that behave similarly, but you only change them with new releases of the software.
What Josh and Neal were excited about was that enums are full blown objects, not just integers with names as in C. That means you can add methods to them. Exciting if you're coming from a C or Java background. But Rob and Paul and David wouldn't be so impressed. bOP's enums have had methods for years.
I won't do any more blow-by-blow comparison of new java features with perl or python or bOP. My own experience looking at these new language features just validates Paul Graham's assertion that programming languages vary in power. So Java 5 is more powerful than 1.4, but not quite as powerful yet as perl and python. bOP adds some very useful things to perl. And we'd all be better, faster, and stronger in lisp.