JavaOne: Day Two

Still having problems with my wireless, after two BIOS updates and a driver update. I'm back to hardwired network in the hotel room. Thanks to all who added more information at the end of the post on yesterday.

Today was a good day. I skipped the rather skimpy conference continental breakfast (I've really been spoiled by TechEd), got something at the hotel, and headed over for the keynote.

Scott McNealy is a very good speaker. He comes across as folksy and funny. He spent some time talking about the Microsoft and Sun agreement, and explaining why Sun did it. It's very strange for Scott to be saying nice things about MS - I guess it's good that Larry hasn't changed.

He talked a little about the press that Sun has been getting and their financial situation. This was primarily for the analysts and press (who got to stay the whole time today).

Notable events:

A game demo using Java as a script language in a first-person shooter. That's labelled as a “game using Java technology”, though I didn't think it was much of an accomplishment, as that can be said of many languages (Python, Perl, Tcl, but not - to my knowledge - about C#)

The second was a game engine written in Java, which looked okay but a bit jerky in demo. Without knowing what kind of rendering it was doing, it's hard to know how impressed to be, but details were not forthcoming.

The third was an unveiling of the Phantom by Infinium labs, where they said they would be shipping J2SE on the machine. Beyond that, and pulling a drape off a mockup of the machine, that was about it. It's obviously not working hardware yet, and the Java part really seems to be an “also available“ item.

Taming the Tiger 5.0 Talk

This was a talk that covered most of the language features not covered yesterday. The ordering of the talks was unfortunate, but I've been there at some of our conferences.

As others noted in comments to my last post, if you use 1.5 features, you have to run on a 1.5 VM. So apparently the goal was to keep VM changes to a minimum rather than having no changes. I can understand not wanting to require all JVM writers to have to make big changes to support generics.

There was lots of talk about foreach, and “gushing“ would not be going to far (“Once you start using foreach, it's addictive“. I agree that it's a great feature.

I got my first introduction to the new Java enum support. They went for what I would call a “full“ implementation, in that they're class-based rather than being based on integers (my guess is that part of this is also to keep JVM changes to a minimum).

Java enums have some “interesting“ capabilities. For example, you can write:

public enum Operation {

PLUS {double eval(double x, double y) {return x + y;}},

MINUS {double eval(double x, double y) {return x - y;}},

TIMES {double eval(double x, double y) {return x * y;}},

DIVIDE {double eval(double x, double y) {return x / y;}},

 

            abstract double eval(double x, double y);

}

 

and then write:

 

for (Operation op: Operation.values())

            double results = op.eval(x, y);

That, I submit, is a really weird thing to do, and I don't understand the utility of being able to do this as part of an enumerated type. Am I missing something here?

Static import is a feature to allow you to write something like “Sin“ rather than “Math.Sin“. I don't think this is good for a language to do.

More Programming Puzzlers

A very interesting and well-presented, in which 8 programming puzzlers were presented by two presenters (alternatively). They were all console apps, and the puzzle for the audience is to figure out what the apps print. I was slightly hampered by my lack of Java library knowledge, but I got 2 of the 8.

 

I’m happy to say that 3 and perhaps 4 of the puzzlers aren’t possible in C# because we have more stringent rules. A particular one that almost the entire crowd missed was the lack of break statements in the switch statement (I missed it, too).

 

The format they used for this was very successful, and I think it’s a nicer way to do this sort of thing than the approach I used at my TechEd talk.

 

Joshua Bloch is a very good presenter.

Expert Panel on Agile Java Techology-based Development

I didn't get a lot out of this. There was lots of good advice, but nothing terribly exciting.

I have a couple of BOFs that I'm attending later. I like the BOF concept, but having meetings at 10:30 when you've been up since 6AM isn't the easiest thing, especially when you're on your second night.