3 ms·
> compiler-enforced memory safety allows for the use of patterns that would otherwise be difficult to use safely I have to say, this has been amazing. For cont
by epage 7y ago
> compiler-enforced memory safety allows for the use of patterns that would otherwise be difficult to use safely
I have to say, this has been amazing. For context, I'm a C++ developer who has had minimal run-ins with the borrow checker because I was already used to thinking about ownership. I refactored a large-ish Rust crate I maintain to use references for a fundamental type. I would have considered it irresponsible to do that with a C++ codebase unless absolutely required. Even if I did the upfront analysis to make sure it was safe, I'd need to re-do that exercise for every architectural change, at least. Instead with Rust, I just tried it on a whim, knowing the borrow checker had my back.
- pjmlp 7y agoIn C++ you can have some help via static analysis. Unfortunately very few care to actually use them. https://www.bfilipek.com/2019/12/cpp-status-2019.html?m=1#what-additional-tools-do-you-use https://www.bfilipek.com/2019/12/cpp-status-2019.html?m=1#wh... As I learned since Turbo Pascal days, if it isn't part of the language, it seldom gets used.
- roca 7y agoThat's quite right. But also there is a big difference between "the static checker will probably catch errors of this kind" and "the compiler will certainly catch errors of this kind". The latter is far more liberating.