Learning Rust
Last updated: August 23, 2020
As random as it sounds, the first time I heard about rust was when I told a friend that I thought that everything should be const in c++ by default. It still makes sense to me to explicitly mark the objects you plan to modify rather than mark the ones you are going just to read. Reading is more common than writing, so this is a way of avoiding errors where you are modifying an object that was only meant only to be read.
He said that I should check rust out. So I did. That was a few years ago, and I got excited with the language, but I never did anything besides read half of the rust book in one day. It was just curiosity.
At work a few people were experimenting with rust, and I heard their discussions with enthusiasm. I waited for my next personal project to come, and implement it in rust to learn the basics.
The goal of this post is to list the resources I used, and maybe in the future I can write my own posts with some tips.
- If you are already a programmer, I can’t recommend Rust By Example book enough. I quickly got the main concepts because of the way that examples are shown.
- The Rust Programming Language book is also good, but takes more time to explain the concepts and I recommend it for things that are not clear just by looking into the examples.
- For quick references Rust Language Cheat Sheet is also great.
In my first project, I implemented a tool that takes a pgn file with several chess positions in FEN format, and converts it to a more readable format to Screen Readers.
Here is the project page for more info.
I found rust fascinating. A lot of the concepts prevent errors that are common for programmers to make. I think if you are coming from a c++ background, as I did, you are not going to find things difficult. When I got used to c++ move semantics, I thought that would be nice to have rules to enforce some of the common error cases. Rust has them. The ownership rules are very explicit, and for the simple cases that I had to deal with in my first project, I did not have any problems.
Another thing that caught my attention was the matching system, which I plan to write in more detail in the future.
I still have some todos in my project that I plan to work on in the next month, and some of them are more complex, which will allow me to get experience with rust.
Goodbye, and mark your variables as const. Or use rust.
Disqus comments are disabled.