4 ms·
Could you expand? Maybe steel-man what you think his argument would be and your rebuttals?
by sinsterizme 6y ago
Could you expand? Maybe steel-man what you think his argument would be and your rebuttals?
- jeffbee 6y agoI can't really do a "steel man" rebuttal because over the years Linus has argued against a language he calls C++, but which is a made up language invented for the purpose of hating it. A straw man, if you will. It is difficult and frankly not worth the trouble to try to rebut an argument that has never risen above the level of "crap", "broken", and "bullshit". In the particular case of operator new, it's clear from his cumulative statements that Linus is unaware that the programmer provides global ::new, and can make it do whatever the hell he wants it to do. You can also just forbid it and use placement new everywhere.
- ironman1478 6y agoTo be fair, I think most C++ programmers are unaware of replacing global ::new and most don't know about placement new either (from what I've observed). I think lots of people who write library style code do (whether it be for boost, stl, or in their company) but outside of that most C++ devs are not library style devs and are a bit out of the loop on these topics. Also, I agree with what you said early about RAII solving entire classes of issues that C (and C++ without RAII) has.
- steerablesafe 6y agoMost C programmers are not kernel developers either.
- ibotty 6y agoHow can you catch allocation failure from ::new? Is it possible without exceptions (which have some other problems in kernel space)?
- steerablesafe 6y agoOne can use ::new(std::nothrow), which selects the non-throwing allocation function. Returns nullptr on failure.