Hacker News new | past | comments | ask | show | jobs | submit login

Eh, that's just Linus continuing to demonstrate how little he knows about C++.



Could you expand? Maybe steel-man what you think his argument would be and your rebuttals?


I 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.


To 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.


Most C programmers are not kernel developers either.


How can you catch allocation failure from ::new? Is it possible without exceptions (which have some other problems in kernel space)?


One can use ::new(std::nothrow), which selects the non-throwing allocation function. Returns nullptr on failure.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: