Hacker News new | ask | show | jobs
by deckarep 2178 days ago
I agree with this sentiment. A lot of this depends on purely the angle of how you view things.

One example: People claiming the borrow checker gets in their way in Rust because it’s so strict.

Guess what? If your code doesn’t compile due to the rigidness of the borrow checker, it’s incorrect I’m sorry to say. It’s either got a data race, use after free bug or some other invariant. You don’t want that behavior in your code at all.

I’m happy to offload the responsibility to the compiler to check for this.

You won’t get it until you’ve been bitten.

1 comments

> If your code doesn’t compile due to the rigidness of the borrow checker, it’s incorrect I’m sorry to say.

There're plenty of bug-free code which the borrow checker doesn't permit. A very common example is nested calls with a &mut receiver: https://internals.rust-lang.org/t/accepting-nested-method-ca...