News for hackers. Stuff that matters.
Re:C++ creator rebuts White House warning by pornel on Monday March 18, 2024 @07:44PM (#39751409)
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 the system that is broken, and needs to be made more robust.

Re:C++ creator rebuts White House warning by gigel82 on Monday March 18, 2024 @11:22PM (#39752637)
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, JavaScript/Typescript) whereas reading Rust (in particular function definitions) is painful.

Re:C++ creator rebuts White House warning by dralley on Tuesday March 19, 2024 @12:34AM (#39752975)
IME this is mostly a familiarity problem not an actual syntax problem.
Re:C++ creator rebuts White House warning by gigel82 on Tuesday March 19, 2024 @11:08AM (#39756510)
No, I mean humans in general, not software developers. Seriously, show a non-developer a printout of some average modern C++ code and some average rust code and see which one they think is easier to read and more visually pleasing.
Re:C++ creator rebuts White House warning by dralley on Tuesday March 19, 2024 @01:40PM (#39758309)
Average Rust code uses a fair number of lambdas, you won't convince me that C++ has a readable / ergonomic syntax for lambdas.
Re:C++ creator rebuts White House warning by GoblinSlayer on Tuesday March 19, 2024 @03:38AM (#39753688)
See log4j vulnerability, you still need "just don't write bugs" with safe languages. What was really tried was "use C the hard way", which fails regularly as one can expect. Projects that use C the easy way have much better safety.
Re:C++ creator rebuts White House warning by pornel on Tuesday March 19, 2024 @08:11AM (#39754933)
See ShellShock. Having memory safety vulnerabilities doesn't prevent other bugs. C and C++ projects still have logic errors, broken auth, XSS, SQL injection, and do dangerously dumb stuff, and that's on top of buffer overflows, user-after-frees, data races, and UB footguns.

Nobody promises that memory safety will fix all bugs, but it can prevent or significantly reduce a class of vulnerabilities, and reduce the total number of serious defects. And then time and effort saved on dealing with memory corruption bugs can be redirected towards dealing with all the other higher-level issues.

> Projects that use C the easy way have much better safety.

That's just another way of blaming programmers for not writing C without the bugs.

Every language can be perfectly safe if used correctly — even hand-written machine code. The problem is that it's easy to say "use C the easy way" (whatever that means), but actual real-world uses don't live up to such standard, and even the best programmers can make mistakes. Language safety is about making programs safer even when programmers write less-than-ideal code.

Re:C++ creator rebuts White House warning by GoblinSlayer on Wednesday March 20, 2024 @04:15AM (#39763896)
You're talking about using C the hard way, that's difficult to get right indeed, because it's the hard way.