Rust
Thereās a project that Iād like to do. I want to do it in a new language as a learning exercise too. Thereās a couple of languages that I had my eye on, but I decided to go with Rust.
Rustās incredible credentials
So, why did I go with Rust? Rust has a very clean track record. For 8 YEARS IN A ROW Rust has kept its title of the most admired language by developers, according to Stack Overflow developer surveys. You can see 2023ās results here. Sure, itās not the most sought after by employers - learning Rust wonāt secure your place in a fancy-pantsy job at a FAANG. Oh wait. Whatās that?
MICROSOFT COMES IN WITH THE STEEL CHAIR!
Microsoft was recently (Apr 2023) looking for Rust developers to re-write core Windows code in Rust!. Now if that isnāt a vote of confidence, I donāt know what is. Microsoft loves Rust. Google loves Rust. Developers love Rust. I must know why.
My process
I began my journey of learning Rust through the free online Rust book, that is recommended by the Rust official website. It contains 20 chapters, providing nitty-gritty explanations of every feature of Rust there is. The book is interspersed with code blocks exemplifying the concepts. My personal process of learning was keeping the book open next to vscode. Iād read along, and once I encounter those code blocks I would code-along. The book is great at making you understand the concepts of Rust, but it doesnāt do much to help you internalize it. The book does not contain any quizzes, questions, or assignments (it is a book). At the end of the book, I compiled over 2000 lines of code!
Filling in the gaps
So, to help me truly understand everything and make it āfitā, I made a tiny program. I made a basic scientific calculator in rust, taking in a statement (e.g. 10 * (5 + 2)) and spewing out the answer. In the deeper chapters, Iād read what the authors intended to do next, and code it out without looking at the book. I definitely feel that I still have some gaps to cover, but I will be doing a project in Rust that I believe will iron them out.
The gaps
Rust to me is quite different from the other languages that Iāve learnt so far. It has a set of concepts that Iāve never seen in any other languages, such as ownership. Sure, something like this exists in other languages. Iām still grappling with these concepts. When to use a reference, when to give ownership, when I need to borrow, etc. Some error messages to me read as arcane, but the book has given me the tools to know what part of it is wrong at least.
My impressions
I can see why people love Rust. It gives you confidence that youāve built rock-solid code, with such a strict compiler. Itās also really powerful! I love that if statements are expressions, and because of that variables can be assigned to the values returned from the if statements. I like that testing feels very baked-into the language! No imports or use statements required, no external library. No junit. Iām sure Iāll get a better grasp on it once I finish that project Iāve been meaning to do!