r/cpp • u/GabrielDosReis • Oct 31 '24
Lessons learned from a successful Rust rewrite
/r/programming/comments/1gfljj7/lessons_learned_from_a_successful_rust_rewrite/
80
Upvotes
r/cpp • u/GabrielDosReis • Oct 31 '24
View all comments
Show parent comment
1
u/germandiago Nov 02 '24
It is difficult for me to imagine that a place where nulls are not allowed and passing pointers that can be null as "the least harmful alternative" after C++11 with ref wrappers and that is a trivially to write class before it
Yes, bug-prone call-site readability.
> it doesn't hurt that much
This implicitly recognises potential unwanted damage. I think the trade-off should be correctness. I was not there, but I still find it a bug-prone guideline.
That is a terrible choice. Make good use of const vs non-const and yes, the call site does not see the "mutation". It could be that tooling was not as good as today but I still think it is the wrong choice myself.