JavaScript: the programming language of the future

I have recently been gushing about how JavaScript is changing everything for developers and typically am greeted with an odd glare when I do this.  So, I am going to summarize the reasons my mind has been blown by JavaScript:

  • Performance
  • Simplicity
  • Flexibility

Performance

Back in the day, JavaScript was doggedly slow.  Now, people are MOVING to JavaScript when they need better perf.  Seriously, if you haven’t checked it out already, read more about Node.JS.  In short, Node.JS is a server side JavaScript server.  It may sound counterintuitive, but Node.JS is bloody fast and can handle tons and tons of connections. Ryan Dahl does a much better job than I do at explaining the performance and benefits of Node.js

Bonus nerd tip: as of December 12th, you can now deploy Node.JS to Azure.

The next big thing that is driving perf up is hardware accelleration in JavaScript.  As of IE9’s release, you have hardware accellerated graphics in the browser, particularly with SVG.  Put simply, “dude, you get GPU shaders in JavaScript” – it’s probably only a matter of time until we have GPGPU in browser.

The final special perf thing worth mentioning about JavaScript: it’s totally asynchronous.  Calling a function will immediately begin execution of that function and the calling code will continue to execute!  Simple idea, but a big big deal.

Simplicity

JavaScript is a dead simple language.  It’s particularly simple in that:

  • Nothing is strongly typed – no casts
  • Objects serialize to JSON – your data travels for free, no baggage fees!
  • Errors are forgiven – you can put code into a function that will not correctly execute… call the function, and your code does not crash! One more thing that makes the asynchronous nature of JavaScript magical.  Execution continues.

Designers love working in JavaScript, heck, JavaScript was created for them.  This is not just dumb luck, JavaScript is a simple language that non-developer types can use and tinker with because the tools for using and tinkering are the same ones they create in.  The marriage between HTML and JavaScript also encourages clean separation of presentation from function and application logic.

Flexibility

Write once, run everywhere.  This promise came from Sun when they released the Java language and then developers responded, “write once, rewrite everywhere,” Java took a while to live up to Sun’s aspirations.

But I digress, JavaScript, for better or worse, will run on anything that has a Web browser.  This is a big deal.  Really big deal.  There’s no other language that you can code in that doesn’t require any setup on the client and that will execute in all clients, and can dynamically get its components from the cloud.

Conclusions

OK, so you can’t do everything in JavaScript.  You can’t.  But, JavaScript is showing so much promise… There are more and more applications that are built entirely from JavaScript and HTML and the translatability of these tools to developers means that this trend will continue.  I’m keeping my eye on you JavaScript, sneaky, sneaky, JavaScript.  One more video worth watching – My Programming Language is better than yours by Artur Ventura. In that presentation, some dude who is much smarter than I am explains the history of programming languages. When he gets to JavaScript, he pauses, “this language is cute”.  Just sayin’, go out there, play with JavaScript, it is going places.