I don't love Rust (either)
cbarrete.com·2h·
Flag this post

So what are we left with? Many ways of dealing with control flow, but no silver bullet. Of course, it makes sense to pick the right tool for the job, we don’t need a single way of doing things if it compromises too much. But the reality is, Rust doesn’t let you pick the right tool for the job here, only the least bad one, but it’s always going to be painful anyways. This is less apparent in simple code, where pattern matching looks elegant, method chains are clean and the try operator makes your problems vanish, but beyond slideware, reality is less glamorous.

I’ll add that while refactoring is usually nice in Rust thanks to its type system, making a method chain more complex or converting it to pattern matching as it grows is often going to give you headaches. You’ll get there, the …

Similar Posts

Loading similar posts...