Friday, July 29, 2011

JavaScript: One Language to Rule Them All

This post was also published in VentureBeat.

The Internet is about to hit its fourth major shift in server architecture.

The early days were powered by simple Perl applications. As the dotcom hit, Java application servers running on highend UNIX machines powered the majority of the web and created a multibillion dollar per year industry. In the 2000s, scripting languages such as PHP and Ruby running on cloud based Linux infrastructure have spawned massive growth at companies like Rackspace and Amazon with its Amazon Web Services service. Each of these shifts in server architecture brought greater efficiencies and the ability to more cheaply deliver more sophisticated Internet services. We are now on the verge of hitting another inflection point with JavaScript running on the server.

JavaScript came onto the scene in 1995 as the browser language in Netscape’s Navigator browser and was primarily used to implement simple user interface elements such as menus. With the wave of Web 2.0 companies building out JavaScript libraries such as jQuery and various HTML5 extensions of late, JavaScript is becoming increasingly sophisticated and capable of delivering highly interactive web and mobile-optimized sites comparable to Flash sites. As websites become more and more interactive, an increasing amount of business logic and data processing is starting to happen in the browser with JavaScript rather than on the server.

The growing up of JavaScript is leading to a collision of sorts between the client and the server. Why use one scripting language on the client, and then a different scripting language on the server? PHP and Ruby programmers are constantly dynamically building DOMs, the document object model for a browser page that JavaScript innately understands. Programmers also have to transform data in and out of JSON (the JavaScript Object Notation) so that it can be understood by browsers. All of this work translating between languages causes errors and bugs, and forces unnecessary communication between front-end and back-end developers. Each language has it stakeholders claiming better frameworks and whathaveyou, but at some point the pain of translation outweighs these benefits. Especially when you consider that JavaScript programmers are widely available, and Ruby programmers are virtually impossible to find.

Imagine if you were building a house and the architects spoke only Japanese and the builders spoke only French. There is a lot of time and energy spent handling communication and fixing miscommunication between the two parties. The same problems happen when you use two different languages to build a web application.

Even worse, when code is written, programmers have to decide whether it is going to run on the browser or on the server. Things as simple as validating a phone number need to be decided before a programmer can start, and be assigned to either the front-end JavaScript programmers or the back-end PHP, Java or Ruby programmers. Once the code is written, if for whatever reason it needs to be moved from client to server or vice versa, it needs to be rewritten from scratch.

The fissure between client and server is even starting to hit large corporate websites that have barely budged toward scripting languages from Java. When you go to your bank’s website or favorite e-commerce website, chances are that it looks and works very much like it did 10 years ago. This is because most corporations perform all of the processing of a website on their servers. When you click on something on a webpage, it goes to the server, which creates a whole new webpage and sends it to your browser. While this is not the most efficient way to serve a website, it is definitely the most efficient way to create a website inside a corporation, since the programmers do not have to learn all the intricacies of the various browsers and can simply program in Java, the favored language for corporate websites.

The sudden preponderance of mobile and tablet devices has created a sudden rupture in the way that corporations serve their websites. It is very slow and cumbersome to completely refresh a web page every time a user does something on a phone with its relatively slow web browser and connection. Now corporate web applications need to be upgraded to HTML5 and be able to update themselves dynamically, just like the modern web applications offered by Google and all of the Web 2.0 startups.

There have been various attempts to productize JavaScript on the server over the years. Netscape acquired LiveWire’s JavaScript server and shipped it in 1996 but then quickly replaced it with the Java and C++ based Kiva Application Server in 1998. Aptana attempted to provide hosted JavaScript servers and ended up selling its development tools to Appcelerator.

Over the past couple of years, a new breed of JavaScript servers have taken hold and are starting to get significant traction. An open source JavaScript server called node.js is becoming increasingly popular especially for communication servers and getting a lot of geek and startup love. Last year, Sequoia invested in Sencha, a company focused on JavaScript client libraries that has also done work on node.js.

It all makes sense when you think about it. It took many years for scripting languages to be considered serious web languages and for significant client logic to be implemented on the browser. But now this is the normal way to create an Internet application. Why code in two different scripting languages, one on the client and one on the server? It’s time for one language to rule them all.


Fikri Ferdiansyah said...

bagaimana cara supaya menambah like fanspage facebook secara otomatis

I am very happy because they can find information about this excellent, This is one of information that has long was I was looking for, I hope you continue to update the latest information more definitely still associated with it, Maybe I'll come back again to visit here to find other interesting information, Thank you so much because you have been willing to share it all, And this course I will inform all my friends to the same'm looking for this information ..

Cara Mengobati Luka Bakar Akibat Tersiram Air Panas Obat Benjolan Di Vagina Obat Gagal Ginjal Cara Melancarkan BAB Cara Mengobati Kutu Air Obat Herbal TBC Obat Penyakit Kuning Obat GERD Obat Prostat Bengkak Obat Benjolan Di Belakang Telinga

hendi permana said...

nice post sir, thanks..

waspadai penyakit campak dan bahaya penyakit campak, apabila anak anda terkena campak segera tangani dengan obat herbal campak alami tanpa efek samping. Kami juga merupakan agen obat herbal, menyediakan obat herbal gonore yang ampuh tanpa efek samping. Nah, jka anda mengalami patah tulang dan butuh vitamin untuk penyembuhan patah tulang silahkan kunjungi website resmi kami. Produk unggulan kami adalah obat peningkat hormon estrogen yang menjadi pilihan utama para wanita.Dan juka anak anda terkena cacar air, maka obat herbal cacar air adalah solusi terbaik.

Uzi Martis said...

Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for
Obat Kerumut Alami
Obat Tenggorokan
Obat Tumor Parotis
Propolis Brazil Walatra
Cara Menghilangkan Benjolan
Cara Mengobati Kerumut
Cara Tradisional Mengobati Uci uci

Asep fauzi nurjaman said...

Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for
obat benjolan di pergelangan tangan herbal
walatra sehat mata softgel
cara pemesanan walatra jelly gamat original
cara alami mengobati neuritis optik
cara mengatasi lecet pada vagina
cara mengobati ruam popok pada bayi

Asep fauzi nurjaman said...

Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for
obat mengatasi kadas atau kurap
cara mengatasi infeksi tinea cruris
cara menghilangkan balas bogo di wajah
obat alami untuk mengatasi glaukoma
cara mengatasi mata merah dan bergaris
cara mudah mengobati perut melilit