4 ms·
> 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 re
by imron 9y ago
> 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.
- pjmlp 9y agoRust also has this issue, unless you fully validate every single pointer coming out of unsafe blocks.
- imron 9y agoThe 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'.
- pjmlp 9y agoI 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.