Core Node Concepts

Node quickly became an established, viable and efficient web development platform. JavaScript on server environments was somewhat of a novelty and full stack JavaScript had never really been seriously considered.

What makes Node such a popular choice for many development projects?

One of nodes most compelling features is how it implements the concept on non-blocking I/O. Node embraces non-blocking I/O to improve performance for a number of application types.

JavaScript’s traditional event-based implementation makes a relatively convenient and well-understood syntax that suits asynchronous programming.

Key strengths of Node

  • Efficiently distributes small pieces of information
  • Enables Full Stack JavaScript Development
  • Easily scales to multiple processors or servers
  • standard library, module system, and npm

In order to dig deeper into the Node.JS framework it is important to at least have a basic understanding of JavaScript.

The key rudimentary concepts in JavaScript to understand are :

If you are totally new or unfamiliar with JavaScript then I suggest you review the The Modern JavaScript Tutorial

It is also worth taking time to understand the Event Driven Architecture on how it relates to JavaScript and Node.JS in particular

As with many software programming frameworks, you don’t necessarily need to be an expert in the programming language, but knowing enough of the basics stands you in good stead to mastering the framework, and over time you will master the programming language

In all probability if you’re reading this blog, you have worked with JavaScript in the past. Maybe you’ve worked with JQuery or have fiddled with some JavScript files in a web application that uses HTML, CSS and JavaScript to make the client more dynamic and interactive by manipulating the browser Document Object Model (DOM).

If you’re like me, you have probably found working with JavsScript quite a frustrating experience and counter to other programming languages. You may have also spent alot of time fighting the different browsers’ incompatabilites, probably compounded by the fact that you never really took the time to study JavaScript as a language, apart from some of the most basic features.

It pains me to say this, but I have to admit that I never really accepted JavaScript as a real programming language until about 5 years ago. I always regarded it some really basic scripting language, and not really capable of anything like any of the real programming languages I was proficient with at the time like C++, Java, C# or Python.

JavaScript was always a necessary evil I used with HTML to do stuff client side. I really didn’t like it!

All that changed when I found node.js. After a few weeks of developing using node.js I realized that JavaScript is actually really cool and far more powerful than I had previously thought.

I have since taken the time to really get to grips with JavaScript, trying to understand it’s quirks and really leverages it’s good parts! I do strongly suggest you do take time to buy and read JavaScript : The Good parts, JavaScript Patterns and have a copy of [amazon text=JavaScript : The Defenitive Guide&asin=0596805527] on your desk as reference.

What is Server Side JavaScript

The original intention for JavaScript was to be a scripting language for web browsers, with logic and computation abilities for a document-reading applications. However, despite this it did morph into a fully-featured programming language that can be used in other contexts.

Node.js is a highly efficient and scalable non-blocking I/O platform that was build on top of Google Chrome V8 engine and its ECMAScript. This means that most front-end JavaScript objects, functions and methods are available in Node.js.

Node.js works on a v8 environment – a virtual machine or a JavaScript engine that runs the JavaScript code. In order to deploy node applications to a server your hosting provider will need a v8 environment.

Non-blocking I/O

Node.js is a server-side framework, one of it’s main works is to handle any number of requests. In traditional I/O bound servers systems, a request can only be issued when the response to the previous request has arrived. This is typically referred to as blocking I/O.

Node.JS is a non-blocking I/O, If a request takes long time, Node.js sends that request in an event loop and moves on to handle the next request in the call stack. As soon as the pending request is done processing, it raises an event and the response is rendered on the browser.

Asynchronous Callbacks

In commonly in event driven architecture systems, servers perform tasks that might take a while to complete, like call an API or access a database. Node can process more incoming requests, allowing you to handle thousands of concurrent connections with very little overhead, as opposed to needing a thread on the server for each connection.

Install Node

I recommend installing Node.js on your workstation using Node Version Manager (NVM), which enables you to easily install multiple different versions of Node on your workstations.

Once you have installed node, quickly run through the create a simple node.js module tutorial and build a simple web server

Gary Woodfine

Freelance Full Stack Developer at threenine.co.uk
Helps businesses by improving their technical proficiencies and eliminating waste from the software development pipelines.

A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.
π