> I find it surprising that the writers of those government documents seem oblivious of the strengths of contemporary C++ and the efforts to provide strong safety guarantees No, Bjarne needs to realize that RAII and smart pointers are an old concept now, and they have shown to be insufficient, for decades now. The bar for safety has been raised, and the Modern C++ is so behind, they don't even understand the issue, a…
not all applications need safety it is wrong to force safety onto the programmer especially if there is a cost to be paid to obtain it
C++ creator rebuts White House warning
31–40 of 65 posts
Re: C++ creator rebuts White House warning
#32Earlier quoted context omitted.
I don't think he's lying to us. I think he genuinely believes that everyone is using it wrong. Although that's not much of a defense when he was the one who invented the wrong ways to use it.
It's hard to get a man to understand something when his salary (or hobby or self-image) depends on his not understanding it.
Re: C++ creator rebuts White House warning
#33Stroustrup as always fails to recognize the vast surface area of C++ features, foot cannons, and the heavy weight of C compatibility around C++ neck. C++ barely made sense in 1995. It makes absolutely no sense today.
Re: C++ creator rebuts White House warning
#34Earlier quoted context omitted.
We've been trying the "just don't write bugs" strategy for over 40 years now, and it's not working. Framing this as a problem with people being too stupid is a completely unproductive mix of hubris and elitism. In the disciplines where real safety is required (like engineering, aviation, medicine), it's accepted that people will make mistakes. When a system can fail catastrophically due to a simple human error, it's…
I didn't say people are too stupid. On the contrary, we onboard fresh grads onto our large C++ code base every once in a while and they all seem to grasp the concepts just fine. I'm wondering if most folks throwing shade at C++ had used pre-C++11 toolsets and just have bad memories of the experience. FWIW, I find modern C++ genuinely great to read / easy to parse by humans (same for similar languages like C#, Java, J…
Re: C++ creator rebuts White House warning
#35I agree; you can write perfectly safe and noncompromisingly performant code in C++ much better than any language today. It's genuinely difficult to understand why Rust gets rammed down everyone's throats lately; do they really think developers coming out of universities today are too stupid to grasp memory management? If that's the case, why not have everyone code in Scratch? That memo reads like "to avoid wet pants,…
Most software companies have a revolving door of developers and they need cookie cutter tools to limit the damage a "bad" developer can cause. In the 1990's Java OOP was hyped as the solution to procedural spaghetti code (because it is impossible to architect good software without objects), in the 2010's it was web frameworks (because it is impossible to build a web app without a framework), and in the 2020's it is Rust (because it is impossible to write C/C++/Assembly without memory bugs). The Rust hype cycle is yet another Big Corp push for more guardrails.
Re: C++ creator rebuts White House warning
#36About a year ago, Stroustrup wrote a similar response[0] to a similar statement from the NSA[1]. I wasn't really convinced and am more in agreement with this response to Stroustrup[2] from an embedded Linux developer. To quote from near the end of their response to Stroustrup: > In the meantime, it is unfair for Dr. Stroustrup to call safe programming languages novelties or to pretend that C++ isn’t already far behin…
C and C++ are HARD to use correctly, but how many of those 60-70% vulnerabilities would have been resolved by just compiling with llvm address sanitizer? It would have stopped virtually all of them? https://llvm.org/pubs/2006-05-24-SAFECode-BoundsCheck.pdf https://clang.llvm.org/docs/AddressSanitizer.html In many cases we already have the tools. The problem is that people are not using them. That said it is still in…
The problem with these tools are that the instrumentation code inserted by the compiler comes with a 50-100% program-wide performance loss (*) and that's not acceptable to C++ developers. So in practice, you don't just add -fsanitize=address to your builds, you add it to test builds and fuzz them. But now you're not just trusting your compiler, you're trusting your tests and coverage.
The promise of Rust is that many of the memory safety bugs are forbidden at compile time in safe code, and the stuff that has to be checked at runtime (self referential data structures, out of bounds, etc) is able to be added more granularly with unsafe opt-outs where appropriate which means that you're not going to pay 50-100% in raw performance.
* take this like all perf numbers with a heap of salt, do your own benchmarks and come to your own conclusions.
Re: C++ creator rebuts White House warning
#37Earlier quoted context omitted.
C and C++ are HARD to use correctly, but how many of those 60-70% vulnerabilities would have been resolved by just compiling with llvm address sanitizer? It would have stopped virtually all of them? https://llvm.org/pubs/2006-05-24-SAFECode-BoundsCheck.pdf https://clang.llvm.org/docs/AddressSanitizer.html In many cases we already have the tools. The problem is that people are not using them. That said it is still in…
asan only catches what your test suite covers. specifically, that doesn't include novel attacks.
Re: C++ creator rebuts White House warning
#38About a year ago, Stroustrup wrote a similar response[0] to a similar statement from the NSA[1]. I wasn't really convinced and am more in agreement with this response to Stroustrup[2] from an embedded Linux developer. To quote from near the end of their response to Stroustrup: > In the meantime, it is unfair for Dr. Stroustrup to call safe programming languages novelties or to pretend that C++ isn’t already far behin…
C++ does no good if you don't #pragma GCC poison all the C-isms.
Re: C++ creator rebuts White House warning
#39> I find it surprising that the writers of those government documents seem oblivious of the strengths of contemporary C++ and the efforts to provide strong safety guarantees No, Bjarne needs to realize that RAII and smart pointers are an old concept now, and they have shown to be insufficient, for decades now. The bar for safety has been raised, and the Modern C++ is so behind, they don't even understand the issue, a…
That being said, I've fallen in love with Rust and have no intention of ever going back to C or C++.
Re: C++ creator rebuts White House warning
#40Earlier quoted context omitted.
not all applications need safety it is wrong to force safety onto the programmer especially if there is a cost to be paid to obtain it
That's an easy statement to make but in practice it's no longer acceptable; the Internet has become far too hostile and code that's "never going to be connected to the Internet" constantly does.