Swamptin

A Personal Blog

View on GitHub

Rust Learning Part 2

I guess one of the things I should really do here is explain why I want to learn Rust, or failing that why I’m taking on these exercises. In the previous part I mentioned that I wrote a ‘TODO’ app in rust before. This was, like all good projects, taken from someone else’s code and then expanded upon by me. I’ve hit a snag though. To fully being this simple app to conclusion I feel there is need for nuance within the todo items. In order to achieve this I need to implement more complex data structures. A thing I struggle with sometimes in languages I do understand, let alone something I’m learning for fun in my spare time.

Thus, we come to this approach. It’s less about learning everything, more about getting a solid understanding of enough of it to feel comfortable with what my little project needs next.

Exercises 03

The first exercise of chapter 3 is to do with structs. This is something that I struggled with. It’s mostly because conceptually I find it hard to picture a struct and it’s uses. I have spent a decent amount of time running the tests, seeing what the error is, rereading section 3.1, and then attempting again. As with all things it’s a matter of persistence. Thankfully, as I’ve said before, the rust errors are, well, verbose and targeted.

Exercise 03-04 was the first one I felt like I struggled with. It turns out that part of that was that I hadn’t been reading the steps correctly. If you do read it correctly then it makes perfect sense. The whole exercise is to illustrate some errors and what they mean. Specifically private and public visibility issues and how those errors are relayed to you when you try to compile the code.

The real issue here is about reading and understanding. I am currently learning to slow down and be sure of what I’ve read. This isn’t aided by others rushing through things. It turns out I’m no good when I rush. As a point, I have returned to exercise 03-05 about a week later and have just completed it, and it’s certainly reinvigorated. Let’s see if I can’t finish out chapter 3 tonight.

Home