Monday, September 1, 2014

JavaScript is The Present, Not The Future

Coming back to Tel Aviv after spending only one year living in Europe, it strikes me to see the amount of talk going around about JavaScript in this sort of capital of startups. 

Node.js being evangelised in Tel Aviv? This comes out as surprising, because Israel is otherwise known as an ultra Microsoft-oriented tech community. There are many reasons for that: one of them being that the IDF, which is the growing ground for a lot of devs that later become founders and tech leads, is a heavy Microsoft customer. But that is beyond the scope of this article. 

If anything, JavaScript is the past and present, not necessarily the future. On the server side, Node.js has been with us since 2009 (that's almost 6 years now!) and NPM since 2011. Both are being used in production for very specific purposes for which they are good for. Some of the excellent client side frameworks like Backbone.js and Ember.js (excellent JavaScript MVC framework) are with us since 2010. In tech terms, this is almost ancient history. 
Being a JavaScript programmer and evangelist since the early days of Netscape, a turning point for JavaScript was back then at around 2010. The last 4-6 years were great for JavaScript programming: the MVC style frameworks and unit testing concepts really helped in bringing the development eco system forward, and the combination of Node.js, NPM and a flourishing community has helped JavaScript become what's known today as "The Web Platform". 

JavaScript today is still a good choice for backends and the only choice for browser-based frontends. But is it the future or merely the present?

As mobile continues to grow, native mobile apps remain king. The developer community is still following software giants like Facebook and Google and the choices they are making, and the fact is that almost one by one, software giants have turned out to choose native over hybrid-web solutions (some of them deeply disappointed with the performance of JavaScript for mobile - see "Facebook: Betting on HTML5 was a mistake"). 

The reasons for going native vs. hybrid web on mobile seem to be both technological and business oriented. Technological, because till mobile devices become as strong as your MacBook pro, the quality of experience of cool HTML5 features on mobile is poor. Business wise, because both Google and Apple have good reasons to maintain the native eco-system where they own the runtime environment, the API's and even the language (Apple's Swift) instead of going for a more open platform like the web, where code can be cross platform and written in any style / using any custom client API's and plugins like Flash.


On the server side, we are not seeing a lot of enterprise customers of Node.js almost 6 years after it was launched. Being one of the most popular repo's on GitHub, Node.js has still not made it to a major v1 release (this is indeed mainly semantics, but what is the message to enterprise clients?). 

The ones that are using it, are containing it to specific tasks (it is mainly used s an orchestration layer). Watching Eran Hammer's excellent "Node.js at Walmart" video on the nodejs.org site, it becomes clear why that is: Node.js is good for specific scenarios, where memory management and CPU consumption is not substantial. It is almost exclusively used in the enterprise for orchestration style scenarios. It is also not very stable - Eran testifies that at Walmart they keep touch with Node's core team, which helps them solve bugs on the framework as they are discovered by Walmart, including scary memory leaks. 

Facebook too was never impressed with Node, judging by Robert Kieffer's (FB engineer and Node.js evangelist) notes at NodeConf. "Evented" and "Non blocking" I/O frameworks such as libev, tornado, EventMachine and even .NET's async-await have existed for some time now so Node's main selling point was not something new to many developers. 

For experienced backend developers, unfortunately, Node.js does not bring anything new to the table on one hand and it has a lot of performance and scalability downsides on the other. Overall the numbers speak for themselves - Node has failed to prove it's value for a lot of use cases - which include pretty much every production scale backend that I can think of (which is why it is not being used by any large scale system for something more than a thin orchestration layer or internal tooling). 


All in all, it seems that JavaScript has had a good run in the last couple of years and that it will certainly continue to be a substantial technology, but it's future is under attack by both the native mobile eco system and backend alternatives. Is JavaScript the future of the web and mobile? not necessarily. 

No comments:

Post a Comment