Monday, 10 December 2012

From Java to C++


This is not about hard-core low-level programming that targets speed and next-to-none h/w resources allocation. This is about development of applications that have clever and sometimes complex GUIs, use remote services and often run in geographically distributed environments. This is about the market segment where Java dominated for more than a decade.

So, what's happening to Java? Is its community eroding? There are less articles about Java innovations on www.infoq.com, a used to be a 100% Java portal www.dzone.com now discusses other languages as well (although it seems that Scala, Groovy and Grails are among their favorites, they talk more and more about other technologies - look at their recent RefCardz), you could  probably find other examples that indicate decline of activity in Java world.



How did it happen? Well:

- first Steve Jobs called Java heavyweight,

- then C++ 11 has been finalized and people got inspired with it,

- then Intel offered C/C++ and Fortran compilers (no Java!) for its new Intel® Xeon Phi CPU

- Java didn't become a big friend of Microsoft Windows 8 Metro.


It seems that Java looses its pace and gives the way to C++ now. This is why it could be true:

- It happened to be that C++ is a good choice for parallel programming now. Multi-core Intel CPUs is about to hit the mass market - 50 cores (or so) per CPU isn't a joke, it's just a beginning. Moreover, they come with Intel owned C++ development kit for parallel programming that includes testing and profiling tools as well. I think this is big.

- Java is not a competitor to C++ in parallel programming. There is activity around CUDA (GPUs) and Eralng - although these two didn't really widespread around the globe, there is no similar activity in Java world.

- C++ binaries could be easily decorated with a nice GUI in two most popular platforms - Windows and OSX. Java doesn't have that luxury.

Let's have a closer look at GUIs, server side, virtualization and possible future trends.

GUI

Apparently, Java doesn't have a good techno for that... Swing is good but tedious to use. Building apps on top of Eclipse RPC or NetBeans for some reason didn't become trendy. Adobe Flex GUIs have just started gaining the ground in the enterprise but at the end of last year Adobe decided to dump it to Apache and concentrate on HTML5 instead - this move came out of the blue and blowed away the whole community. With a certain pressure for HTML5 that comes from everywhere (Google, Microsoft and even Intel!), Flex is not likely to recover any time soon... Flex was very good when coupled with Java... was... Amen.

On the other hand, Microsoft WPF GUIs backed up by C# and C++ libraries are spreading everywhere like a virus. One of their buy-me features is tight integration with Excel - cut-n-paste between these two looks incredibly natural! And whatever happens, Excel is not to disappear any time soon. WPF app could be standalone bundled with C++ or Excel libs or tailored to run in a web browser as well (yes, with Silverlight). It worth to mention that it's supported by Microsoft, so from a tight-ass architect's perspective it's a win-win game.

Qt (another C++-friendly GUI framework) was a cute kid with a very promising future. It could even face WPF on the open battle field unless Nokia let it go to Digia. Nevertheless, Qt is still here and its GUIs for Linux apps look pretty good.

So, we've got a pretty seamless technology stack here - multi-cores CPUs with C++ dev kits and extremely C++ friendly GUI frameworks that run nicely on most popular platforms. And if we talk about the finance (that pays a lot for IT services), add to this a bunch of available Quant libs and other products like popular middleware and databases that usually either written in C/C++ or C/C++ friendly.

Server Side

Is Java the only choice for server side programming? Apparently popular technologies on the server side are PHP/CGI, Python, .NET and Java. And Ruby. And JavaScript now. There are more and more competitors to Java in this area. If Java wouldn't get a boost, it could be eventually pushed out. Oracle should be interested in keeping Java up there as Java would provide it with a perfect web access to its database products. This nicely fits to a vision to make Java super-powerful db language. Well, web-db language. Would Oracle spend money for more than that?

There were rumors that Oracle might convert Java into an incredibly powerful database and middleware language. It might not be a bad idea! Java could go there, couldn't it? Otherwise, multi-threading model on JVM level may need to be refreshed. Is that a significant investment? It could be... Microsoft is already busy doing this kind of things. Does Oracle do the same?

Furthermore, it's questionable how many Quant strategies and algo-trading systems would be created during the next 10 years (Java is often used for this money-making machines along with C++ and some scripting languages), but it seems that BI presents a wave comparable with tsunami. BI is all about data (searching, indexing, mining, analyzing, you name it...) and parallel programming for it is the must. So, it's easy to assume that in a very near future the server side would be heavily paralleled, participants would be crumbling through their massive data storages like small Googles. And they will need to be C++ friendly because Intel wants them to.

It looks that Java isn't the king on the server side anymore... Maybe Mother Queen?

Virtualization

Enterprise architects loved Java because of its JVM. It's like to have a standalone computer inside your production system. It's easier to make it secure compare to PHP or Python scripts, for example. I guess, this is why big companies liked it and kept paying for Java evolution. And this is probably where Microsoft dropped the ball.

But that was in the past, Windows Server 2012 made it happen, virtualization level could be selected and tuned as required now. Does it hurt Java perspectives? Yes, I think, it does.

Future Trends 

It could be time for program converters. Say, you build stuff in some real or pseudo language and then generate Web, Windows (.NET) or OSX (Objective-C) applications from it. Something like, GWT (generates JavaScript from Java), or ZK (also generates JavaScript from Java). I like Embarcadero and think that currently it's the best for development of standalone applications that target deployments on different platforms.

Will Java be a leader in this space? Will it be the leader anywhere else? I'm not sure... I think, after using Java non-stop during last 10 years, I'm loosing a point to keep doing that as there are so many alternatives.

Conclusion

Java was fun, like a roller coaster with its ups and downs. Well, it was a pretty quick run though, just slightly more than a decade. And now it's done (meaning it's not evolving anymore as it used to be). Yes, number of LOCs written in Java is beyond the mind, but I guess you should admit that at any time in its history 50-70% of Java code was already obsolete because of new versions of SDK, new frameworks, and others... People just kept writing more... More and more people apparently... 

In regards to a new evolution stage in programming history that we are entering into, parallel processing is going be the norm, C++ with its friendly peers has all the rights to be the king again. They will get a massive number of improvements on the way, no doubts about that. 

The king is dead, long live the king!

Online Encyclopedia of Statistical Science (Free)

Please, click on the chart below to go to the source: