loading...
Cover image for My 2 cents on Deno 🦕

My 2 cents on Deno 🦕

thebedroomprogrammer profile image Arpit Dubey ・5 min read

With the emergence of new tech, framework, programming language, and patterns every day the web industry is more confusing than ever, making it very hard for a newbie get their feet wet and get the taste of how it feels to get going or start development in the web dev industry. Every time a new tech is introduced everyone goes on to throwing benchmark results on how the new stuff is better than the old one and how it can replace a huge chunk and make the development better.

I as a developer often get overwhelmed and fatigued by this continuous punch of information and knowledge thrown at my face. We, instead of diving deep in the use cases of a particular tech start comparing it with all the other tech that is around it. Deno is one of the same "runtime" that falls into the category.

"What is Deno?", you may ask. So "Deno is a simple, modern, and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust". It has been under development for almost 2 years and I have been following for less than 6 months and this is what I have found out.

Deno draws a lot of its resemblance from "Node". Just try to rearrange the letters in "N O D E" and you will get a gist of what I am talking about. Deno is the brainchild of Ryan Dahl the creator of NodeJS who left the NodeJS Foundation in January 2012 after creating and contributing to the open-source Javascript runtime for almost 4 years or more. He made JS run on a server possible and he is the sole reason why starting up as a web developer in today's times is a lot easier because a lot of people pick up NodeJS first to learn web development as it is a lot easier to get up and running with it. Node did good and is doing extremely well in the current times but there were a lot of problems with it. Since the development around Node was so fast that with the passing years a lot of code was added to it and some very bad decisions were made around it. As people were adopting the runtime faster than ever before, it became a lot harder for the devs to manage it or fix a bug as devs were relying on them, so they had to patch it instead of rewriting the whole feature which resulted in Node become a Big Ball of Mud.

The devs were under great technical debt and it was impossible for them to undo the changes and the decisions that were made in haste, so everyone decided to keep going forward. Ryan Dahl, on the other hand after leaving the foundation and working in a Google Scholar program wanted to change that. So he laid down the idea of Deno that targets and tries to remove all the shortcomings of NodeJS that it faces as a Javascript runtime some of which are

  • No native support for promises.
  • Lack of security.
  • A poorly designed module system.

A lot of learning has been taken from NodeJS since Node is out in the wild for almost 11 years. Some of the great features of Deno that tackles the problem that Node has are:

  • It has no default access to the file system, your environment variables, and your network so better security. Everything is turned off by default and is not granted access until you specifically provide the access.
  • Inspired by GoLang(Another great systems language turned server-side tech) it uses a URL path to resolve the modules. So instead of a module being hosted on a registry on a single platform, the dev can host the dependency anywhere they like and can import them using the URL just like we do in browsers. There is no central repository for it and since Deno always caches the dependency it provides an extra layer of robustness in case the platform hosting the dependency is down. Deno uses typescript as the default language.
  • Typescript has been a boon for JS devs out there. It allows a dev to write bug-free type-safe code by restricting the developer to follow certain rules and guidelines so they can be sure that the code they ship is going to work all time.
  • The underlying implementation is written in Rust(the equivalent of C++ for Node) and the event loop is Tokio(Rust). Since the development in the Rust community is far active than ever before and as the language claims that it helps developers write memory-safe code without letting them worry much about the memory manager management and thread-safety issues like that in C++, it holds a lot of promises for Deno. Deno's first version was released on 13th May 2020 and the repo has already gained 55k+ stars on Github and a lot of love and support from the community. But Deno is not here to dethrone NodeJS. Node has already been adopted by a large number of organizations and has set its root deep in the web dev industry it would be very very hard for Deno to dethrone Node. If used with caution Node is a powerful runtime that enables a developer to do any task that its counterparts do and it is performant too.

The open-source community has opened a great realm of competition that has made the coexistence of a great variety of tech solving a variety of problem possible in different ways. It is up to you to decide what path you want to take. Since every community is trying to get better than the other it keeps them on toes to make the product even better which always enhances the product. Hence it is a win-win situation for us developers.

All you need to do is instead of going blindly behind a tech decide that does it solve the problem that you want to solve in an efficient way and will it be feasible to put out the cost of learning and implementing the tech as a use case in your scenario possible.

In conclusion, I would like to say that do not get overwhelmed by the knowledge coming at you. Change is constant and all you need to do is adapt according to the situation.

Yearn, Learn, and Earn.

I would highly encourage you to take a look at the references that I have referred to make this article possible.

If you’re excited by this and want to work on cutting edge technology that touches millions of users daily, drop us a hello at careers@gamezop.com. We are hiring for both backend (Golang / Elixir / Node) and frontend (React / Node) roles.

Discussion

markdown guide
 

Just try to rearrange the letters in "N O D E". That made me laugh out loud.
Nice article!