4 ms·
I think the bad programmers are ones who state "segfault protection" as a feature of Rust because they read it on Rust's site. I genuinely don't think these fe
by stmfd 10y ago
I think the bad programmers are ones who state "segfault protection" as a feature of Rust because they read it on Rust's site.
I genuinely don't think these features of Rust are really all that useful (they're being disingenuous; acting like C++ is some primitive language where you segfault every 5 minutes).
Even Bjarne would probably agree. He talks about the same issue at his "The Essence of C++" talk. Someone asks if he shares the blame, alongside Ritchie, for all of today's major security issues (Heartbleed is the given example). He says something similar to what I've said. Segfaults are not a major issue at all unless you're consciously doing something idiotic.
- eropple 10y agoI don't disagree with you in that well-written code should make invalid memory accesses rare. And I don't disagree that, if you write good C++ (and I've stumped around here for C++ because I really didn't learn it until C++11 and have never had an environment where I didn't have the tools to write good C++), they are. But I feel, and pretty strongly, that Rust makes it a lot harder to write bad code in general. Memory protection is just one of the ways this is true. I replied to you mostly because "you're a bad programmer if you need protection against invalid memory accesses" is rampant nonsense. Everyone needs that protection. It is at best a question of whether you need other things more. (Few people do.)
- stmfd 10y agoI agree, that was rather brash. They're not bad programmers. I tried to clarify that in my previous comment. I think C++'s biggest failing is how large and convoluted it is but, in relation to the thread's question, how many beginner C++ programmers are gonna jump straight into systems programming? I sure hope the answer is 0. I just see too many people quoting the list on Rust's homepage verbatim when I ask them about why a skilled C++ developer should pick up Rust.
- to3m 10y agoBut they're good features, mftb. I have to say that as an experienced (some might even say skilled) C++ developer I would go for pretty much all of them.
- pcwalton 10y ago> I genuinely don't think these features of Rust are really all that useful (they're being disingenuous; acting like C++ is some primitive language where you segfault every 5 minutes). Nobody said that C++ code segfaults every 5 minutes, and accusing people of being disingenuous for saying things they never said is, well, disingenuous. The claim is that memory safety problems are serious problems in C++ code. It's been found that memory safety problems are the leading overall cause of software security vulnerabilities [1]. [1]: https://insights.sei.cmu.edu/sei_blog/2014/08/performance-of-compiler-assisted-memory-safety-checking.html https://insights.sei.cmu.edu/sei_blog/2014/08/performance-of...