Skip to main content

JavaScript is back! (Again) ...Again? This time: Node.JS

No! this is not 1999!
No, you are not living in the times in which Netscape lost its browser kingdom to Microsoft and developers discovered the magic of client-side web programming thanks to Brendan Erich's creation: an ECMA script dialect called JavaScript.

Netscape is no longer around trying to convince us that iPlanet is THE web server, and JavaScript is THE web application server-side language to rule the WWW.
No more Microsoft telling us that VBScript is the way to go for ASP, but just in case you didn't not like it they also offeredd JScript.

There is no more pushing by IBM promoting Lotus Domino (Today positioned as"enterprise social" platform) as a web programming environment, suggesting an "efficient?" programming language salad that used to mix: formul@ language, Java, JavaScript, a pseudo VB and VBScript as the ideal solution to code for the desktop, the documents, the intranet, the internet, and everything else that may come up in front of you.

No! neither we are in 1998, in the middle of the explosion of Microsoft Explorer 4.0, DHTML, Flash 4, and Java Applets integrated with the browser's DOM via JavaScript; or full Flash coding with ActionScript 2.

So, if we are not at the end of the 90s, and if the pros and cons of JavaScript as programming language were well stated and debated through 2,472,743 blogs, 783 books, and 63,887,981 forum threads around the world for more than a decade, then, Why is JavaScript hot again?!

Actually, JavaScript has never gone away, totally the opposite, it was powering the web (and many other things) for more than a decade and there are no signs for that to decline any time soon.
In fact, many surveys suggest that JavaScript is at the top 5 in the list of most popular programming languages around the world these days; it is easy to figure out why: Is not he most elegant and expressive language, but it is compact, it is easy, it is flexible, it is fairly coherent, and more importantly, it was highly popularized thanks to the exponential growth of the web.

But even if JavasScript was always there and growing, two or three years ago it wasn't necessary cutting-edge to say that you were doing a project in JavaScript. This powerful language for mere mortals used to be associated to the late 90s Dot Com bubble, so it was kind of old school in the late 00s and early 10s.

Despite of being extremely handy, JavaScript always had the karma of being a -scripting- language, preventing it from enjoying the prestige and respect of the strong-typed and compiled languages. Like if being interpreted or compiled was what draws the line between second and first class languages! As side note, Ruby and other languages brought a positive spin to this prejudice with a fresh wave of new "dynamic languages", helping to change the perception about interpreted languages, but that is a discussion for another post.

But here we are, in 2012, and surprisingly, if you are in the middle of a conversation among geeks and you crack a comment saying that you are working in a cool cutting-edge project in JavaScrip then now you are cool again! Why? well, this time the JavaScript wave came back to the shore with a surfer on top of it, who has a cool t-shirt reading: Node.JS.

Unless you were isolated from the high-tech buzz for the last 3+ years you may know that Node.JS is enjoying an impressive momentum. And why is that? Popularity does not grow from the trees, it must be a reason for Node.JS' hype. Yes, there are several reasons...

Node.JS brings a refreshing perspective to the world of "serving stuff in a network", its creators, were frustrated with the scaling, resource consumption, and performance challenges of traditional web servers; which are essentially an evolution of the file server.

Most web servers were originally conceived to deliver files over a network (the Internet), their inherit request/response paradigm was designed focusing each thread on serving (transferring) a file until the transaction is complete and just then switch to "available mode" to take the next request. Even if most of the web servers do this cycle in multiple parallel threads of execution, each of them takes ownership of a nice amount of resources in the server while the transaction lasts.

So, Node.JS original creator, Ryan Dahl, conceived a platform optimized to execute code (instead of serving a file) as a response to a network request, the result was a framework that allows us to accept network requests in a non-blocking fashion in each server thread (Node.JS is not the only platform with non-blocking I/O). In other words, a process can have a listener that can take a request then put a routine to work on that request without waiting for it to finish as it switches back to listen mode regardless if the processing of the previous request finished or not.

To materialize the just described non-blocking I/O paradigm, the creators of Node needed to empower the developer in this model with a programming language according to this kind of fire-and-forget pattern. For diverse technical and popularity reasons they have chosen JavaScript (via Google's V8).

Instead of being "the killer app", JavaScript played the role of "the killer lang" in Node's initiative, JavaScript has brought programming component to the Node promise, acting as a catalytic for this idea having a non-blocking web server that is light, fast and easy to code.

Node.JS creators recognize that JavaScript has been chosen not only for being a good technical fit, but also for its degree of popularity; which was expected to help in the adoption of Node, and boy! it did.

Node.JS is not a multi-purpose platform/framework, though. It was designed to do -not everything- but a few things well, like processing tons of short asynchronous network request and deliver small responses as fast as possible.

Because of that, Node earned a nice popularity in the implementation of mash-ups, social, network gaming, and mobile apps; which in their majority match with the previously described "many short network interactions" model. These type of applications are also known as "Systems of Engagement" (in opposite to traditional Systems of Records such as ERPs, CRMs, and others).

To wrap up this post up, here is my advice: Node.JS is great, take advantage of it, enjoy it, but do not use it to recreate models that Node is escaping from.
Like in every other new beginning of an emerging technology, several additional tools and frameworks may take that technology in many different directions, not always in happy ones.
Node is suffering this issue now, ironically you will find that there are already frameworks out there on top of Node that are trying to use it as file server or as a traditional dynamic web server, resembling the type of models that Node was born to improve, not to emulate.

Let's learn from the industry's past mistakes, the last decade is full of examples of bad JavaScript uses that led to millions and millions of spaghetti mark-up and scripting, let's make sure that this time we do it right with Node. Remember that good design patterns for modular, reusable, and maintainable systems are still valid, even in this new paradigm. You can try node for free on the cloud today with OpenShift, Red Hat's Platform-as-a-Service (PaaS)

JavaScript is not back, it is not back simply because it was never gone, now new programming paradigms are testing its resiliency to the pass of time and its adaptability to new technology trends; its proven success on passing these challenges is validating once again how simple, versatile, and powerful the language is.

Related Resources: Podcast interview to Juan Noceda by Gordon Haff introducing Node.JS in OpenShift.

Stay up to date on this and related topics by following me on twitter: @Juan_Noceda

Popular posts from this blog

Dear Tech Entrepreneur! (startup or corporate): Embrace Cloud to Stay Competitive!

As entrepreneur (startup or corporate), you need to deal with so many things, to the point that it is easy to get overwhelmed and loose focus. Many of those things that consume your attention are central to your project while others are critical but at the same time secondary compared to the core of your business. Let's see how Cloud Computing can help on outsourcing the load of what is peripheral and how it can empower what is core to your idea, project, or business. Go ahead and take advantage of the Internet Age: One of the positive side effects of the current times is the pollution of digital services. You have at your disposal plenty of service providers which are happy to take those "secondary" concerns of yours and do them for you for a relatively modest fee.  Some of these services range from addressing new concerns that were born in the digital age like email address validation and search engine optimization to the "webificated" versions of tr

Linux, Cloud, Open Source, Virtualiztion, PaaS, Java, BigData, Mobile, and more in a single event: Red Hat Summit and JBoss World 2012

What is the only high-tech event in the industry that can concentrate, in a charming city like Boston , all the technologies and thought leaders that are driving software innovation today? The answer is Red Hat Summit and JBoss World 2012 on June 27th to 29th, let me prove why... This is not just another software vendor event, in which you only see the vendor's product stack from the angle that they want, as its name implies, Summit 2012 is a multi-perspective open event, in which the open source communities, an ecosystem of Red Hat partners, and independent parties get together in aparticipative event hosted by Red Hat to talk and share experiences as they drive forward the next fronteer in information technology and software development. Let me prove you through the 7 points below why you get the best of the software industry in a single event, and show you how Red Hat is powering many more critical areas than you may think in today's tech world: Watch this cool S

Cloud, SaaS, PaaS, and IaaS Adoption Trends and Forecast

At this point it is clear that the term "Cloud" transcended the buzz word and is already the label of an attractive $100B+ market. Cloud Computing represents the top enterprise IT spending in 2015, even beyond other hot growing technologies like Mobile and IoT. Not just that, budgets for Cloud offerings may even double in 2016. And if we talk about the other two hot tech trends, it is not a surprise that about three quarters of the IoT and Mobile offerings have also a Cloud component. Let me share with you my own direct experiences and my interpretation of some key Cloud Computing statistics over the last few years as well as the trends for the next two or three. In every case contrasting the numbers with qualitative data points and insights. Let's then dissect the Cloud universe in the typical 3 tiers, starting from the bottom... Infrastructure as a Service (IaaS) In 3 years IaaS will represent: ~35% of cloud use cases (compared with a ~65% of PaaS + SaaS)