Hacker News new | ask | show | jobs
by wyldfire 1301 days ago
> With Rust, though, one needs to learn entirely new ideas β€” things like lifetimes, ownership, and the borrow checker. These are not familiar concepts to most people working in other common languages ... Some of those β€œnew” ideas are, of course, present in other languages β€” especially functional ones.

With C++, lifetime and ownership are just about as important but unfortunately no one's got your back. You can ignore lifetimes and ownership but you do so at your own peril. And the compiler won't tell you you're doing it wrong because the language wasn't designed for it to do so.

If you want a taste of rust's "mindset" (with respect to limitations imposed by some types) without jumping ship to a new language, try C++'s Guidelines Support Library [1]. It introduces some of the same benefits/friction as switching to rust but without a new language. Opting-in to some of these guidelines might be a gentler way to get some of the benefits of Rust. But it comes with a similarly higher bar.

[1] https://github.com/microsoft/GSL