How and why to learn the most loved programming language - Rust

Do you want to know why Rust is highly favored among programmers and get valuable tips on initiating your own Rust learning journey? Of course, you do. Read on to see what we’re talking about!

Reading Time6 minutes

If you have an inclination towards exploring new programming languages, you'll be pleased to discover a multitude of options at your disposal, including Python, C/C++, Ruby, and many more. Among these, Rust emerges as a compelling language that draws our attention. In this blog post, we will delve into the captivating world of Rust, and discuss both how and why you should embark on the journey of learning this remarkable language.

Why learn Rust and who it’s for

The most loved programming language for six years in a row, going into seventh, Rust ranked most wanted technology together with Python, and Typescript in second place -  as per Stack Overflow 2022 Developer Survey. Rust is also in the top 15 programming languages in all of GitHub’s stats. It has helped my programming career to grow, as I gained knowledge for future projects (personal and work-related ones).

Rust is for everyone who wants to learn new programming languages and wants to challenge their own software development skills. It’s a modern programming language that a lot of companies already use, like Mozilla, Dropbox, and others. If you are an aspiring programmer, it’s one of the languages you might consider learning, also because it will look great on your resume. 

For more information on what would be good to know for your future employment in the software development business, you can read our blog post: Creating a profile any employer would want to see: GitHub edition.

Favorable and challenging sides of Rust

The benefits of using Rust are its memory safety, performance, and concurrency. It has a rich set of tools for developers, such as Cargo, the package manager, Rustfmt for reformatting your code according to the community guidelines; and Clippy, a useful linting tool that analyzes your code, catches common mistakes and helps you improve your Rust code. You can find more tools with short explanations on this link. Rust has a thriving open-source community that is committed to making the language accessible to developers of all skill levels. There are many resources available, including online forums, documentation, and tutorials.

On the other hand, Rust has some negative sides. It’s not beginner friendly and has a rather steep learning curve. Syntax in Rust can be complex, so it can lead to difficulty in reading the code. The compilation time in Rust can be slow, especially for larger projects, and can sometimes lead to slow down project development. And even from my personal experience, I can testify that sometimes debugging the code can be rather challenging.

Similarities with other programming languages

Rust shares many similarities with other programming languages, particularly in terms of syntax and idioms influenced by C and C++. This makes it easier for programmers familiar with these languages to transition to Rust. Furthermore, Rust and C++ have more in common—they are both system programming languages designed for high performance and offer memory management control. However, Rust takes a more modern and safer approach to memory management without compromising performance. Additionally, as an open-source language with a vibrant community, Rust has developed a package management system called Cargo, similar to Python's pip.

First steps to learning Rust

The best way to start learning is to visit Rust’s official website. There you can read and learn more about Rust itself. Clicking on the tab “Learn”, you can get information on how to start learning -  by reading the book, doing the Rustlings course, or maybe learning it by checking out Rust by Example. The latter materials consist of code examples mostly, they are explained, but you learn from the given code samples. Rustlings course was designed to follow your reading of the book and complement it by giving you exercises to practice. I personally started learning by reading the book and doing the exercises on the Rustlings course, which I would recommend to all new Rust programmers.

Library

The book “The Rust Programming Language” consists of materials a new Rust programmer would need to know, from installation to some of the more advanced concepts. One of the most interesting parts of the book is the concept of ownership in Rust, which explains how it works with variables, functions, references, and error handling, which describes different types of errors. One of the, to me, more difficult concepts of Rust, is lifetimes, which ensure the validity of references and prevent memory safety issues. For programmers in our industry, the most important chapters are “Smart Pointers”, “Fearless Concurrency”, and “Final Project: Building a Multithreaded Web Server”, as their understanding is necessary for building web apps. 

All of these concepts are present in the Rustlings course, and through exercises, they are introduced in an easier and more understandable way. One of the things you are taught in the Rustlings course is the previously mentioned linter program Clippy. It helped me improve my coding skills as I learned about some errors and bad coding -  all by studying an example of how I should implement it in my own code.

Learning through practice

The next step, suggested to me by my work colleagues, is to try some of the online code practicing websites like Exercism. Exercism is one of the best websites to learn to code as there are tasks of different difficulty levels for various programming languages, and after every task you successfully resolve, you can read submitted answers of other people, and they can give you a rather interesting outlook on the way to solve a problem that you might’ve overlooked in your task. This website helped me a lot in understanding Rust, as it had a syllabus with tasks related to the chapters in the book.

That’s all, folks!

Whether you are interested in learning Rust programming language, improving, or just challenging yourself, I hope my experience of grasping it helped you to find your own way. Thank you for reading, and I hope I have interested you in trying to learn this programming language!

Hey, you! What do you think?

They say knowledge has power only if you pass it on - we hope our blog post gave you valuable insight.

If you want to share your own experience on how you’ve learned Rust or need our advice on how to use it in your own projects, feel free to contact us

We'd love to hear what you have to say!