An Article by Isaac Amankwaah Anane — Backend Engineer at Enyata
Introduction
Whether you are new to programming or already an experienced developer in the industry, you have debated the best programming language or framework in one way or another. Be it performance or popularity within the programming community.
Since its introduction in 2009, Node.JS has experienced exponential growth in popularity, directly influencing rumours and misconceptions about this technology.
In this article, I will attempt to identify and demystify some of the misconceptions about Node.js. I will also from this point forward refer to it as Node.
What is Node.js
Node.js is an open-source and cross-platform JavaScript runtime environment for executing JavaScript code outside of the browser.
<aside> 💡 Open-source software is made by many people to be publicly accessible. Cross-Platform software is compatible with multiple operating systems. Runtime Environment is an environment in which an application runs.
</aside>
Before the advent of Node, Javascript only ran in the browser, often referred to as a browser language. Node then came in to free this powerful language from the confines of the browser.
Quite often we use Node to build back-end services or what we popularly refer to as APIs (Application Programming Interfaces). These are the services that power our client applications. For this reason, people are tempted to compare Node to tools and frameworks like ASP.NET, Rails, Laravel, and Django.
Some of the popular misconceptions include;
Misconceptions
- Node is a framework like Laravel, ASP.NET, etc.
- Node is mistaken for a language.
- Node relies on Google Chrome’s V8 engine only
- Node does not support multi-threading
- Node has a complex learning curve
Facts about Node.js
Node is an asynchronous, event-driven JavaScript runtime. This means requests sent to a node system are handled as a loop (event loop). With this, Node is ideal for building I/O-intensive and real-time apps.
V8 is the name of the engine that powers Google Chrome. Every browser comes with its own JavaScript engine: Chrome (V8), Safari (Nitro), and Microsoft Edge (Chakra). All these engines can parse and execute JavaScript code. The idea to go with V8 as the engine of choice for Node.js was solely birth from the quest for performance. Since V8 was written in C++, making it cross-platform, and because of its evolving nature, it was more prudent to choose it. This is not to conclude that the other engines cannot power Node.js.
Node, designed without threads should not be a yardstick to conclude that Node does not support multithreading. It sounds confusing, but you can take advantage of the multiple cores in your environment to achieve multi-threading. You can easily communicate with the child processes API [child_process.fork()](<https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options>) to arrive at this.
Node provides an environment for JavaScript to run. Any programmer familiar with JavaScript can learn Node quickly.
Conclusion
Many things have been said concerning Node. What I want you to take home is that Node is neither a programming language nor a web framework. Comparing it to languages and frameworks becomes fundamentally wrong and baseless.
The Enyata community is a great place for you to meet with engineers, get free resources, and enjoy sessions with experts in their fields, which will help grow the ecosystem. Join us here.