Author Andres Farias Riquelme, Senior Principal Consultant, Oracle
Java is an object-oriented programming language that provides a solid platform to build pieces of software using other paradigms, for example those based on components, aspects and services. However, since it first appeared in the late 80s, it has been said that Java’s days are numbered or that is being gradually dropped by the market. This has proven to be outright false, and in this article I will explain why we think Java’s demise is still in the distant future and why it is a good choice as an ingredient for development.
Java Will Be Gone In a Couple of Years...
This is what we have been hearing for the last decades . Sometimes those who make this claim are big fans of other languages, such as C or Python. Other times, these claims aim at sparking a debate about it. There are also universities, such as the University of Chile and the Pontifical Catholic University of Chile, or Standford University in the United States—this one being such an iconic example—, that have opted for another language such as Python  to teach the fundamentals of programming . But the truth is that regardless the intention, these prophecies have not been fulfilled and it is only reasonable to wonder if they will ever be and if so, when.
The thing is that by 2012 there was enough evidence that Java was the second most used language in the world, after C, naturally. Nowadays, the same evidence positions Java as the most used language . Trends indicate that it is not a language that is falling into disuse, but we must admit that Java started with a frenzy of trying to program every type of component using this technology, even executing code on web clients (with Applets) or providing APIs and languages to program on databases. Years have proven that Java is a language fit for programming components to be executed on the middleware.
Is Java Better Than Other Languages?
Why is it important to answer the question whether Java is the best language to build your pieces of software? Probably because you want to choose the language that will bring more benefits than disadvantages. Betting on technologies that will eventually become obsolete—as was the case with Robi, Perl or Object Pascal—would have been negative for systems that might have required maintenance afterwards. Engineers or programmers tend to look for objective and technical variables to choose the best language, arguing in their favor that it is a strongly typed object-oriented language with a balanced mix of primitive and complex data types supported on a solid theory of data types, with parametric types, lambda expressions, etc.
The problem is that most languages share those features. That is definitely not the reason why I choose Java. I strongly believe there is a more important criterion than the technical one, although its properties are necessary and not sufficient. Esperanto was a language created, by definition, to be used universally. If we had to choose the best language in the world, it would be reasonable to consider Esperanto as the top contender. However, and in my opinion, it is not the best language and the reason is quite simple: I cannot speak Esperanto, nor I know anyone who can (Google Translator can, though), but I do speak English and so do most people in the world. English is then the best language for me because learning it and being able to speak it maximizes the number of people I can communicate with.
With Java something similar happens. It is the most used language in the world , particularly in Chile—even though it may be in second place after C due to the amount of legacy software that still prevails.
The Truck Factor
This metrics in software engineering allows to estimate the risk in a project indicating how many people in my development team need to be “hit by a truck” for the project to be at risk. When the Truck Factor is very low (e.g. one person) it means the project is always at risk and I must look after my resources, and maybe even secure them.
The development of a portal in Zope (a CMS framework to create portals based on Python) has a Truck Factor much lower than a framework based on Java, for the simple reason that it is more difficult to find experts in Python in the market—even though this is changing as Python become more and more massive. Maintenance of this system will be the same or more expensive depending on the purpose of the underlying platform. Zope had its moment of (relative) glory toward the end of the decade in 2010, but nowadays there must be very few programmers, particularly in Chile, who know this language and therefore maintaining a system based on Zope will be expensive and have a very low Truck Factor.
Why Should I Choose Java and What For?
Systems are not programmed in Java. They are programmed in frameworks based on Java. Object-oriented programming makes it easy for us to build business systems, that is, systems that are fault-tolerant, resilient, highly available, concurrent, etc. To do this there are other paradigms that have delivered better results, namely: component-based or service-oriented programming, both approaches supported by Java Enterprise Edition. The main reasons to keep using Java today are:
- Skilled labor: Although not properly qualified maybe, in any case, Java programmers are far from being a scarce resource.
- Library ecosystems, add-ons and online tutorial, communities and support available: The fact that Java is a widely adopted language means that there is an overwhelming amount of support for any type of framework based on this language. When starting a development it is very important to have access to support in case of errors made by oneself or product failures. This support is critical to be able to overcome real problems, both at the time of development and at the time of operating in production. Furthermore, forums related to technologies based on Java have been growing non-stsoaop .
- Business solutions with support (WebLogic, PrimeFaces, etc.)
If This is Black, Then Gray is...
I used to play a game with my daughter where we said phrases that were always true. It is a challenging task. If we played that game in this scenario, it would be clear that there cannot be an absolute truth about whether Java is the perfect language for everything. The way I see it, Java is a good language because, as I said before, it has the advantage of being widely adopted in the market and having great support by the community, with tutorials, add-ons, etc.
Actually, the idea of a perfect language is quite subjective and I think that at a more general level it loses relevance. These days, the most important factors for organizations to consider at the time of acquiring or developing solutions or software components are: scalability, high availability of services and interoperability (communication) with other components in the ecosystem. The age of adapters is behind us, and software components intercommunicate based on standards such as XML or Json. A few years ago, I had the opportunity to see how an educational organization adopted an Oracle SOA infrastructure, that was based on Java. Since the organization had developed its own solutions in .NET, it was natural to think they might need to change their programmers for others who knew Java. However, once the adoption process was completed, it turned out it was never necessary to change the language. The components were exposed as web services through the bus, and thus they achieved an excellent level of interoperability.