There are two main reasons why C software is so bug-prone.

1. Lack of type safety. C is designed in such a way that the compiler
can't do much error checking, so the compiler gives no warnings for
things that, in a type-safe language, would be reported as errors at
compile time. You don't see the errors until execution time, and
then you're left wondering what caused the error.

2. Poor support for modular programming. You can break up a C program
into modules, but they're not truly independent of one another. A
slight change in one module can have catastrophic effects on other
modules. Once a project grows moderately large, you lose control of
your own code.


C++ is a little better in these two respects,


Actually, its worse.

And I don't buy compile time type safety.

Nor do I buy poor support for modular programming.

Its quite easy to write a *library* in C.

Much harder in C++ with its wacky linking rules and its inheritance derived hierarchical file dependencies.