Node: Is it a Language or a Framework?

Node: Is it a Language or a Framework?

Image for postCredits: Pexels.com

Even after years of experience in JavaScript, many developers get confused about the basic NodeJS question. What is NodeJS? Is it a Framework or a Language? You are also here to know this basic understanding of NodeJS. So let?s dig up some jar of knowledge and see what is heck in NodeJS.

In NodeJS, ?JS? stands for JavaScript this means NodeJS is directly connected to JavaScript somehow. If it comes from JavaScript then it should be a framework of JavaScript, because that’s the rule we are seeing with other languages and their frameworks, correct? But if it is that simple, I would not be writing an article on this and you would not spending your precious time looking into it. So before understanding the fundamentals of JavaScript & NodeJS, let?s scratch our minds with the basic knowledge which is required to understand this. What is the difference between language & framework?

Image for postCredits: Pexels.com

Language vs Framework

At the start of the college, Coding is quite simple, we have libraries(stdio.h, if you used C in college), variables, for loops, if conditions, functions, etc. But as we start knowing and learning more we are introduced to the new keyword ?Framework?.

What is this Framework? Don?t we already have too much to understand and learn that this new terminology is introduced to create confusion? Let?s understand this by an example first.

Everybody knows about Hindi & Devanagiri correct? So as we know Devanagiri is a ?lipi? to write Hindi(Indian Language) & some other languages. Devanagiri defines the set of rules and the manner of writing in which Hindi is written. While in Hindi we have pre-defined keywords(made by Hindi alphabets ? ? ? ? ? ?) to use by which we communicate.

The same thing applied in languages & frameworks also. A language is just a minimal set of rules for doing things like ?Devanagiri?. Whereas the framework is a collection of useful tools written for a particular programming language as we discuss in the above example ?Hindi?. So JavaScript is a language but Angular is a framework, JavaScript provides a minimal set of rules for coding and system tools to compile it whereas Angular provides a collection of useful tools to make coding easy and organized.

A software framework (be it front-end or backend) includes standardized, pre-written code, which makes the development of certain functionalities easier and faster. You have less freedom to code, as you have to code as the framework architecture dictates. :- DZone.com

Image for postCredits: Pexels.com

There are two types of language, Programming language & Scripting Language. Programming language needs a compiler to compile the code whereas scripting language requires the interpreter to execute code in run time without compiling. So basically we need a compiler or interpreter to execute a program.

JavaScript was initially created to ?make web pages alive?. So JavaScript initially made to interact with the user on the browser only. But with the pace of technical enhancement, we got two new terminologies NodeJS & AngularJS. AngularJS is a framework of JavaScript according to the above-mentioned example and definition of the framework. But NodeJS is not. Node.js includes that interpreter separately which requires to execute code. It takes this power from the chrome v8 engine which is used in chrome to run JavaScript. And, it extends the power of handling file and network I/O with a preference for asynchronous patterns. In simple words, we can do a lot of things in NodeJS which are not possible with JavaScript like network I/O, File handling, etc. For security reasons, JavaScript originally did not include file I/O for use in the browser. And, it did not need to do networking tasks, because the browser does them. JavaScript was built out with the DOM for the browser.

In simple words,The engine is a collection of the compiler and the interpreter used to run a language on a platform as JavaScript run by v8 engine on chrome.

So, the original idea of node.js was to be able to set up a web service or a TCP server really fast. You could, and still can, just copy a code snippet, put it in a js file and then run it with node, and you will have a server. Yeeee!

At last,Node.js (Node) is not a framework nor a language but a run time open source development platform for executing JavaScript code server-side.

I hope this article helped you clear the myth that NodeJS is a framework. If you want an in-depth knowledge of the difference between JavaScript, NodeJS, AngularJS & ReactJS, check my article. Happy Reading || Write2Learn

14

No Responses

Write a response