JavaScript… really?

How JavaScript has become the language of choice for Web and Mobile

I learnt programming ussing the C programming language, on UNIX. That’s as nerdy as you can get. Where else can you manipulate bits with code and have to alloc your own memory. And pointers; that’s how real programmers write code. You have not programmed till you have dealt with ‘core dumps’. It’s the only programming language that has it’s own Obfuscated code contest! C was followed by C++, C# and Java. (Let’s pretend PowerBuilder never happened). That is the stuff real programmers use. The whole world had been divided into two distinct camps – Java and .NET. And then came JavaScript. Originally named LiveScript, JavaScript has now become the language of choice to build websites, web apps, with the advent of PhoneGap, mobile apps and now thanks to technologies like Node.js, even server side code!!

The rise of JavaScript as a main stream programming language has horrified hard-code (pun intended) programmers. Once discarded as a light weight ‘scripting language’ to create pop-ups on web pages, it is now the code behind large complex applications. What’s up?

As I noted above JavaScript started off as being simply the language you embedded in your web pages to make them dynamics. To put some logic into the client side of a web page. It was great. You did not have to go back to the sever to dynamically update a form or to dynamically change a web page based on interactions. With the advent of AJAX and other technologies that are collectively referred to as web 2.0, these simple dynamic updates have now become full fledged apps that can perform complex logic, changing the DOM of an HTML page in real time, based on interactions, without even pinging the server.

Then came HTML5 and CSS3. They become a game changer in the JavaScript world. Now HTML, CSS and JS have become the architecture of full fledged web apps and also cross platform mobile apps. A single-page HTML5 web app with complex JavaScript and CSS transitions can behave as well as a desktop app. And using technologies like PhoneGap, can be deployed to a myriad of mobile platforms, making up mobile apps that look, feel and behave like native apps. Some good examples of HTML and JavaScript based mobile apps are Twitter, LinkedIn, and the beautiful US Census browser iPad App. Interestingly, the language that was renamed JavaScript, despite having no relation with Java, seems to be fulfilling Java’s (somewhat unfulfilled) promise of code once, ‘deploy anywhere’, at least in the web and mobile app world. (What Siebel will not work on Windows 7 with any Java other than Oracle’s?! Wasn’t Java supposed to…)

The latest twist to the JavaScript story has been the arrival of Node.js. An app server platform which claims to be highly scalable and super fast uses JavaScript as its programming language. This becomes JavaScripts first foray into the server side world. Now, my friends who have worked with Node.js do tell me that just knowing JavaScript is not enough. You need to have a (more than) good grasp on sever side concepts to make Node work. An excellent example of an app now using JavaScript on both and client and server side is the LinkedIn app. This article goes into details of how they pulled it off, especially the performance they get out of it. It prides itself on it speed and a single code base across iOS and Android.

JavaScript has arrived and is the language to learn. I just got my 10 year old son an account on Codeacademy.com.

I will discuss JavaScript for mobile app development, especially PhoneGap, in detail in future posts. I will also post about JavaScript libraries and frameworks – you have to check out Twitter Bootstrap, the framework used for the Census App! A key factor in driving JavaScript’s wide adoption, especially amongst the non-developer, creative crowd.

What are your thoughts on the rise of JavaScript? Have you used it? For what kind of apps? Leave a comment…

Resources:

Articles:
JavaScript for java programmers
JavaScript as a first language
What is Node.js?

Books:
JavaScript the good parts – Douglas Crockford
Eloquent JavaScript – Marijn Haverbeke

Advertisement

3 Comments Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.