Post

Learning Rust

Learning Rust and Started my first Rust Project

Why I am learning Rust

Over the summer I have been exposed to a lot of different tools used in my internship. I was able to use these tools to help create new projects for my team. As I was learning I realized that I learned a lot of things and was learning the foundational knowledge of stuff and a then some. I wanted to learn something new and wanted to be a master at it as well. I could have learned more about the languages I already know like Java, Python, C/C++, etc. But I wanted to learn something completely new to me. I looked at JavaScript and the differnet frameworks and realized that web design is not something I see myself doing long term. Then I found GOLang, at first it did intrest me and I thougth about learning it but the more I looked it reminded me a bit of Java just easier syntax, then I stumbled into Rust and was intrigued by the features it has and the learning curve it has.

My Experience with Rust:

As of 08-27-2024 I have enjoyed learning Rust. It is a harder language to learn compared to others I have heard but I am grasping the stuff right now. I enjoy the features Rust offers like Cargo for example. Cargo is the coolest thing to me and I enjoy using it. Cargo.io is a site I visit weekly to see new crates added by other Rustaceans (Rust Supporters) and see docs of crates I am using. I got the No Starch Press Rust Programming Language book from a co-worker (If you are reading this thanks again). I love No Starch Press books cause it helped me learn differnet languages and much more. So far I have leanred

  • Cargo and Crates: Tried some features Cargo offers and learned how to add packages to a project using cargo.toml.
  • Simple Synatx: Learned the basics of Rust like ints, strings, functions, etc.
  • Ownership and Borrowing: Learning ownership at first was tricky but as I keep reading I slowly naturally pick up of ownership of data/variables. Also ownership is a very cool feature of Rust that prevents the issue of programming memory mistakes and it has no garbage collector like Java and Golang
  • Enums and Structs: I already new structs but got to dive more into enums than usual and I see enums in Rust have more a bigger use than other languages.
  • Options in Rust Found out that Rust does not have a Null value so they use Options to create a psuedo Null value.

Guessing Game using Rust:

I was able to create a number guessing game in Rust and it helped solidify what I have learned. I got to use useful Rust features like references for borrowing a value and the expect() for error handling. Since the guessing game needed to generate a random number everytime it runs I got to use a crate called rand and saw how crates interact with Cargo and the code. And using the match feature in Rust is very nice.

I enjoy learning Rust and hope to become a master at it, if you know anything about Rust and have things to help me learn please email me some projects to try.

P.S. The Rust Programming Language Book I mentioned is free at https://doc.rust-lang.org/book/ or if you have Rust installed on your machine it is on your native device type rustup doc --book. Thank me later and hope it helps people intrested in Rust :)

This post is licensed under CC BY 4.0 by the author.