Sleep IoT Quest - Day 18 Progress Update
Day Summary
Last night was a full 8 hours. I still woke up feeling like I hadn’t fully caught up (makes sense after three rough nights — one good night doesn’t erase sleep debt).
Busy day: job work, moving between apartments, a tiny workout. I did my Daily Quest late, but I did it. I reached the Collections chapter and talked through vectors vs arrays and String
vs &str
. I keep getting hung up on the idea that string slices are basically just “peeking” into data I already own, and why that behavior isn’t simply part of String
. Substrings aren’t conceptually hard; it’s all bytes in sequence.
I’m basically using AI as a Socratic partner — asking the whys, hows, and whens — and I keep harping on not using insider terms; I want plain concepts tied to what I already know. For standard-library items I can jump to references in Neovim; for built-ins, “go to reference” doesn’t really help.
Net: win logged. I handled admin, job work, moving, ate properly, squeezed in a short workout, and still put in the Daily Quest at the end. A little proud of that.
- Daily Quest: 60 minutes (completed; late).
- Reading (60m, +6 pages): p.194 → p.200 — started Collections.
- Coding: none.
Context
- Late-evening session; energy low but got it done.
Reading
- Vectors vs arrays: arrays = fixed size (often stack),
Vec<T>
= growable (heap). Clear use-case split: known, fixed data vs runtime-sourced, variable data. - Strings:
String
presented as a growable owner (wrapper overVec<u8>
). - Slices: friction point — needing a separate type (
&str
) just to view/substring data you already “own.”
Coding Practice
- None today.
Reflection
- The
String
vs&str
split still feels ergonomically off: “I own the car but need a neighbor’s bike to drive it.” - Zero-allocation is nice in theory, but the extra type to remember/use feels like overhead without obvious benefit during learning.
- Despite the ranty mood, progress happened; kept moving through the chapter.
Key Learning
- Arrays ↔
Vec<T>
distinction makes sense for fixed vs growable data. String
is an owner;&str
is a view (borrowed slice) into UTF-8 data. The language forces you to be explicit about viewing vs owning.- Practically: you can take a slice from a
String
(e.g.,&s[..]
) without copying; it’s just a different type at the call site.
Total Time Spent
- Reading: 60m
- Coding: 0m
- Daily total: 60m
PCT (Project Cumulative Time): 23h29m