nullify wrote:
And you confirm that C++ has a bigger memory overhead than C later on.
If you use one of the features that implies such overhead, yes. Those are features that C doesn't have. The question is, would you be able to create the same
semantics, in C, without using up at least as much space?
Take exceptions. Yes, they take up memory. But, if you don't have exceptions, and handle error conditions the C way, would the additional error handling code (checking ERRNO upon return, setjmp / longjmp etc.)
really be smaller?
As for the speed issue, I'll post an example later today.
BCPL is the ancestor of C. It was superseded because C was considered more practical. Now, I don't say that C++ could or should supersede C, but it
is an advancement.
What was said about the C++ committee... Yes, they extended the standard over time, as new issues arose. At times, that required adding another keyword, making some identifiers illegal. So what? We are talking about one global search & replace here! BTW, C99 isn't fully compatible to K&R C, either...
Then, the fragile base class problem... that is an issue for C++
interfaces, i.e. when you
export a C++ API through syscalls. That's a whole different decision from writing a kernel in C++. I'm not even sure if that problem still persists now that the standard C++ ABI is around. (Hadn't had the time to check this yet.)
Then, the aesthetics... well, that's personal preference, and certainly not a technical reason one way or another.
Portability... well, really fine C++ code
is more portable than C code, in the sense of modularity. But that would be going too far. But one other reason to use C over Assembler is readability, maintainability, abstraction. And especially on the abstraction level C++ beats C hands-down.
But this is, basically, bickering.
You say that, if someone can't live
without C++, he should go for it. I say that, if some
can do C++, he should go for it. That's probably because I can do, and you can do without, but in the end, we basically agree.