IN DEVELOPMENT

The Tree Withers

Doug Lyon Fairfield University, Fairfield, Connecticut

The Java report card: infrastructure gets a D, code reuse gets an F.

omputer languages are PREDICTION IS HARD, neglect and deprecation. Deprecation uniquely positioned ESPECIALLY WHEN IT’S warnings aren’t generally deemed as a case study in the ABOUT THE FUTURE serious, as programs continue to run. C development of man’s If we establish a good reason for However, sometimes entire JVMs are most complex and powerful techno Java’s ascendancy, perhaps we can deprecated. The biggest threat to artifact—the programming language. come up with a prognosis for its Java is Apple’s banning of Java on the The most popular of these languages future. iPhone and the deprecation of the new is now Java. One of Java’s key strengths is its JVM on the Mac OS. In 15 years, my Java project portability. The Java provides a way to isolate has grown from 667 lines of code (JVM) is a high-performance, portable, and manage API instability using (LOC) to 633,436 LOC. During this and successful substrate. However, JavaBeans. The bean embodies the time, I’ve had to struggle to keep up the tectonic shift in Java ownership promise of Java code-reuse via inter- with API deprecations and defunct (from Sun to Oracle) has caused changeable parts—known as com- frameworks. Some code will no longer aftershocks, destabilizing Java ponent software development (CSD). run. What will become of Java? APIs. This has been exacerbated by Historically, the technology of interchangeable parts enabled an industrial revolution—among other things, it helped the Springfield Armory produce more than 1 million model 1861 rifles during the Civil War. However, JavaBeans never really caught on, leaving us with monolithic and brittle systems that shunned code reuse and encouraged ad hoc framework development. API complexity can reach a tipping point that causes frameworks to collapse under their own weight in a manner similar to punctuated equilibrium.

MEASURING CHANGE The number of imports and Figure 1. CutBot versus the Java tree. A tree grows from the cup of Java, only to be deprecations represents the growth hacked by the merciless automation. of the new and the withering of the

0018-9162/12/$31.00 © 2012 IEEE Published by the IEEE Computer Society JANUARY 2012 83 IN DEVELOPMENT

Table 1. Core Java API.* same year the QuickTime book was published. QuickTime X no longer Number of runs QT4J, and my QuickTime code Version Number of imports deprecations Release year is dead on that platform. There’s JDK1.1 415 41 1997 no equivalent framework to take JDK1.2 1,108 99 1998 the place of QT4J on the Mac, only competing frameworks. JDK1.3 22,545 967 2000 Java Media Framework can digitize JDK1.5 49,471 1,285 2004 video on Windows, but not the Mac. JDK1.6 90,788 1,868 2006 JMF “performance packs” enable fast *JDK1.4 is missing as the source code is unavailable execution on Windows, but not on Table 2. Endangered frameworks. the Mac. Worse, JMF first appeared in 1997 and hasn’t been updated since API Last update 2004. In comparison, FMJ (Freedom for Media in Java) can’t digitize video, Java Sound 2004 at least, not on the Mac. JMF 2003 The chilling thought is that Oracle JAI 2008 appears to have created a monolithic JOGL 2008 multimedia replacement for JMF, Java 3D 2008 QT4J, and FMJ. The new technology is called JavaFX. For me, that’s more than 6,000 LOC for JMF and another Table 3. Framework fossils. 1,000 LOC for QT4J—at least 7,000 LOC down the flusher. What do these Framework Status changes cost? javax.comm Replaced with RXTX JNI Replaced with JNA THE COST OF DEPRECATION QT4J Dead Java is the most widely used JVM on iPhone Practically outlawed by Apple programming platform on the planet. In 2005, Sun reported there were 4.5 JVM on Mac Deprecated by Apple million Java developers. Oracle says FMJ/JMF Replaced with JavaFX that number increased to 9 million by 2010. A global developer population old. Measurement of deprecations or cost. Interpackage association and and demographic survey published by imports is an easy one-liner in Unix: framework complexity are functions the Evans Data Corp. showed that 61 of the number of imports. The bigger percent of the world’s programmers grep import -d recurse . | the building, the more it will cost to used Java in 2009 (http://tinyurl.com/ wc -l grep deprecated -d recurse . | change the foundation. yduglku). Deprecations impact an wc -l entire industry! Multimedia trench warfare Suppose a deprecated LOC can Based on the information in Developers create frameworks be rewritten for just $10 worth of Table 1, we can make the following in a competitive environment. For time (an optimistic assumption, observations: example, while doing multimedia considering testing, documentation, programming, I reviewed the and maintenance). My QT4J- • The number of imports is dou- manuscript for a book by Tom dependent code is 1,000 lines long, bling with every major release. Maremaa and William Stewart of so that should cost only $10,000 • The 10-year compound annual Apple Computer titled QuickTime worth of my time. Suppose 9 million growth rate of deprecations is for Java (Morgan Kaufmann, 1999). programmers have, on average, 1,000 46 percent. On average, depre- QT4J became the de facto standard LOC to modify, at $10 per line. That cations have doubled every 18 for digitization of streaming video on cost would be $90 billion. months. the Mac (and it worked well). However, The entire software industry’s QT4J wouldn’t work on Solaris (since output in 2008 was only $303 Deprecations are the dark side Sun never licensed QuickTime). Apple billion (http://tinyurl.com/45ck4v). to API growth and have a nonlinear officially deprecated QT4J in the Deprecation of 1,000 LOC per year,

84 computer per programmer, costs 30 percent follow along the Java path? Will Oracle Without maintenance, the de- of worldwide Java programmer lead Java down the path of salvation? terioration of the API infrastructure productivity. By the way, JMF may be Oracle paid $7.4 billion (including will be the defining idea of what on the way out too—another 6,000 debt) for Sun and discontinued the it means to be a programmer of a LOC for me. Sparc line. Oracle’s middleware is declining language. Is 1,000 (or even 6,000) LOC per built on Java, and they paid for Java year per programmer realistic or ownership (they didn’t spend all that Doug Lyon is chairman of the Com- optimistic? For example, deprecation money just for storage appliances puter Engineering Department at of the JDK1.0 “handleEvent” method and Solaris). In a recent webcast on Fairfield University, Fairfield, Con- necticut. Contact him at lyon@ impacted millions of LOC, and even Java strategy, Oracle claimed that it’s docjava.com. entire books (including some of my dedicated to improving Java; how- own). ever, Oracle has made little effort I write in Java to obtain portability on frameworks beyond JavaFX. The so that code can survive the transi- emphasis of the presentation was on Editor: Chris Huntley, Fairfield University; tion from one OS to another. Now we the core runtime, mobile platform/ [email protected] face a different set of problems: code desktop convergence, and the Enter- has trouble surviving from one JVM to prise Edition (EE). another. The nice thing about the Java API is that if you don’t like it, just wait he trouble with JavaFX is two minutes—it will change. that it’s another very large, Original copyrighted illustration by quickly growing, complex- T George Beker, whose iconic 1970s WHERE DID ALL THE APIs looking technology. If JavaFX is the bot drawings were featured in Basic GO? LONG TIME PASSING answer, then what was the question? Computer Games and other publi- The Java tree is withering and How long will it be before JavaFX cations. An e-book collection of dying from neglect. Table 2 lists reaches its tipping point and needs Beker’s drawings and observations frameworks on the endangered list, to be thrown out in favor of a new is available at www.bekerbots.com. and Table 3 lists frameworks that are API? Is this the new API life cycle? All revenue is donated to a non- no longer available. Add to that the Java’s reputation is at stake, and a profit national children’s literacy 1,000 LOC from QT4J and the 6,000 reputation isn’t a coin that’s easily organization. LOC from JMF. And don’t even get minted. me started on the 62,000 LOC that depend on Java3D (if only someone would pay me $10 per LOC!). The new normal means increased framework volatility and interlocking All writers are vain, fragility. Framework chaotics require “ that programmers must adapt or die. sel sh and lazy. I build a moat around core features, ” coding like I drive—defensively. —George Orwell, “Why I Write” (1947) The alarming thing about seeing Java’s infrastructure showing its (except ours!) age in this way is that it represents a declining Java programming The world-renowned IEEE Computer Society Press is currently civilization. seeking authors. The CS Press publishes, promotes, and What will be the defining idea that distributes a wide variety of authoritative computer science and engineering texts. It offers authors the prestige of the will save or kill Java? Will JavaBeans IEEE Computer Society imprint, combined with the worldwide return? Can private ownership and sales and marketing power of our partner, the scientifi c and deployment of JavaBeans be the killer technical publisher Wiley & Sons. application? How can we monetize For more information contact Kate Guillemette, software components? How can Product Development Editor, at [email protected]. we promote software reuse? Why is reusing software so much harder than rewriting it? How will we control www.computer.org/cspress complexity? Should we continue to

JANUARY 2012 85