I won’t write any long preamble, here are 8 reasons to learn Node.JS:

1. The JavaScript ecosystem. NPM is the largest package repository in the world, meaning that you can find existing tools for almost everything, from authentication to something exotic like EPSON printer drivers. Not only can existing solutions save you some time, in many cases using third-party libraries can be more safe and reliable than reinventing the wheel, because there is support of large communities behind many of them, which makes you sure that the code is clean, well tested has been used in production. If you decide to use Node.JS, try to develop the skill as soon as possible to search for packages you need and identify their quality. You can identify a reliable package by the size of the community and by its activity on GitHub (or other VCS), how many open/closed issues there are, is there good documentation, how often the code is updated.

2. The language and the ecosystem are developing rapidly. When I started to learn JavaScript, it was nothing more than a browser-only script language which allowed you to do some obnoxious animations, popup windows and dropdown menus, no one took it serious. Experienced developers used to laugh at the phrase “javascript programmer”. When server-side JavaScript just appeared, there was a ton of geek memes about spaghetti code, callback hell and type system (you know, “1” + 1 = 11, “1” – 1 = 0). It is somewhat honest, JavaScript was not intended to do anything serious when it was designed. But today we have TypeScript, promises, async/await, arrow functions, proxies and many other examples of how quick and inventive the community is in solving problems. One of the recent examples: there used to be node_modules directory in each Node.JS project that included all installed dependencies, and because of the JavaScript’s tendency to utilise many third-party libraries it rapidly became uncontrollably large (I usually had ~0.5–1 GB for a medium-size project, with hundreds of thousands of .js files):

If you are using Yarn package manager, there is no longer node_modules for each project. Instead you’ll have a centralised cache that includes whatever you use to develop and launch your code

3. Flexibility. Thanks to the toolchain being so large, it’s always up to you to decide what to use. For example, if you want to code a simple scrapper script, you can use no type system at all. If you are building a business application, you can choose between TypeScript and Flow. Whether you like functional style or OOP, there will be tools for you, MVC, MVVP, MVWHATEVER – there are tools for you. My favourite example is asynchrony. You can use: callbacks, native promises, third-party promises, generators, async/await, observables, threads, fibers, and I’m sure that there are even more options I just don’t know about. As in most cases you cannot predict how popular and large your app will be, this allows you to build an MVP quickly and then scale to enterprise-eligible code. On the other hand, with great powers come great responsibilities:

The advice here is to not try to build a “perfect toolchain” from scratch, start with simpler configuration and scale as you go. Once that you have some experience the decision-making process will be simpler. Ideally you should invest some time in picking and mastering some stack that you are most comfortable with, there are so many options that this can be even frustrating, but your efforts will be rewarded

4. CLI tools. Node.JS is not just for building backends for applications, it is also a powerful platform to build command line utilities. The fact that development environment that you use is written in the same language as your project can be really helpful sometimes.

5. SSR. If you want to improve the speed of the first meaningful paint of your single-page application, you might need to employ the technique called SSR. The simplest way to do it involves executing frontend code on the backend, and Node.JS is perfect for this.

6. GraphQL. GraphQL is an API schema-definition language and a client-server communication protocol that has all chances to completely replace REST. Although the protocol itself is stack-agnostic, at the moment javascript is the best option to build GraphQL in terms of toolchain (take a look at the Apollo stack and Prisma database access layer). You can develop GraphQL API endpoint with Node.JS and delegate heavy computation to some microservices written in programming languages that are more suitable for this, such as Go.

7. Electron.JS. You can also use Node in combination with web technologies to develop desktop applications. And there are some good examples of such applications – Atom and VSCode are written in js. And I really love this, my apps, my toolchain and even my IDE are written in the same language.

8. You’ll get paid well. Yes, there is much competition in the world of JavaScript because of the low barrier of entry and you will have to learn a lot to stay competitive. But I managed to make $40/h on Upwork with my skill set with zero work experience in IT companies, just pet projects, which I think is not bad for the beginning, and I could make more if I invested some more time into this. Despite the fact that there are so many JS developers, my clients report that it’s difficult to find someone who writes clean, safe and reliable code. Learn, develop professionally, seek for the best, cleanest solutions and you will get rewarded very soon.

Source: Kit Isaev

Share this