News for hackers. Stuff that matters.
Re:Rust is the future, C is the new Assembly: Josh Triplett ... by the_duke on Wednesday August 28, 2019 @01:46PM (#20822151)
I haven't done a lot of C programming myself, but I've heard very mixed opinions from C devs. Some say they hate the borrow checker because it introduces artificial constraints.

Others say that they love it because it enforces how they write their code anyway, but now with compiler checks that prevent them from messing up.

I think it's a fair criticism that the borrow checker is sometimes not powerful enough to understand a perfectly valid access pattern, but unsafe is always there if you know better.

More often than not (in my experience), the access pattern is not actually valid though, or risky and easy to mess up. And the compiler rubs your nose in a suboptimal design.

I've found that when I needed to reach for `unsafe`, I often could restructure the code instead to achieve a safe result with minimal performance loss.

There are no comments on this comment yet.