C++ FQA Lite: Defective C++

submited by
Style Pass
2024-02-12 14:30:21

This page summarizes the major defects of the C++ programming language (listing all minor quirks would take eternity). To be fair, some of the items by themselves could be design choices, not bugs. For example, a programming language doesn't have to provide garbage collection. It's the combination of the things that makes them all problematic. For example, the lack of garbage collection makes C++ exceptions and operator overloading inherently defective. Therefore, the problems are not listed in the order of "importance" (which is subjective anyway - different people are hit the hardest by different problems). Instead, most defects are followed by one of their complementary defects, so that when a defect causes a problem, the next defect in the list makes it worse. No compile time encapsulation Outstandingly complicated grammar No way to locate definitions No run time encapsulation No binary implementation rules No reflection Very complicated type system Very complicated type-based binding rules Defective operator overloading Defective exceptions Duplicate facilities No high-level built-in types Manual memory management Defective metaprogramming facilities Unhelpful standard library Defective inlining Implicitly called & generated functions

In naturally written C++ code, changing the private members of a class requires recompilation of the code using the class. When the class is used to instantiate member objects of other classes, the rule is of course applied recursively.

Leave a Comment