Oracle's Cameron Purdy took a look back at Java and C++ in a presentation Thursday at TheServerSide Java Symposium in Las Vegas. He marked Java as a significant step forward from C++ and continued, suggesting that the Java language was in a good position to thrive in years to come as grid- and cloud-oriented distributed architectures find greater use.
In Purdy's view, certain aspects of C++ proved a drawback in development in a technology world that has come to be dominated by Web browsers. He treaded not too softly on C++ in his often humorous monologue.
Why did Java succeed?
Java was able to effectively supplant C++ because of advantages it gained in terms of build and source code simplicity, dynamic linking, a standard type system, portability and garbage collection, said Purdy, who serves as vice president of development for Oracle. Prior to that, he was founder of Tangosol Inc., maker of an in-memory data grid. Tangosol was purchased by Oracle in 2006.
''The explosion of the frameworks we have in Java is a direct result of its garbage collection ability,'' he said. ''It gave us the ability to plug things together without explicit contracts. ''
No surprise there. Garbage collection is pretty much accepted as a big plus for Java versus C++. He went on to strings.
A standard type system helped Java thrive while it is still debated in C++, he said. A portion of the dedicated C++ community ''is still arguing about 'what is a string, ' in Purdy's estimation.
''There is nothing standardized there. A string could be 16-, 32-, 64-, even 80-bits, '' he remarked, citing a rare 80-bit format attributed to the Intel 80387 coprocessor. ''It seems like a minor detail, but out of the box with Java you can assume this stuff is there, '' he said.
Purdy pointed to other C++ elements upon which the upstart Java improved. These were safety, reflection, and performance. Many people would argue this last point. Here is Purdy's rationale.
''It turns out that Java performance is much better on modern architecture. That is because of multicore processors and in-lining,'' he said. Many benefits here result from an ever improving Java Virtual Machine. But your mileage may vary - the skill of the programmer is naturally still a factor.
''If you have all the time in the world you can build it to run faster in C++, or assembly, '' he admitted.
In fact, Purdy did not try to position C++ as a total laggard - he admitted that there were places where C++ still excelled. Examples he gave are boot up time , memory footprint, and deterministic destruction. Garbage collection pauses of Java can still stymie some applications, too. His argument was that the places where Java excelled made it more appropriate in the networked world of the Web.
But some advantages C++ had, in Purdy's somewhat jaundiced take, largely went away with the advent of the Web as an all-purpose platform. In Web applications where start up time matters, Python and PHP have found a role, not C++, he said
The Tangosol founder noted that the original HTML browsers were written in C and C++, but, once that was done, the field - ''the area where we build something'' - was open for Java. ''I am not going to download C++ apps to execute in the browser, '' he said, adding that ''shift happens.''
Looking ahead at JDK 7
In looking at future distributed computing as it is being portrayed by virtualized cloud computing advocates, Purdy sees a continuing role for an evolving Java. Purdy said that traits that can improve Java in distributed environments are being added to the now-brewing JDK7 tool set.
''In JDK 7 you are already seeing work on modularization. The Java NIO.2 File System in JDK 7 includes pluggable file systems. Why is this cool? A pluggable file system means the file system is no longer the OS file system. It's whatever you make it.''
This means: ''You can create a virtualized file system that is shared across an entire environment. So you are providing access to an application in a way it can be used easily. ''
''You can take existing code that is expecting to read and write to a hard drive and use it in an environment that is completely virtual, spread out across multiple machines.''
Purdy looked to find lessons from programming history. ''Learning from the past, a language is either fit for purpose or it has to change to become fit for purpose. If you look at C++ it just wasn't able to make that jump.''