by akavel · 9y ago · 0 comments
A personal opinion from a person who loved C++ for quite some time, before diving deep enough to realize how dark is the abyss.
Anybody who has the faintest clue about both languages should know that.
It's undefined behavior, despite not calling free anywhere. Replace with std::string and it could be use after free. In C, UAF wouldn't happen that silently for heap memory.
With C++, good luck even reading and understanding The ISO C++ Standard. Not to say fully internalizing all possible interactions between all nuances. I presume not all of them may even be truly 100% fully fleshed out and explored in The Book. As to writing a compiler - even just writing a parser for C++ is famously super hard!
Anyone that is able to keep in mind the documented 200 cases of UB is my hero.
> Writing C++ code longer than a few lines without UB is humanly impossible.
Do you want me to provide one for you? Because that will definitely change your definition of 'humanly impossible' tasks and might also bring you back from realms of using comically bad phrases..
Why the sarcasm?