Discussion on:

Message 45 of 66
0 Votes
+ -
Re. C++ vs. C
What you say about C++ vs. C in the OS community I think makes sense. I got a taste for how complex C++ can get with its use of objects over 10 years ago. While I could handle it for the most part, I said to myself, "This is insane," mostly because of templates. The only thing that made it somewhat reasonable was the use of design patterns, though quite a bit of the code I worked on was "C code using an object framework," since most of the programmers working with it only understood how to design in C, but we used commercial APIs, which had some minimal "object-ness" about them.

I remember what Alan Kay said about C++. He's softened his stance towards it. He used to say, "When I coined the phrase 'object-oriented' C++ isn't what I had in mind." More recently he said he realized that C++ was a macro language in the sense that you should define your own programming system out of it with macros, "or else it would kill you." He said the problem is most C++ programmers don't understand this.

C has a nicer language design than C++, once you realize what it's doing, and get a sense of what its intended purpose is (though perhaps C++ is the same way), though some C++ features are "nice to have" even in C code. Runtime type checking (though I don't remember if this extends to native types), references/aliases, and operator overloading are a few examples I can think of. Has anyone thought of using C++ without objects (ie. just staying "in the mode of C" and not interacting with objects)? It seems like that might be a nice experience.
Posted by Mark Miller
Updated - 20th May 2012