About Rust

November 6, 2021

Hi, nowadays I am learning Rust. I want to write what I like and dislike about it. Let's start

Pros

It feels you are a computer programmer. I used Python for nearly 2 years. It is also a very good programming language. You can write what you want easily with its syntax and community libraries. But tbh, I don't feel like I am programming a computer program when I code it with Python. You don't do anything with "computer" it is mostly "programming". So what is the difference with Rust? Rust has; strong data structure and very good memory management. I believe there are also other cool things in Rust. But I just saw those, I am very beginning at my Rust way.

Unbelievable documentation. They have amazing learning resources. The Rust Programming Language book and Rust by Example is fear enough to start Rust.

Community. I join Rust's discord channel and I love it. There are lots of people active and they are answering my questions very fast.

Cargo. Cargo is a package manager, and more. You can create a boilerplate with cargo new name. You can build easily with cargo build or just check the code (faster than build) cargo check.

Crates. Maybe not the best one but I like the packages in the crates.io.

Binary app. cargo build --release creates a binary for you and you can run it from Windows, Linux, or macOS easily. When I write Python code and want it to send my friends they have to install Python. But in Rust, you don't need to install anything to run the program.

Layout. In other programming languages, you can do a "thing" in many ways. And honestly, I didn't learn all ways and compare them. So, mostly I used what I learned first. But in Rust, you "have" to use language's way. I am not talking about algorithms. I am talking about some design decisions that were made for us.

Compiler results. When you compile Rust code and the compiler found errors in your code, it tells you what is wrong. And it is mostly enough to solve the problem. You don't have to always ask to "google is wrong with my code" (StackOverflow doesn't like it).

Cons

Syntax. I was getting at the beginning. What the fuck ! is doing in front of println? Did they write ? mistakenly end of a function call? So there is something a different commenting with #[derive(account)], ok I got it (WRONG!). All of them are now more clear for me. But if it doesn't for you and you want to learn Rust, don't be afraid. Just stay cool and go step by step. All of them were selected very cleverly by the Rust team.

Conclusion

That is all. I hope you enjoyed it.