Rui Maciel said:
<quote>
My personal view is that C++ has its merits, and makes object-oriented
programming easier. However, it is a more complex language and is less
mature than C. The greatest danger with C++ is in fact its power. It seduces
the programmer, making it much easier to write bloatware. The kernel is a
critical piece of code, and must be lean and fast. We cannot afford bloat. I
think it is fair to say that it takes more skill to write efficient C++ code
than C code. Not every contributer to the linux kernel is an uber-guru, and
thus will not know the various tricks and traps for producing efficient C++
code.
</quote>
One of the most common misconceptions among advocate C hackers is that
programming in C somehow automatically makes your program more efficient
and have "less bloat" than, for example, when programming C++, which
requires more care to be as efficient and small. (And I'm discounting
here the bunch that believes that C++ *always* produces less efficient
and larger code than C.)
Linus Torvalds, in addition to that, also has this completely weird
notion that programming in C also automatically makes your code easier
to understand and maintain (while C++ is the exact opposite).
Of course practical examples tell a completely different story. There
are plenty of C programs out there that are absolutely horrendous,
inefficient, and almost completely impossible to maintain. And many of
these are not just some obscure one-man projects, but large and popular
ones. (For example much of mplayer was like this last time I checked.
Granted, this was many years ago, so it's theoretically possible that
they have done a complete refactoring of the entire code. I find it
unlikely, though.)
That's not to say that you cannot create horrendous programs in C++.
Of course you can. And probably over half of the C++ programs out there
are horrendous. OTOH, also probably over half of C programs out there
are likewise horrendous.
The difference is, however, that C++ offers you tools that C doesn't,
tools to make your code safer and easier to understand and maintain, while
still being as efficient as an equivalent C program would.