A Concern for Java We All Should Share
Join the DZone community and get the full member experience.
Join For FreeA few days ago an article appeared on Javalobby entitled What is Your Greatest Concern for Java? My main concern for Java in the last year has been the lack of progress on the desktop technologies front, and more generally as a development platform for client-side applications. And now, after reading that article, my main concern is how few people that share this same concern. This is why I decided to write this article where I hope to explain why I have am worried about this and above all why I think you should too.
First, to those that doubt: there are a lot of problems with Java on the desktop. I admit that there have been big improvements even before JavaFX such as the improvements with Swing (maybe driven at that time by the competition from SWT). We now have a fantastic OpenGL pipeline for Swing, great improvements with the DirectX pipeline and strongly improved startup times. A lot of great and very useful work has been done in the previous years, that's for sure.
Unfortunately, having said that, all the rest is a total mess. Trying to make a real, productive use of Java sound doesn't really work out for example. And what about the abandoned Java3D? Recently even JOGL has been dismissed by Sun, as well as SwingLab long time ago. Even JAI (for image processing) has not been seriously updated for ages and doesn't seem to be going anywhere at all. Some big improvements would be needed to use it effectively especially with the massive advent of multicore GPUs.
The point is that, yes you can make desktop applications with Java, but as soon as you want to develop really rich desktop applications you need to enter in the realm of JNI, C/C++, legacy and platform dependent libraries and the whole associated hell. Even having an effective and decent web browser in your Java application is still a horrible headache.
As I see it, Java on the desktop today is as good as it could be for someone that mainly develops server side and just need a rapid way to assemble simple interfaces to remote services from the desktop. In fact JavaFX is the perfect compliment in this scenario. But why are there not (or there are too few and too limited) applications for image processing in Java? There is no one single pure Java web browser so far. No digital audio workstation applications, no 3D modelers, vector graphic editors, advanced raster editors. These are the kind of enhanced desktop applications that are very hard to develop with Java, but not with other technologies. In fact you see that some C# implementations of those are starting to appear.
In the past we used to say that this is because Java was slow and you cannot develop such complex applications on a slow platform. But we were wrong.
We were wrong for two reasons. First, because Java has never been really slow. There have been some parts of Java that were slow, but there has never been any doubt that those parts would rapidly improve as they were needed on the server side. I'm talking here about JITs, GCs, etc. This is where Java was prominent and had to improve at all costs for the language to survive.
Secondly, because of the nature of the platform, Java
applications are always the first applications to take advantage of
new hardware and OS's as they come to market. As soon as a JVM is
deployed to a new system, without any compilation or tweak, your Java
application will run there at full speed. You develop on an old 32 bit
OS, you run it JITted at full speed on a 64 bit JVM on Windows 7 or
Solaris.
If you are an end-user you don't even need to re-download
the application from the developers site. This means speed not only
for end-users and developers, but even on the front of the concrete
execution performance of the applications. Today's JITs are great at optimizing your code at runtime to native instructions. This allows you to
exploit all the power that the hardware you are running on
has to offer, a feature that statically compiled languages will never
be able to compete with. A feature that would be a dream come true exactly
for enhanced desktop applications and games if only... you could
effectively employ Java to develop such applications.
Often we've heard that Java on the desktop has really never had any chance for the simple reason that Sun has always been a server-side company. With the Oracle deal this seems the natural way things will continue in the future.
Well, I hope this wont be the case. For the good of Sun, Oracle and Java itself I really hope that some prominent people from these companies start to understand that the lack ofgreat power and effectiveness on the desktop today is a sure path to a reluctance in the adoption of the Java platform as a whole, even on the server side, of tomorrow.
Why do I say this? Because of the evolution that we are seeing in the microchip industry at the moment - the multicore paradigm. This is strictly tied to the market of desktop computers and small consumer appliances in general. Sure this paradigm will go, but it's on the desktop that we will see the most extraordinary things. Not only on the desktop as we see it today. Maybe it is worth mentioning that the small consumer appliances of today are the chips in our jackets, glasses and shoes of tomorrow or even under our skin. The desktop of today will also penetrate in the robots that will appear in our malls, homes, offices tomorrow.
All these electronic products will do things barely imaginable today but from a developer point of view you can already bet that it wont be enough to employ some development environment that offers you just a good windowing and a state-of-the-art 2D API mixed with some scattered 3d sliding, rotating or blooming effect here and there. What you will need is total integration of your application with all the processing power that the consumer hardware has on board and all the services implemented by the OSes it runs, without any compromise at all. You will need to process huge amounts of data and codecs, sounds, images, videos, and you will need to process them with parallel programming. Very often you will need to process them both on the client side and the server side. It doesn't require too much imagination to envision a future in which a massive amount of client-side processing power is employed for complex data mining tasks once reserved to server-side monsters. For the execution of sophisticated searches inside images, videos, virtual 3D environments. For interacting with remote services that also require enhanced client-side capabilities such as gamining, medical analysis, e-learning services and remote conferencing.
We are used to companies that offer server-side solutions, to think that the future would be more and more processing power on the server and the client would always be just some sort of simple device to connect to servers, just a bridge to access the real powers. This scenario has proved to be dramatically wrong. The scenario that is clearly emerging today is that humans need massive amounts of processing power both on server-side and client-side. Projects like SETI@home are proliferating. Services are emerging in which you trade the power of your desktop or notebook CPUs/GPUs during screensaver time for financial investment tips originated by genetic and other heuristic search algorithms running on massive networks of connected Internet clients.
Everyone knows that for a hundred dollars you can buy a
1Tb hard disk today where such devices were affordable by very few in the past. A notebook with
4Gb RAM, 1Gb dedicated graphic ram and a GPU with 48 cores costs just a few hundred dollars today. These enormous computational
powers are here to be used. It is not necessary to imagine futuristic
scenarios in which new strong AI agents across the world will
finally put at good use all this power. It is enough to simply
observe how well and rapidly weak AI algorithms are already finding a
way to reach desktop applications thanks to the new powers of recent
hardware. It is enough to just notice how the diffusion of Internet
combined with the power of today consumer hardware is already
changing our life in such a way that new kind of jobs are emerging. For example for those freelance artists that embrace
their most important challenge for the future: producing and selling
on-line digital content for both virtual and real worlds.
We are not
talking here about some geeks that will never achieve a
consistent customer base for some potential product. We are talking here of literally tens of billions items produced by these people as you can clearly count by yourself on on-line
retailer sites that allows users to upload images and create their
own merchandise (clothing, posters, etc), or on stock photo sites, on
digital art sites, on 3D content retailer sites, on independent music
retailer sites, in 3D virtual worlds, etc. These people are all
people that are using enhanced desktop applications to make their
products, and use the next versions to create
and sell even more content.
These applications are evolving to use the new multicore chips and related hardware and software technologies. And these applications are developed by the same suppliers that offer the sites and the selling infrastructures to the freelance artists and for this very reason these applications are often a mix of interfaces to server-side services and client side enhanced processing features. I think this is the real future of software applications. It is not a scenario with predominant server-side processing or predominant client-side processing. It is both at the same time. John Gage was right when he said "the network is the computer." But the crucial point with a network is that it needs at least two sides to work, one is not enough!
How is placed Java in this scenario? Java surely caught the server-side train, but it's may miss all those other important trains that could eventually even lead to Java predominance on the server-side.
My point is, why do I have to embrace two
different technologies to develop the server-side and the client?
Clearly for big companies and already well established businesses
this is not urgent concern. They are used to working on integration
problems as new technologies arise. But for new companies
this becomes a crucial question. And the same can be said for those
established companies that decide to migrate once and for all on a
more uniform and modern platform. So on one side they will face a
technology that has everything they need for server and client sides.
Sure its scalability could be argued as well as its server-side
market adoption and multi-platform support but one thing for sure
cannot be argued: that from a client-side point of view they run, on an extraordinary vast majority of consumer
computers and devices. What we have on the Java front? We have widely
adopted, strongly scalable, well designed, multiplatform, 360°
server-side solutions, the defacto industry standard, but that's it.
It's not insignificant, but it's incomplete. It's like having a
Ferrari engine but no wheels or, worse, just some baby
tricycle toy wheels here and there! You can't go that far with this
configuration, believe me, you'd better choose a utility car and give
up altogether the Ferrari engine.
It really scares me when I see how history repeats itself time after time. There is surely nothing new in the current situation we are seeing for Java. A visionary company invents something truly amazing, and the majority of the industry rapidly recognizes its effectiveness and adopts it and invests huge amount of time and money into it. Still an imminent and well foretold disaster, unseen by the main actors, is ready on the doorstep just because all of them forget to cover what a telco would simply call “that damn last stupid mile”.
That damn last stupid mile for Java is, and has always been, client-side. Namely it is: JMF, SwingLabs, Swing Application Framework, JOGL, Java3D and something new to be developed for OpenCL. And no, sorry, it is not enough to say that if this stuff is really needed open source communities will do it. We don't need it, you need it! We developers have always alternatives. It is you, whoever invested strong efforts, long time and huge amounts of money in Java, that should be the first to be concerned for the future of Java on end-user computers and devices.
If you demonstrate to understand this, if you show to care about this, then yes, we are here too, we are going to stay. We are going to believe the "Write once, run anywhere" dream once again. And then yes, you can bet, a lot of us would be going to help you to let this dream come true,once and for all.
Opinions expressed by DZone contributors are their own.
Trending
-
Integration Architecture Guiding Principles, A Reference
-
Security Challenges for Microservice Applications in Multi-Cloud Environments
-
Measuring Service Performance: The Whys and Hows
-
Hibernate Get vs. Load
Comments