Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These guidelines pretty much apply to C++, although pointers in Rust are more akin to smart pointers than raw pointers, and there are indeed a bunch of use cases for those. Sticking to values and references works pretty well most of the time though.

But pointers in Rust seem pretty well thought out and more sophisticated than what's possible in C++. I'm particularly excited about the compiler error when a borrowed pointer goes out of scope.



Yup! If you use C++, this wiki page can help: https://github.com/mozilla/rust/wiki/Rust-for-CXX-programmer...

Basically, imagine boost's pointer types being in the language, so that the compiler can reason about them.


I love it. I'm staring to look for reasons to try Rust in a project, luckily they're piling up :)


Supposedly 1.0 is "around the corner," so maybe you'll find a good reason by then...


> These guidelines pretty much apply to C++

Yep, C suffers from pointer abuse and with it, infects any language that uses C compatibility as language subset.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: