Back at the start of 2023, I decided that I wanted to play around with Rust and since this site was then running on a very old version of MovableType and it was difficult to use I set up a separate website so that (a) I could write about my learning process and (b) to help me learn Hugo and migrate this site to a new system.
As I said at the time…
“I’m a programmer with far too many years’ experience, much of it in C++, and I’ve decided that I’ve not been pushing myself enough lately to learn new things. I have a blog at www.lenholgate.com and find that I tend to learn things best when I take the time to write about them. I often make mistakes and there are so many clever people around that it makes sense to make these journeys public so that others can correct mistakes and help me learn (if they want to). I also find that it’s useful to have my musings searchable by Google so that I can easily find them again; often I find that when I search for solutions the way I ask Google a question isn’t quite the way others talk about the solution and so having my own answers is often useful to the future me. Also, I’ve had “more personal technical development” on my todo list for so many years and never really actioned it properly, so telling the world I’m learning Rust and making my progress visible may help me keep moving forward; or at least leave me with something else to be embarrassed about in a year or so’s time.
My approach to learning things has always been to read around the beginners guides for a bit, until I get bored, and then throw myself in at the deep end and try and write something that does something that I care about. When learning C, all those years ago, I immediately decided that I needed to write a multi-user text adventure game… With Rust, I quite quickly wanted to work out how to write generic code. I always tend to take the “run before I can walk” approach and therefore make mistakes along the way, sometimes I’ll fix up the mistakes before I write about that step in the journey, and sometimes I won’t discover the mistake until later and so will fix it and write about it later. All of this means that what you find on this site may not work for you, especially if you don’t learn in quite the same way that I do, but then, as I said above, it’s all about me really :)
My desired destination is being able to write idiomatic and efficient Rust code for the problem domains that I care about. I expect it will take me a long time to reach that destination. Initially I’ll be using a mix of test-driven development and compiler error driven development…”
This is what I ended up with, I’ve now finished moving this blog to Hugo and my exploration of Rust has stalled a bit, and so I’ve decided to merge the content of len-learns-rust.com into my main blog. This page is an index for the content from len-learns-rust.com presented in the order that the entries make most sense, len-learns-rust.com was structured in chapters as well as a normal blog format.
1 - Overview
2 - An Id Manager
- 2 - An Id Manager
- 2.1 - An Interval
- 2.2 - A collection of intervals
- 2.3 - Adding intervals correctly
- 2.4 - Removing values
- 2.5 - Building an id manager from a collection of intervals
- 2.6 - Smart Ids; object lifetime and mutability
- 2.7 - Renaming without restructuring
- 2.8 - Generic code in Rust
- 2.9 - Clean up and additional functionality
- 2.10 - The journey so far
3 - Threading