r/ProgrammingLanguages • • Apr 10 '26

Borrow-checking surprises

https://www.scattered-thoughts.net/writing/borrow-checking-surprises
52 Upvotes

27 comments sorted by

View all comments

Show parent comment

13

u/matthieum Apr 10 '26

There's a BIG difference between:

  1. "gotchas" at compile-time and "gotchas" at run-time.
  2. "gotchas" which allow more code and "gotchas" which allow less code.

Rust is a big improvement over C++ in that it leans firmly on the former gotchas, while C++ is too often on the latter.