DEV Community

loading...
Cover image for How to learn the Rust programming language in 2021 - Best resources and techniques

How to learn the Rust programming language in 2021 - Best resources and techniques

Miro
A programmer and a high school student studying at Tampere high school of technologies. I am interested in entrepreneurship and building SaaS πŸš€
・3 min read

I am currently going through learning a new programming language. Deciding the language took me a bit longer than excepted, maybe a bit too long. Anyways, I have decided to go all in the Rust programming language.

What is Rust and why I decided to learn it?

Rust is an open-source systems programming language that focuses on speed, memory safety, and parallelism. Developers are using Rust to create a wide range of new software applications, such as game engines, operating systems, file systems, browser components, and simulation engines for virtual reality.

Rust has been chosen in the past years as the most loved programming language in stackoverflow surveys. It is used and trusted by many large companies such as Firefox, Dropbox, and Cloudflare.

Here are some of the best reasons to choose Rust as your main language:

  1. Rust Solves Memory Management Problems
  2. Rust’s Static Typing Ensures Easy Maintainability
  3. Rust Has Fast and High Performance
  4. Cross-Platform Development and Support
  5. Rust Has an Expansive Ecosystem

I would say that Rust is a kind of mix of C & C++ programming languages. It has taken the best features from both languages.

How I am going to learn Rust?

I don't have any specific plans for learning Rust but I'll list here some resources and techniques to help me on my process.

The most important thing for me in learning a new programming language is to create my own projects. Although, before being able to do own projects it is important to know the basics of the language well.

For learning the basics of the Rust language, I think that the best way to do that is to complete Rustlings, which contains a good amount of small exercises to complete with Rust. In my experience, doing different kinds of tasks helps to learn concepts better and become more familiar with them.

Other good ways for learning are reading the official Rust book which is free to read online but pays a little bit like a physical book. For more alternative and more practical resources I will suggest looking out Rust by example where concepts of the Rust book have been taken into real-life usage.

When trying some small features or ways to do different things, it may be useful to use an online editor/playground for testing those. For that purpose, there is a great online platform to use which is Rust playground.

Some tools to help writing clear Rust code

For writing good, readable, and clean code, there are available a lot of free tools for doing that. For example, I would say that tools such Rustfmt, Clippy, and Rust-analyzer are some tools I recommend everyone to try.

  • Rustfmt -> A tool for formatting Rust code according to style guidelines.
  • Clippy -> A collection of lints to catch common mistakes and improve your Rust code.
  • Rust-analyzer -> A modular compiler frontend for the Rust language

These mentioned tools are just optional ones, but anyways I would suggest using them because of reasons I've mentioned in the past.

My experiences so far

Even I have not been using Rust for a long, I have some experience with it. Here are the most important ones that come into my mind:

  • In my opinion learning Rust takes a lot of time, especially for someone who comes from languages like Python. I used Python before and I have found this different kind of language such hard to understand.
  • It is important to know the basics of Rust before going any deeper on it because at least then you find it really draining.
  • You have to be patient in learning and not give up as easily as I often do.

Conclusion

Rust is an absolutely game-changer programming language that I think everyone needs to learn at some point in their journey. I believe that the links and resources mentioned in this post will help you to get started on the journey...

Follow me on socials to get updated:

Discussion (1)

Collapse
basman profile image
Adam.S

The guys in the rust discord are super helpful as well. They have a channel for beginners.

Forem Open with the Forem app