First Post
New Blog!
Hey reader, I’m Josh, a software engineer and aspiring Rust developer.
The reason I’m looking to learn Rust is that I enjoy systems level programming. Some of my very first programs were written in C, and I’ve even had some college classes that were taught with C or C++.
I moved away from trying to be a C developer to becoming a Java/Kotlin developer when I started my career. After that, I’ve moved onto writing Python and Vue, which is where I’m at now for my day job.
Although Python and the like are good, I really enjoy typed languages. There is something about being explicit with coding that I enjoy. It leaves very little room for ambiguity. Thankfully, Rust is designed this way, and the compiler also ensures that I’m writing it mostly correct.
or at least it removes a whole class of memory bugs
Where I’m at Currently
So far, I’ve read 13 chapters of The Rust Book!
I have learned a lot from reading these chapters, but some concepts still feel out of reach to me — especially traits, iterators, and testing. While I can use iterators, for instance, I wouldn’t say I’m proficient with them. Traits, on the other hand, still feel abstract to me. Then I have yet to even try doc testing.
Why Blog?
It’s all about motivation for me.
We’ve probably all been there; get really into something and then shelve it only to never see it again.
That’s what I do, a lot, because I’m not holding myself responsible for seeing something through. Thankfully, this doesn’t carry over to my career, that’s probably because I have goals defined and have a vision with what I’m working on.
This blog will be a way for me to share my learning journey. I can hold myself accountable for posting my learning progress. It can be something I can look back on much like a diary. This will allow me to visually see the progress I’ve made.
I’m already coding!
I have written Rust code already. This was from following Chapter 12 in the Rust book with the minigrep
project.
Here’s the link to my minigrep GitHub repository
I was able to implement some details on my own before I read the following chapters like iterators.
Here’s a snippet of the search functionality within the code:
pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {
let mut results = Vec::new();
contents.lines()
.filter(|line| line.contains(&query))
.for_each(|line| results.push(line));
results
}
The contents.lines.filter(...)
section was my own doing before getting to the iterator chapter in the book. This gave me valuable practice in chaining methods together, and I was able to compare what I did here to what was in that iterator chapter. Doing this gave me the confidence in my own ability to solve problems in Rust. This might seem trivial at first, but it’s a good step in my learning journey.
Wrap Up
If seeing an amateur learn Rust is intriguing, feel free to follow along. Hopefully I can share more about this language on a more technical aspect soon!