The quest for cross-platform-utopia

By SuperUser Account on 12/5/2013
Back in the old days many developers searched for a cross-platform-utopia which gave that “develop once, deploy everywhere” solution.  Today developers still struggle to deploy to Microsoft, Mac and Unix from the same source code, but on top of that we now have the mobile platforms to worry about too.  Consequently I’m spending even more time reading, talking to other developers, installing SDKs and spinning my wheels making choices.   Recently I found myself forced to once again resume my quest for cross-platform-utopia.  Cross-platform development is like the lost city of gold for software developers.  I remember working on a C++ GUI back in the 90′s which ran on Windows, Mac and UNIX Motif.  At the end of the day it was a real pain and debatable as to whether we saved any effort by using the cross-platform solution.  We ended up writing almost as many lines of pre-compiler directives as C++ code, but we got it done.  It’s the mid 90′s and here comes Java, it’s going to run everywhere!  Well, early on I was roped into a $1,000,000 Java project that died after a year of effort due to “performance issues”.  The woes of the JVM proved to be too many.  I tried Java again in 2003 and simply ran out of time learning all the various libraries, tool kits, etc. and was driven to .NET instead since the framework had everything I needed at the time without all the research and comparison of various libraries to accomplish simple stuff like XML processing.  Ultimately, I don’t have enough recent Java experience to pass judgment there, but I still don’t see Java “running everywhere” all these years down the road.  Take the IOS mobile platform for example..   Just before Java came out, HTML came on strong.   Woo-hoo cross platform-utopia has arrived, so they said.  Yes, vanilla HTML worked pretty well across all browsers, but once again the pre-compiler directive problem manifested itself as the browser war as we were forced to write extra code to deal with various types of browsers and various versions of browsers.  In addition, there was a lot that could not be done from inside the browser sandbox so we still needed to have other OS-specific tools to process data on the server side.  Yuk, HTML was still not the cross-platform-utopia we hoped for.   The next attempt at utopia came in the form of Rich Internet Applications running in browser hosted run time “players” such as Adobe Flash and Microsoft Silverlight.  These were cool since they could be used to isolate the application from the dreaded browser war issue.  I tried them both and unexpectedly found Adobe had something good there, until the day Steve Jobs threw a monkey wrench into that.  With the Adobe stuff you could write ActionScript for the desktop, the web, the mobile devices and code could be shared.   If it wasn’t for Steve Jobs’ dislike of Adobe, I’d be blogging about the ActionScript I ran in web browsers (Flex), on desktops (Air) and on Android and IOS (Air Mobile).   In fact, I was developing the Adobe solutions with Flash Builder until just a couple of months ago.  Of course I was forced to keep writing .NET on the server side since that just continues to work very well there.   Today I could continue to use Adobe’s utopia-like platform for web, desktop and mobile development, but for how long?   I can see Adobe is not supporting that platform like they once were.   Well, now I’m jumping from that ship and many developers consider me a late jumper, but I’ve had my eyes peeled for quite a while observing the other options.  Until recently I could see no options, other than Adobe, which ran the same code on both Android and IOS and actually had the same API to all the underlying devices such as the camera and GPS.  The last time I looked about a year ago the other options did not even provide access to all the devices on the mobile hardware.
So what is next?  At the moment I’m buying into the HTML5 / Javascript hype.  Several things are coming together to drive me towards that.  First, modern browsers are now much better about conforming to the W3 standards so the browser war has quieted down a lot.  Second, I just installed Node.js, a server-side Javascript  engine that has some very impressive demos.  Third, I’ve recently developed my first PhoneGap application which is a HTML5 and Javascript wrapped inside native mobile app code.  PhoneGap claims to run on pretty much every mobile device OS in existence today.  Fourth, I’ve heard that Javascript runs on the Windows 8 Desktop.  Hmmm…  Let’s see, that sounds like HTML and Javascript runs on the web (of course), but also on the server, the desktop and every mobile OS there is.  Could this be really be it, the cross-platform-utopia?   
Yesterday I started testing that theory.  My plan is to write a PhoneGap mobile app which uses the GPS, Camera, Compass and a local CouchDB Lite no-sql database which will sync with a CouchDB database on a server.  Somehow, I’ll write some web services which do stuff for the app and run those web services in Node.js.   In addition, I’ll partition some of the UI pieces of the mobile app and isolate them to run on the server as a web application using the same CouchDB which the mobile app syncs to.   If that works, the app will run Javascript in the mobile app, the website and the web services.  The same HTML5 and Javascript, with different CSS, should work for both the mobile app and the website GUIs if I design it properly.    Wish me luck!
Diagrams and other stuff to follow….