wireleaf

programming.rust

What finally made the borrow checker click for you?

copper-hazel-52

Six months in and I still restructure code to make it happy rather than understanding why.

copper-pine-383 more

Compile times got better once we split the workspace into more crates.

Reply
slow-sedge-602 more

Saving this for later.

Reply
late-otter-67

Ha, I thought I was the only one.

Reply
amber-sedge-89

This is the most useful reply in the thread.

Reply
slow-thistle-68

Async is fine for applications now. Libraries still have it harder.

Reply
misty-yarrow-351 more

Thinking in terms of ownership rather than lifetimes made it click for me.

Reply
slow-finch-34

Could you share a photo of how it turned out?

Reply
copper-alder-13

It clicked once I stopped thinking about lifetimes and started thinking about who owns what.

Reply
misty-rowan-888 more

Write the data structures first, the code follows from them.

Reply
late-thistle-94 more

Thanks, this is exactly what I was looking for.

Reply
late-clover-963 more

Ha, I thought I was the only one.

Reply
amber-sedge-231 more

late-clover-96 wrote:

Ha, I thought I was the only one.

Strong disagree, but I appreciate the write-up.

Reply
slow-thistle-68

Counterpoint: it depends a lot on how much time you have.

Reply
bright-thistle-5

late-clover-96 wrote:

Ha, I thought I was the only one.

Could you share a photo of how it turned out?

Reply
quiet-birch-652 more

misty-rowan-88 wrote:

Write the data structures first, the code follows from them.

Small correction: it was the other way around, but the point still stands.

Reply
woven-beech-641 more

Saving this for later.

Reply
slow-sedge-40

woven-beech-64 wrote:

Saving this for later.

Strong disagree, but I appreciate the write-up.

Reply
copper-wren-271 more

The compiler errors are the best teacher. Read them all the way through.

Reply
bright-finch-0

Thanks, this is exactly what I was looking for.

Reply
copper-hazel-52

Fewer incidents is worth slower onboarding, in my experience.

Reply
dusky-fern-703 more

Clone more than you think you should while learning. Optimise later.

Reply
woven-beech-64

dusky-fern-70 wrote:

Clone more than you think you should while learning.

Agreed, and I'd add that it takes a while before it clicks.

Reply
bright-finch-351 more

I tried this last year and ended up somewhere completely different. Not worse, just different.

Reply
late-willow-50

Agreed, and I'd add that it takes a while before it clicks.

Reply