Java experts Adam Bien, Kirk Pepperdine, Charles Nutter, and Simon Ritter share their perspectives on Java today.
Recently I was lucky enough to talk to some of the brightest lights in the Java community in an effort to get their unique perspectives on what’s currently happening in Java. Here is what they said:
Among the most celebrated developers in recent years, especially in the domain of Java EE and JavaFX, is consultant Adam Bien, who, in addition to being a JavaOne Rock Star for Java EE sessions given at JavaOne, is a Java Champion and the winner of Oracle Magazine’s 2011 Top Java Developer of the Year Award and recently won a 2012 JAX Innovation Award as a top Java Ambassador.
I spoke with Bien to get his take on Java today. He expressed excitement that the smallest companies and startups are showing increasing interest in Java EE. “This is a very good sign,” said Bien. “Only a few years ago, Java EE was used mostly by larger companies—now it becomes interesting even for one-person shows. Enterprise Java events are also extremely popular. On the Java SE side, I’m really excited about Project Nashorn.”
Bien expressed concern about a common misconception regarding Java’s mediocre productivity. “The problem is not Java,” he explained, “but, rather, systems built with ancient patterns and approaches. Sometimes it really is ‘cargo cult programming.’ Java SE/EE can be incredibly productive and lean without unnecessary and hard-to-maintain bloat. The real problems are ‘ivory towers’ and not Java’s lack of productivity.”
Bien remarked that if there is one thing he wanted Java developers to understand, it’s that “premature optimization is the root of all evil. Or at least of some evil. Modern JVMs and application servers are hard to optimize up front. It is far easier to write simple code and measure the results continuously. Identify the hotspots first; then optimize.”
He advised Java EE developers to “rethink everything you know about enterprise Java. Before you implement anything, ask, ‘Why?’ If there is no clear answer, just don’t do it. Most well-known best practices are outdated. Focus your efforts on the domain problem and not the technology.”
Looking ahead, Bien remarked, “I would like to see open source application servers running directly on a hypervisor. Packaging the whole runtime in a single file would significantly simplify deployment and operations.”
Kirk Pepperdine is not only a JavaOne Rock Star but also a Java Champion and a highly regarded expert in Java performance tuning who works as a consultant, educator, and author. He is the principal consultant at Kodewerk Ltd. He speaks frequently at conferences and coauthored the Ant Developer’s Handbook. In the rapidly shifting world of information technology, Pepperdine, as much as anyone, keeps abreast of the implications of computing developments for Java performance tuning.
I asked him what technological changes need to be taken into account in performance tuning. “The volume of data we’re dealing with just seems to be getting bigger and bigger all the time,” observed Pepperdine. “A couple of years ago, you’d never think of needing a heap that was 64 GB, but today there are deployments in which the heap has grown to 256 GB, and there are plans for heaps that are even larger. Dealing with all that data simply requires more horsepower and some very specialized techniques. In some cases, teams are simply trying to push hardware to the breaking point. Under those conditions, you need to be very clever just to get things to work—let alone to get them to be fast. We are very quickly moving from a world where everything happens in a transaction to one in which you’ve lost if you even consider using a transaction.”
When asked about the greatest misconceptions about performance tuning he currently encounters, he said, “People think that if you have a performance problem, you should start looking at code at the very least and, for that extra step, whip out an execution profiler. I’m not going to say that I never use execution profilers or look at code. But what I will say is that execution profilers are effective for only a small subset of performance problems and code is literally the last thing you should look at.”
And what is the most exciting thing happening in the world of Java today? “It’s an interesting question, because so many people would say that nothing exciting is happening in Java. Some might be disappointed that a few features have slipped in terms of scheduling. But I’d disagree with the first group, and I’m not particularly concerned about the slippage, because I still see a lot of exciting things happening. Lambda will finally be with us, and with that will come better ways.”
Finally, what should Java developers know that they currently do not know? “‘Write once, run everywhere’ is a great slogan, and Java has come closer to that dream than any other technology stack I’ve used,” answered Pepperdine. “That said, different hardware bits work differently, and as hard as we try, the JVM can’t hide all the differences. Plus, if we are to get good performance, we need to work with our hardware and not against it. All of this implies that Java developers need to know more about the hardware they are deploying to.”
Charles Nutter of Red Hat is well known as a lead developer of JRuby, a Ruby implementation that is tightly integrated with Java to allow for embedding of the interpreter into any Java application, with full two-way access between the Java and Ruby code.
I asked Nutter to give us the latest on JRuby. “JRuby seems to have hit a tipping point this past year,” he explained, “moving from ‘just another Ruby implementation’ to ‘the best Ruby implementation for X,’ where X may be performance, scaling, big data, stability, reliability, security, or one of several other features important for today’s applications. We’re currently wrapping up JRuby 1.7, which improves support for Ruby 1.9 APIs, solves several user issues and concurrency challenges, and utilizes invokedynamic to outperform all other Ruby implementations by a wide margin. JRuby just gets better and better.”
And what is Nutter working on currently? “Aside from JRuby 1.7 wrap-up,” he explained, “I’m helping Hotspot developers investigate invokedynamic performance issues and test-drive their new invokedynamic code in Java 8. I’m also starting to explore ways to improve the general state of dynamic languages on the JVM, using JRuby as a guide, and to help the JVM become a better platform for all kinds of languages.”
Oracle’s Java Technology Evangelist Simon Ritter is well known for his quirky and fun-loving JavaOne sessions, which have included one about JavaFX on the Raspberry Pi, a credit card–size single-board computer developed in the UK with the intention of stimulating the teaching of basic computer science in schools.
“I don’t think there is one definitive thing that makes the Raspberry Pi significant,” observed Ritter, “but a combination of things really makes it stand out. First, it’s the cost: $35 for what is effectively a completely usable computer. OK, so you have to add a power supply; an SD card for storage; and maybe a screen, keyboard, and mouse, but this is still way cheaper than a typical PC. The choice of an ARM processor is also significant, because it avoids problems such as cooling (no heat sink or fan) and can use a USB power brick. Combine these two things with the immense groundswell of community support, and the Raspberry Pi provides a fantastic platform for teaching young and old alike about computing, which is the real goal of the project.”
When I asked how JavaFX can interface with the real world, he said there are many ways. “JavaFX provides you with a simple set of programming interfaces that can create complex, cool, and compelling user interfaces,” explained Ritter. “Because it’s just Java code, you can combine JavaFX with any other Java library to provide data to display and control the interface. What I’ve done for my session is look at some of the possible ways of doing this with some of the amazing hardware available today at very low cost. The Kinect sensor has added a new dimension to gaming in terms of interaction, and there’s a Java API to access this, so you can easily collect skeleton tracking data from it. Some clever people have also written libraries that can track gestures such as swipes, circles, and pushes. We use these to control parts of the UI. I’ve also experimented with a Neurosky EEG sensor that can in some ways read your mind (well, at least measure some brain functions such as attention and meditation). I’ve written a Java library for this that I include as a way of controlling the UI (we’re not quite at the stage of just thinking a command, though!).”
And what, from Ritter’s perspective, is the most exciting thing happening in the world of Java today? “I think it’s seeing just how Java continues to become more and more pervasive,” he said. “One of the areas that is growing rapidly is embedded systems. We’ve talked about the ‘internet of things’ for many years; now it’s finally becoming a reality. With the ability of more and more devices to include processing, storage, and networking, we need an easy way to write code for them that’s reliable, has high performance, and is secure. Java fits all these requirements. I’m very excited about the possibilities of Java in this space.”