As all of us know that Deno is officially released now. Many of us are thinking kingdom of NodeJs is now over after the coming of NodeJs just because it is made by the developer of NodeJs itself. Well, this is not true. Let us discuss this stepwise.
The History of Deno:
As stated above Deno was invented by Ryan Dahl(inventor of NodeJs). It is the next big discovery, Ryan, after NodeJs. Dahl started working on Nodejs since 2009 and it was a great invention too. But after some years he realized that he had done many mistakes in NodeJs that cannot be just solved by updating a version. Moreover, he also mentions in a program about 10 things I regret in Nodejs, where he announced the Deno- a javascript and typescript runtime.
So many developers of Nodejs fear that NodeJs will be replaced because Ryan dahl itself created the competition of NodeJs. But they should not fear dahl himself said in another event.
Dahl himself said in another Deno is new precisely on its 1.0.0 version and on the other hand node is pretty old and both have the same purpose to serve.
But what will be the future of Deno and node after 5 or 10 years hardly anyone can tell.
Comparing deno and nodejs:
Nodejs is based on c++ uses the v8 engine which helps to javascript code. The v8 engine was made by google for google chrome to run javascript code on web browser.
Deno also relies on v8 but instead of c++ it uses Rust language because it is a bit fast and moreover it provides more security. Moreover, access errors and buffer overflow should be avoided.
Coming to the security - there are many issues in NodeJs related to access, it accesses many local files without any permission or the network.
On the other hand, when we are running a Deno App, Deno asks permission from the user what he wants to do.
ES6 support in Deno -
Another security issue in the Node app in NPM, not only it downloads heavy node-modules , but it also does something suspicious in the background. In the past, there have been many scandals related to NodeJs for example Nodejs have spied our data. Deno does not rely on NPM, instead, we have to download through URL, and once downloaded they can be cached.
Browser compatibility
Deno aims to be a browser compatible, technically speaking it supports all browser and when using the es6 we don't have to use any build tools like webpack to make our application ready to use for browser.
However, we may have to use tools like babel to transpile the code of ES5 version of javascript, and as a result, code can be even run in the older browsers.
TypeScript out of the box-
typescript is a matter of taste for some developers but some may found it unnecessary. But both sides can be happy with Deno- because Deno supports typescript out of the box, as well as classic javascript.
You can see it because you can save the file .ts or .js and run them with the same command Deno run
Summary -
So now coming to the conclusion that we don't need to leave NodeJs because Deno is very new and may have some issues as well which will become stable in the coming few years, So yes node can be replaced by Deno in coming 5-10 years.
Thanks for reading hope you liked the blog stay tuned for more updates and hit the like button.
Comments
Post a comment