Isabella, my second oldest daughter, just made the cutoff to be featured on one of the very popular “Mommy Blogs” out there, Totally Tots. Way to go Bella!
I promised that I would post the links I mentioned in my talk last night at the Memphis JUG…here they are:
General Session Replays: http://java.sun.com/javaone/2009/general_sessions.jsp
BlogTalkRadio: http://www.blogtalkradio.com/JavaOne
JavaOne Minute: http://channelsun.sun.com/video/channel-you/javaone+minute/23867338001
Technical Sessions 2008-2009: http://developers.sun.com/learning/javaoneonline/ (Must be SDN Member - FREE!)
The Da Vinci Machine Project: http://openjdk.java.net/projects/mlvm/
Groovy: http://groovy.codehaus.org
Java.net Community Corner: http://wiki.java.net/bin/view/Javaone/CommunityCorner
JUGS Community: http://community.java.net/jugs/
Scala: http://scala-lang.org
SpringSource: http://www.springsource.com
JUG-USA: https://jug-usa.dev.java.net/
OpenSolaris: http://opensolaris.org
Neal Ford: http://nealford.com (Can download his slides here)
Findbugs: http://findbugs.sourceforge.net
Grails: http://grails.org
Grails Podcast: http://www.grailspodcast.com
JavaFX: http://javafx.com
Griffon: http://griffon.codehaus.org
Java Store: http://store.java.com
Jython: http://jython.org
Clojure: http://clojure.org
JRuby: http://jruby.codehaus.org
Sun Cloud: http://cloud.sun.com
Project Kenai: http://kenai.com
Zembly: http://zembly.com
NetBeans: http://netbeans.org
I’ve finally published my review of the EXCELLENT book by Jared Richardson and Matthew Bass at DZone. Check it out here: http://books.dzone.com/reviews/career-20-take-control-your.
For several years now, Neal Gafter (Microsoft) and Joshua Block (Google), have made a habit of presenting various incarnations of this technical session, focused on what they call “Java Puzzlers.” Java Puzzlers are nothing more than short Java programs with curious behavior. It is a somewhat interactive session, with each puzzler’s code listing followed by a four possible choices (A,B,C,D) to answer the question: “What does it print?” Neal and Joshua “require” that every attendee vote for their answer. After the vote, they reveal the correct answer and how to fix the problem. At the end of each problem presentation is the most important part, which is the Java programming principle that is illuminated by the puzzler. These are important tools to carry with you as you go forth a develop your Java code.
The following is a listing of the problem titles that were presented:
I’m going to spend my time focused on the last puzzler, as it was the one for which I was ABSOLUTELY CERTAIN that I knew the correct answer. Here’s the code listing:
public class PrintWords {
public static void main(String[] args) {
System.out.println(
Words.FIRST + " " + Words.SECOND + " " + Words.THIRD);
}
}
public class Words { // Compile PrintWords against this version
public static final String FIRST = "the";
public static final String SECOND = null;
public static final String THIRD = "set";
}
public class Words { // Run against this version
public static final String FIRST = "physics";
public static final String SECOND = "chemistry";
public static final String THIRD = "biology";
}
So here’s the problem. We have two versions of class “Words.” We compile class “PrintWords” against the first version and we then run the class against the second version. What does it print out? I used my trusty “seasoned Java programmer” knowledge to assert that the program would print “the null set.” Why? Well, any seasoned Java programmer realizes that static final variables (or “constant variables” - what a curious concept) are inlined by the compiler. So it’s quite obvious that “the” would be inlined wherever FIRST appears, null would be inlined wherever SECOND appears, and “set” would be inlined wherever THIRD appears.
Imagine my frustration when Josh and Neil announced that the program would in fact print “the chemistry set.” As it turns out, null cannot be inlined! It is not a constant variable. So when we run our Java program, the JVM smartly picks up the non-null value of SECOND that is is able to find in the new version of Words.
Simply because this one got me, I wanted to highlight it for my readers. The “moral” of this story is that only primitives and strings can be constant, and that null is not a constant. One should use a constant field ONLY if its value will NEVER change. For final fields whose value may change, they suggest the use of an ident() method:
// Returns its argument
private static String ident(String s) {
return s;
}
// None of these fields are constant variables
public class Words {
public static final String FIRST = ident("the");
public static final String SECOND = ident(null);
}
The compile will not inline the call to ident.
Want more? Pick up a copy of Neal and Josh’s book, Java Puzzlers: Traps, Pitfalls, and Corner Cases!
On Wednesday morning, JUG-USA was fortunate enough to get about 45 minutes with the “Father of Java” himself, James Gosling. Each year at JavaOne, Sun distributes registration discount codes to interested JUG’s. The JUG with the most registrations using their code gets this meeting. JUG-USA’s founding allowed us to use a bit of strength in numbers to wrestle this crown from the bigger European JUG’s for the first time that I know of.
The session was setup as an informal Q&A. I took furious notes on several of the questions that were most interesting to me, and I’ll do my best to collate them into something intelligible here. Note that where I use quotes it’s mostly to set off his answers…please don’t take them as direct, but as paraphrases.
The first couple of questions surrounded web buzz. James sees Web 2.0 as “hype for folks who want to sell their books.” When asked about the semantic web, he says his feelings are mostly positive, but maybe its an answer searching for a question. He feels that some parts of it will never perform.
When asked about Scala, I was pleased to hear him say, “I like Scala a lot. They’re doing some pretty nice stuff.” He talked about how functional languages lend themselves to proving properties of programs, which can then lead to automatic decomposition onto multiprocessor systems. He wishes that the Scala guys would focus more on this aspect. He also said that he fears that Scala is almost going down the Perl route of making things “too concise” and that it’s still awfully hard for many programmers to “get” the functional stuff.
The next question was a rather predictable one - “James, now that you have the benefit of 14 years of experience with the Java language, is there anything you would have done differently?” Funny thing was the first thing out of his mouth was that the current AWT event model would have been one of the first things to go. Generics and closures were things he quickly mentioned that he wanted to have done, but he also said that there was quite a bit of arguing within the Java team about polishing for years vs. shipping the language. James said he felt like there was a certain window of opportunity out there that they needed to ship the language within to be successful (and it looks like they hit it). Continuing on down the list, James mentioned Eiffel-style precondtions and postconditions and type inferencing. He explained that the entire type system was designed to make C programmers comfortable, and at the time that was clearly the right decision. He state that at this point, the C/C++ comfort factor counts for nothing, and remarked that the casting syntax in Java is just “dumb.” A follow-up question surrounded whether or not primitives should be a part of the language. James called this a hard problem, asserting that a “uniform type model can lead to bumpy behavior or bad performance.” He said that the Scala specification gets around this with a dual object hierarchy (I need to look this up to see what he means.). He continued to talk about the definition of equality vs. identity, explaining that primitives can’t have identity; in fact, they may never exist except as a figment of the compilers imagination, optimized away (my notes are fuzzy on this…when I get the recording I’ll clean this up).
The next question surrounded a statement that one attendee of the recent Google I/O conference heard, that threads are “deprecated” as a concurrency model. James immediately retorted that concurrency has very many ideas around it, and that it has been an active Ph.D. thesis generator for 30+ years. He mentioned competing models such as Actors in Scala and Erlang, and Communicating Sequential Processes (CSP) process algebra from Occam. He asserted that with CSP most people typically don’t “think that way very well. People with Math degrees think it’s cool, but everybody else is kind of like…huh?” He stated that no data sharing between threads makes a lot of problems go away, but that often times casting problems that way can be intractable. A big quotable: “All of the different threading paradigms feel to me like whack-a-mole.” He closed the concurrency question by mentioning Guy Steele’s work on Fortress, where they are doing automatic decomposition from functional constructs into multiple threads of execution, making all of this issue transparent to the programmer.
Since this is getting pretty long, I’ll mention that James says he knows that Larry Ellison, Oracle CEO (and Sun “suitor”) has downloaded JavaFX and personally written apps with it, saying it is “pretty darn tasty!” (Again, don’t take this as quoted…it’s definitely paraphrased).
Other quotables: “Android - it’s hard to know what to think about it. It seems like a corner hobby project, chaos looking for a place to happen.”
“The exception system was DESIGNED to be a complete PITA.”
All-in-all, a great time was had by all. Thanks James for your time, it was definitely fascinating hearing your thoughts on so may different areas of the Java landscape.

I happened to catch Guillaume LaForge’s tweet this morning about a “Groovy lunch” at JavaOne today. After our JUG-USA meeting with James Gosling(blog entry on this one to come), I made my way over to the “cafeteria” and found Guillaume, James Williams (of the Griffon team), and John Smart in exactly the location that Guillaume specified. We were shortly joined by Grails in Action (a.k.a. San Gria) co-author Glen Smith. Topics ranged from things we can do better with Groovy/Grails testing, the differences between the Groovy and other dynamic/scripting language communities, Groovy’s victory in the ScriptBowl, and none other than the differences in public transportation between the southeastern US and the Bay Area. I had a great time guys and will see you at the BOF.
I also finally got the chance to meet Dick Wall of the Java Posse. Dick is just as great in person as he has sounded for the past couple of years on the podcast. Unfortunately our chat was ever so brief, focused around the language features Dick would like to see in future versions of Scala. We were quickly ushered over to the Java.net “presentation area” to participate in Josh Marinacci’s JavaFX Q&A. Was also good meeting him and seeing the cool new UI controls in FX.
The JavaOne 2009 Script Bowl was quite a delight to watch. The players were Jython (Frank Wierzbecki), Groovy (Guillaume LaForge), Clojure (Rich Hickey), Scala (Dick Wall), and JRuby (Thomas Enebo). The event was divided into two rounds:
Each of the players focused on different angles during the language feature round. The Jython focus was squarely on the readability of the language. Frank’s key quote was Python looks an awful lot like “executable pseudocode.” The Groovy focus was a subset of Guillaume’s “What’s new in Groovy 1.6″ talk, and highlighted the new compile-time metaprogramming/AST transformations. Rich Hickey directly attacked concurrency using Clojure, demonstrating a multi-threaded “Life” demo that highlighted the power of software transactional memory.
I really enjoyed Dick’s angle for Scala - demonstrating that most of the Java small language changes contained in Project Coin are already present in the Scala language and very useable! Thomas Enebo went straight for the WOW factor by showing how easily a Ruby DSL can be wrapped around existing Java libraries with JRuby to create a very compelling 3D game.
Next came the community round. This was actually the most impressive part of the whole session. Frank kicked off the Jython community focus by highlighting an interactive “art IDE” called Field that drives the Processing language. The chose Jython as the scripting language for the environment. Very neat.
The Groovy demo was something to behold. Guillaume started off by demonstrating SwingPad, an exploratory IDE for building Swing applications with Groovy. But the real treat was a very impressive Twitter+NASA Worldwind mashup built very concisely using Griffon. I really need to give Griffon a try.
Rich Hickey demonstrated the power of Clojure to build a data-driven, functional, template based website. It took an existing HTML template (with 0 code) and transformed it using “css-like” selectors provided by a enlive. Seemed a lot like what you can do with XSLT, but much cleaner.
Dick demonstrated scouchdb, a Scala library for interacting with CouchDB.
Thomas’ focus was on just how big the Ruby community is, from developers, to conferences, to books, to IDE’s, to libraries.
At the end of the session, the winner was decided by crowd noise, with Groovy winning the day and Scala coming in second. My take home from this session is that really all of these languages bring something very interesting and powerful to the table, and I hope all of them continue to succeed. Great job everyone!
03 Jun
Posted by: Matt in: javaone2009
Here’s the link to my slides from my podcast Wednesday morning from the Java.net Community Corner: Download PDF.
The morning session opened with a HUGE elephant under the rug - “Where is Oracle?” There’s no booth in the Pavilion - super strange.
Things kicked off very slowly. Jonathan Schwartz, Sun CEO, for all of his ponytail excellence, wasn’t exactly inspiring a great deal of excitement in the crowd. In fact, the loudest applause from the audience was initially for the tech support guy who fixed the projection for one of the demos.
Thankfully things eventually got moving. Verizon and Sun announced a very exciting partnership whereby Verizon will expose their network elements to Java developers. Things like presence, location, friends and family lists, mobile-to-mobile lists - all of these will now be accessible to the developer. These specs will come out on July 27. This announcement is very exciting as it means that Verizon phones will now be a very powerful platform for Java mobile development.
The JavaFX demos were really cool. They demoed one of the new LG XCanvas series of TV’s, which actually run JavaFX on the TV itself. Processors and video codecs actually live within the TV, and the TV is connected to the network. Live, on-demand, interactive content is now available directly on the set, and it’s very smooth. It seems that JavaFX continues to be the center of innovation within Sun. This continued with a demo of the new JavaFX visual authoring tool. This was very impressive. JavaFX apps are now possible with absolutely no coding, which makes them extremely accessible to content designers. Visual assets can be dragged and dropped onto the stage, animation can be built by recording drag motions, no compile-build-deploy cycle. Another great features was visual wiring of component properties to UI controls. Very smooth. And apps can be deployed directly to the Java App Store via the tool.
Funny, this was the big oops of the keynote. Nandini Ramani leaked the “liveness” of the app store before the official announcement. Nandini - “And you can deploy directly to the App Store.” Jonathan - “We haven’t launched the App Store yet.” OOPS.
But the App Store was immediately announced next. http://store.java.com is now in private beta, and I quickly registered and got an invite. I was playing with the App Store in the following session and downloaded two applications. Extremely like the iPhone App Store for Java. You can now distribute your Java applications directly to billions of consumers with Java-enabled devices. At this point it only supports free applications, as they have left it up to the community to provide feedback on how money should be collected. Nice move. Very impressive. This could be a game changer for the Java platform if it’s used correctly.
FINALLY the elephant came out, but it took Scott McNealy coming on stage to get it done. It was very interesting how Jonathan Schwartz unceremoniously left the stage. Scott thanked him twice for his stewardship of the company - it was a very obvious yet implicit changing of the guard. Funny that they should decide to introduce Larry Ellison, CEO Oracle, via a great amount of cheesy images (Java flying on the sail to Larry’s yacht, etc.) At the end, while no promises were made, Larry said that we should look to the past to see what the future will hold and expect more of the same. “I don’t expect any significant changes.” I hope that holds true. The audience very properly gave Scott a standing ovation as he left the stage, a nice gesture to a guy that has continually kept Sun on the cutting edge of technology.
All in all, it was a bittersweet keynote, but I’m cautiously optimistic about the future of the platform. Our landscape is continually changing, and the future is uncertain. If everyone’s being transparent, however, good things are still to come.
02 Jun
Posted by: Matt in: javaone2009
My second lightning talk at Community One West 2009 revolved around the still relatively recent announcement that Java is now supported on Google’s App Engine.
What exactly is Google App Engine? It’s none other than a way that you can run your Java technology-based applications on Google’s massive infrastructure.
As far as the “Geekxecutive Summary,” Google has provided:
Several services are provided to you by Google as a Java developer:
The nice thing about Google’s services is that where possible they always provided a way in through standards-based Java API’s.
Now, on to tools:
Probably the most significant piece to this puzzle is the fact that Google is not simply supporting Java the language, but Java the platform. It’s a standard JVM, so other languages running on the JVM will happily run on Google App Engine as well. At this writing, I knew of the following languages that are known to run:
Here’s the screencast from my talk. Enjoy!