Detailed Introduction To NODE JS - CodingSnap | 2021
You are here because probably you want to learn Node.js or have made your mind to get your hands in backend development. Whatever may be the reason, I'll try my best to explain all details about Node, essentially needed to get started with it.
The first question that anyone would ask before starting is that,
What is Node.js?
So, basically,
Node.js is a Javascript runtime that allows the execution of Javascript codes outside of the browser.
Brief yet important history:
Before the year 2009, developers could only execute the Javascript codes inside of the browsers using the console. The browsers basically have a javascript engine that runs the JS codes (Chrome has v8, Firefox has SpiderMonkey, Edge has Chakra, etc).
It was then when Ryan Dahl, the author of Node.js got an idea to run the Javascript codes outside of the browser just like any other programming language. So he used Chrome's V8 engine as it is the fastest JS engine out there to date and embedded it in a C++ program named Node.exe. In a nutshell, that's how Node.Js as a runtime was made.
This creation led to the massive usage of Javascript. Developers realized the fact that now JS can also be used for creating the backend services, APIs, Games, AI development, Pentesting, and Hacking. The exposure of fields drastically increased and Javascript started taking a new shape. This marks Javascript to be one of the most in-demand programming languages in the modern era.
Node.js is an open-sourced, cross-platform runtime environment. It is suitable for building highly-scalable, data-intensive, and real-time apps.
This was a brief introduction to Node.js creation and Ideation. Now the question comes
Why Node.js and why not any other frameworks like Django, Spring, etc?
The choice of frameworks/ programming languages for any project depends on several factors, such as the use-case, the number of users, the number of I/O operations, the time for computational tasks, and many more factors are taken into consideration and then the tech-stack is decided or finalized.
Talking about Node.js it has its own pros and cons, let's look at them pointwise:
Pros-
- Node.js is great for prototyping and Agile development.
- It is superfast and highly-scalable.
- It is a single programming language stack, i.e. Javascript
- The above point leads to another valid point: Cleaner and more consistent CodeBase
- Largest Ecosystem of Open-source libraries.
- Node should not be used in scenarios for CPU-Intensive apps, such as Video Encoding, Image Manipulation, etc.
Read about Synchronous and Asynchronous or Blocking and Non-blocking architecture here.
0 Comments