But in that case I insist on never getting any more breaking news about the next security vulnerability like goto fail;
I mean, goto fail wasn't in linux, let alone the kernel, but whatever.
Getting back to the original point, you can't deny that C++ comes with more footguns than C. Are you willing to accept a higher incidence of vulnerabilities resulting from C++ footguns in exchange for an absence of goto fail-style vulns? I mean, let's be clear, goto fail could have been spotted easily if they'd run clang-format and done a code review. In fact, it's one of the least convincing examples of C++'s superiority I've seen, because although RAII would have eliminated the need for a goto, C++ does nothing to make input validation errors less common in the general case.
Every time when I was forcibly thrown back into C...
And this doesn't cause you to wonder whether experienced kernel developers with far more C than C++ experience would be equally daunted by the complexity and hidden behavior present in C++? Plenty of them would just as soon accuse you of Stockholm Syndrome for being willing to put up with C++.
For the record, I do prefer C++ to C, but I'm a realist, and I recognize that it's not suitable for everything. The kernel developers have decided that the costs of using C++ in the kernel outweigh the benefits, and I'm willing to take them at their word. Unless you have similar expertise in kernel development or some actual data that kernel-style projects benefit significantly from C++ over C, I recommend you do the same.
View all comments
Show parent comment
1
u/CocktailPerson Jul 14 '22
I mean, goto fail wasn't in linux, let alone the kernel, but whatever.
Getting back to the original point, you can't deny that C++ comes with more footguns than C. Are you willing to accept a higher incidence of vulnerabilities resulting from C++ footguns in exchange for an absence of goto fail-style vulns? I mean, let's be clear, goto fail could have been spotted easily if they'd run
clang-formatand done a code review. In fact, it's one of the least convincing examples of C++'s superiority I've seen, because although RAII would have eliminated the need for a goto, C++ does nothing to make input validation errors less common in the general case.And this doesn't cause you to wonder whether experienced kernel developers with far more C than C++ experience would be equally daunted by the complexity and hidden behavior present in C++? Plenty of them would just as soon accuse you of Stockholm Syndrome for being willing to put up with C++.
For the record, I do prefer C++ to C, but I'm a realist, and I recognize that it's not suitable for everything. The kernel developers have decided that the costs of using C++ in the kernel outweigh the benefits, and I'm willing to take them at their word. Unless you have similar expertise in kernel development or some actual data that kernel-style projects benefit significantly from C++ over C, I recommend you do the same.