Java: Myths, Realities and Prospects for App Development

Java: Myths, Realities and Prospects for App Development

According to TIOBE, Java has become the programming language of 2015 having outrun C, C++ and 17 more nominated languages, and it has been holding this position to the present day. This fact is quite fascinating taking into account the 20 year old age of the language and the long-standing stereotypes concerning it. I interviewed Alexander Mikhalchenko, a Java developer at Anadea, about what Java is as well as benefits, myths and facts associated with this programming language.

Hi, Alexander!

On the TIOBE Index, Java was entitled "Programming Language 2015". So basically I would like to know what is Java and what kind of beast is it?
Java is rather a platform than a language. Lately there appear new languages that run on the JVM but have a syntax that is different from Java. Its primary use is building the server side of apps, web and not really web apps, all kinds of corporate systems - something large, heavy.

Does it mean that all banking systems are based on Java?
Well, not all of them, but many. When it comes to development of a big software system, Java is a frequent choice. There are many reasons for that. First of all, it is fast (in spite of the myths that still circulate among amateur Java developers), comparable in its efficiency to C++ and, at the same time, has a much lower cost of development - this is its second advantage. Java is tailored for designing various enterprise features, and Sun Microsystems, who developed Java, and later Oracle, counted on this, on server technologies and related things. They have done a lot in this direction that's why for a large project, like a banking application, the choice falls on Java.

And can it be so that Java is also chosen because it is safer than, let's say, Ruby?
I'm not going to talk about Ruby but as for Java, data security is one of its key aspects. There are enough settings that allow you to restrict the execution of a certain code. When a new Java version is released, half of the subsequent patches are security ones. If some Java development company prefers an older version (the 7th one, for example) of the platform to the newer (8th) one, and the older version is not supported anymore, there is always a possibility to order paid support from Oracle, and they will make the 8th version security patches for the 7th one as well.

What about small projects? Will Java work for them too?
This depends directly on how complicated the business logic of these projects is. For example, it can be a three page site but these three pages may contain sophisticated reports with complicated data structures. However, if we talk about creating a business card site, obviously, there is no sense to use Java. The cost of Java servers is higher than those of PHP, because Java is demanding to resources. It isn't slow but ravenous - it will "eat up" as much memory as you give it.

Give Java the best food, it would still hanker for the RAM!
Exactly! (laughs)

I've heard that one of the advantages of Java development is multiplatformity?
Yes. Initially the idea was to create some kind of ultimate cross-platformity. In other words, the code written once, according to the initial idea, could be executed anywhere - on a phone, desktop, toaster… but eventually it didn't work out so beautifully because of the virtual machines manufacturers. That is to say, the code is multi-platform and can be transferred, but it may fail if a smartphone producer didn't include some feature (I'm not talking about modern mobile devices, but 2005 models, like Symbian based phones and Motorola with its own operating system that supported Java). That is why people who created games and apps back then had a really hard time with porting even within a mobile platform: launching a game on Motorola and on Nokia were two different tasks.

As for modern mobile apps - do all Android apps belong to the Java family?
Not all, but most of them. Of course it is possible to develop a native app in C++, but then again - it will be cheaper to build it in Java. And it is much better supported - by Google itself, by the OS producer, and by the Java community as well. Some things are easier to implement in Java. However, games with complex 3D graphics are usually written in C++ because Java doesn't provide the same performance in these cases.

Talking of games, I've heard that MInecraft, that caused a great stir in its time, was written completely in Java.
Partially. The graphics rendered there is an achievement of OpenGL. And it is a native code. Java is able to take any native app, written, for example, in C++ and call some functions from it. The graphics subsystem is accessed through the bridge that connects Java to native apps. In other words, all the data about the gaming world and gaming mechanics is written in Java, whereas all graphical calculations are sent to OpenGL.

The good thing here is that projects like Minecraft contribute to the popularity of the platform, because young programmers try to write their own modifications to the game in Java.

Java has been around for 21 years. Has it lost any of its relevance?
A mature platform is only a plus because during this time a wide infrastructure and community have been formed. There are libraries and standard solutions to almost anything. In other words, a programmer simply has to link all solutions together and turn them into an application. You can improve the libraries if needed and use them for commercial purposes absolutely for free. So no, it hasn't lost its relevance.

There is an opinion that apps written in Java aren't characterized by a great design. Is that a fact or a myth?
It's not true for web applications, because such an app can be wrapped in any design. If we are talking about native apps, then yes - things didn't really click for Java here. There is a story about it. At the debut presentation of Java - and I remind you that it was 1995 - there was a globe rotating on a web page in the browser. At that time such visual frills weren't warmly welcomed because of extremely slow Internet. People glanced at it and wondered why on earth they needed that rotating globe for if it required users to download a 100MB virtual machine as well as a separate upplet...

Applets on desktops didn't stick - they came up at the wrong epoch. In those times computers weren't fast enough to work with such a Java app, that's why all pretty things were scaled back and Sun decided to focus on server technology and functionality.

A simplified design is, of course, connected with the cross-platform nature of Java. It is difficult to make an app that would look native on every platform. If you set yourself an aim, you can customize the components so that the app will seem native.

There is such a thing as look and feel - you can request a platform on which VM works to provide a set of styles and components as well as their appearance on a certain operating system. And again, everything depends on the virtual machines manufacturers, besides you need to take into account the rapid development of the OS design. Take Windows, for example, there's a huge gap between the 7th and 8th versions! Evidently, you can't keep up with all design innovations but the built-in look and feel makes everything more or less similar.

Lately, I've been watching JavaFX. At some point this technology was neglected because it wasn't necessary, but not a long time ago it was taken on again and is being actively revived. JavaFX lets you create a desktop application, but style it to look like a web app. The same way CSS comes into play so that you can specify the color, edges, position and other attributes for a particular button. With this technology you can make apps that will look more native. The performance of devices already allows us to do that - modern smartphones surpassed computers of 1995 in power a long time ago.

At that I have no further questions. Thank you for the interview!
You are welcome.

So it comes as no surprise that Java has won the race against 19 other languages. A mature platform which already has solutions for all standard tasks, with huge community, designed for server side development, large scale projects and multiplatformity and compatible with native apps - isn't it attractive? The platform becomes even more appealing and popular thanks to Android apps and projects like Minecraft - after seeing such results we may expect that Java will remain the programming language of the year many times in a row.