I think this is a fundamental problem with C. Both of the language itself, but also of the C programming culture of insisting on very low levels of  abstractions.<p>Bugs and undefined behaviour is too easy for programmers to write when the level of abstraction is low. Too much boilerplate to get wrong. But too low a level is also bad for an optimizer. It cant assume it understand the programmers intention with the code.<p>C++ tries to fix some of this by creating a higher level language and library on top of C. Low level code is considered unsafe, when higher level abstractions can be used as replacements.<p>Some examples of replacing low level with high level. Raw (owning) pointers and manual memory management are replaced with RAII value semantics and occasionally smart pointers. Raw loops are replaced by container iteration and better yet by STL algorithms. Casts are replaced by templates. Threads and mutexes are replaced by tasks and async, etc.<p>Eventually the idea is to subset C++ so that we can rip the C out of C++.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;isocpp&#x2F;CppCoreGuidelines&#x2F;blob&#x2F;master&#x2F;CppCoreGuidelines.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;isocpp&#x2F;CppCoreGuidelines&#x2F;blob&#x2F;master&#x2F;CppC...</a>