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

> In C++, null references are Very Bad,

They are!

And while they are not a normal thing, they are a thing and I've run in to them a handful of times in the real world, almost always the result of someone not checking for null before dereferencing a pointer.

Rust does not really have this issue.



Rust also has this issue, unless you fully validate every single pointer coming out of unsafe blocks.


The difference being that all c++ code is 'unsafe' in the rust sense, whereas a typical rust program will have only a small portion of unsafe code (or none), making it easier to fully validate - hence 'doesn't really have this problem'.


I agree, but it depends how seriously unsafe blocks get reviewed.

Because I can assure you, unsafe blocks in enterprise Rust will be reviewed as much as C and C++ code currently are in most Big Corps™.

We do have such problems with native libraries killing Java and .NET processes, with unsafe being the FFI boundary.




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

Search: