Why you should move from Node.js to Rust in 2019

Why you should move from Node.js to Rust in 2019
In this article I want talk about my reasoning behind it, and why you as a NodeJS developer should consider the same.

Rust is the new JavaScript

JavaScripts appeal comes mainly from it’s easy-to-use and available-everywhere characteristics. It’s the only choice in the browser to build applications.

It also shines on the server side of things with its easy to use frameworks, easy syntax and no static types.

Building a web application with NodeJS takes literally a few hours. And with React on the frontend you have a always evolving and powerful tool to build complex applications.

So why is Rust the new JavaScript then?

  • Rust is available not only on the server, but also runs on hardware
  • With WASM, Rust will be able to run in the browser as well
  • As a frontend developer, NodeJS helped you to get into server-side programming. Learning Rust will help you covering the whole stack from hardware to server to frontend

Rust is the logical next step

NodeJS was so successful that even large applications got build with it. However, one missing piece was and is its type system. With no static types, Microsoft had to step in and create TypeScript. It offers many people who had to move from C++ and Java a familiar environment.

However, now instead of learning JavaScript, you are learning a tool from Microsoft which adds another layer on top of all the other layers to make JavaScript run on the server.

Learning TypeScript is bad pain, learning Rust is good pain

When you learn TypeScript, you mostly cope with a tool which is there to improve a language which lacks well thought through features.

If you want types, and you might need them in bigger applications, you can move to a typed language right away. Why bother with a transpiler?

Types

You know the saying: The biggest strength is also your biggest weakness?

Well with Rust, the thing you will love the most is its static type system. It will take some time though. The type system will prevent you from easily deploying a CRUD app in under one hour, but it will help you in the long run crafting sophisticated, safe and fast applications.

And once you are used to it, you can create your own “rust-web-starter” app and get the same benefits of crafting fast prototypes as you would with Node.

Rust is the new Bitcoin, but better

I painted a pretty simple picture: Why would you then choose Rust over, lets say Go?

Because Rust is the new Bitcoin. The majority of contributers are not working for Mozilla (who took over the Rust project and published it). The development of the language happens in the open, and everyone can contribute. Decentralized if you wish.

If Mozilla would completely abandon the language, it would still live on and flourish. Go however is solely maintained within Google, and we all know what happens to most Google projects after a few years.

It doesn’t seem like Go will go anywhere, the language is great and you will be super productive with it. But so is Rust, plus it has all the other features.

Documentation

When I talked about “leveling up” in the beginning, I meant leveling up. You don’t have to read through StackOverflow to fix some random problem.

The Rust docs are superb. You have to get used to them though. The structure and explanations make more sense once you start building your own applications and need help.

The Rust Compiler

Your biggest enemy and your best friend. The term “good pain” couldn’t be more accurate when it comes to the Rust Compiler. You will hate it that even simple exercises will fail in the beginning and you can’t even easily pass Strings around.

But, once you got the hang of it, you realize the biggest strength of the compiler:

You can pair program with the compiler and be sure to have crafted a solid application afterwards

Rust is still evolving, and you might live in a city where the community is not strong yet! So what? The Rust Compiler knows everything, and if it approves your code you can feel safe and secure.

Obviously…

Rust is as well:

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter

Further reading

The Complete Node.js Developer Course (3rd Edition)

Angular & NodeJS - The MEAN Stack Guide

NodeJS - The Complete Guide (incl. MVC, REST APIs, GraphQL)

Best 50 Nodejs interview questions from Beginners to Advanced in 2019

Node.js 12: The future of server-side JavaScript

An Introduction to Node.js Design Patterns

Basic Server Side Rendering with Vue.js and Express

Fullstack Vue App with MongoDB, Express.js and Node.js

How to create a full stack React/Express/MongoDB app using Docker

An introduction to Web Development with Rust for Node.js Developers

7 reasons why you should learn Rust programming language in 2019

Rust Vs. Haskell: Which Language is Best for API Design?

Suggest:

Learn Startup - Build a successful business and change the world

Here are 380 Ivy League courses you can take online right now for free

Most Popular JavaScript Frameworks 2019 - I'm Programmer

Building a Video Blog with Gatsby and Markdown (MDX)

How to check if Checkbox is Checked or not using Plain JavaScript

10 Node Frameworks to Use in 2019