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.

Log in or sign up to reply.

copper-pine-383 more

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

slow-sedge-602 more

Saving this for later.

late-otter-67

Ha, I thought I was the only one.

amber-sedge-89

This is the most useful reply in the thread.

slow-thistle-68

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

misty-yarrow-351 more

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

slow-finch-34

Could you share a photo of how it turned out?

copper-alder-13

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

misty-rowan-888 more

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

late-thistle-94 more

Thanks, this is exactly what I was looking for.

late-clover-963 more

Ha, I thought I was the only one.

amber-sedge-231 more

late-clover-96 wrote:

Ha, I thought I was the only one.

Strong disagree, but I appreciate the write-up.

slow-thistle-68

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

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?

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.

woven-beech-641 more

Saving this for later.

slow-sedge-40

woven-beech-64 wrote:

Saving this for later.

Strong disagree, but I appreciate the write-up.

copper-wren-271 more

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

bright-finch-0

Thanks, this is exactly what I was looking for.

copper-hazel-52

Fewer incidents is worth slower onboarding, in my experience.

dusky-fern-703 more

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

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.

bright-finch-351 more

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

late-willow-50

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