News for hackers. Stuff that matters.
Re:I cannot consistently write safe C/C++ code by phaylon on Monday July 17, 2017 @09:42AM (#14788376)
The big safety wins from Rust for me are things like the type system disallowing iterator invalidation, the type system handling resource releases, iterators making bounds checks a lot more affordable, the shared immutable/unique mutable distinction, the ability to encode that something can't keep a value somewhere accidentally, type system enforced thread safety, and others in that category.

Why would I need a good understanding of C++ to consider these built-in facilities or the ones that just happen due to the type system as safer?

Re:I cannot consistently write safe C/C++ code by ccommsxx on Monday July 17, 2017 @09:51AM (#14788465)
I don't think you need a good understanding of C++ to appreciate these features per-se. Only if you want to make a statement like "X is an improvement over C++ because of these".

For example, enforced const-ness/immutability, option types and automatic ressource management (RAII) are also already standard in modern/best-practice C++ code. In general I agree that there are a lot of nice languages features that rust currently has which would also be nice to have in the c-family languages.

Re:I cannot consistently write safe C/C++ code by phaylon on Monday July 17, 2017 @10:44AM (#14788897)
> I don't think you need a good understanding of C++ to appreciate these features per-se. Only if you want to make a statement like "X is an improvement over C++ because of these".

What about "X encoding thread-safety through the type-system is an improvement over the C++ way" and similar? This is how I usually read these kinds of statements.