-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 23 February 2004 04:22 am, Ivan Sergio Borgonovo wrote:
On Mon, 23 Feb 2004 09:02:53 -0000
"Carl Peto"
wrote: Does anyone know if there are good technical reasons why C was used to program the Linux kernel rather than C++ or one of the more modern OO languages? Surely the reuse inherent in OO would improve
I think the main reason was that at that time gcc C++ was not production ready... or C++ as a whole was not production ready.
Why do you speak in the past tense? ;-) Sorry. I'm just a bit disappointed with a few aspects of C++. No doubt it represents a very significant advance in many ways. There are, however, a few places where the design was seriously encumbered by what I believe to have been unnecessary concerns about C compatability. There are a few (many) places where Stroustrup seems to be a bit frustrated with the restrictions placed on C++ by the 'C compatability extremists'. There are also, IMO, too many 'conveniences' built in. That is, slick ways of accomplishing things that really aren't that difficult to accomplish in more pedestrian ways. I'm not that experienced with the language, but I have the sense that some of these features may actually increase the amount of work expended in a the lifecycle of a project. If every moderately experienced programmer is sent flipping through the pages of his favorite C++ book to understand some arcane expression, the intended convenience is lost. I find the division of header and implementation to cause programs to be hard to follow. One feature I would like to seen in KDevelop (I believe I actually submitted this as a wishlist item) is the ability to view both the implementation and header in the same frame. I wish more C++ programmers understood the advantages that some Java features and practices provide. It may simply be my lack of experience, but for me, locating comperable information in a C++ development environment is more difficult and time consumming than in a similar Java environment. As I've suggested, some of that is simply practice. The same types of things can be accomplished with C++. It's just not part of the culture. I was wondering if a new version of C++ could be introduced which would address some of it's shortcomings. An example of the kind of thing that bothers me about C++ is discussed on page 244 of Stroustrup's TC++PL 3rd Ed, SE. "The reason for the dissimilar treatment of classes and built-in types are C compatibility and fear of run-time overhead." I read that as: 'If I had my way, it wouldn't be so fubar'.
Anyway if you google it I bet you'll find some official answer... the FAQ of linux-kernel mailing list has some http://www.tux.org/lkml/#s15-3
"Should the kernel use object-oriented programming techniques? Actually, it already does. The VFS (Virtual Filesystem Switch) is a prime example of object-oriented programming techniques. There are objects with public and private data, methods and inheritance. This just happens to be written in C. Another example of object-oriented programming is Xt (the X Intrinsics Toolkit), also written in C. What's important about object-oriented programming is the techniques, not the languages used. " This is an important point. You *can*, and people *do* write OO code in C. You *can* and people *do* write non-OO code in C++. I am of the opinion that C++ is not an 'object oriented' programming language. It is an 'object inclined' programming language. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFAOeliH2SF0i7rrGwRAq6nAJ9SYNfEH5FIW7YWuMBKZcmE/asTowCghEgg Xbbrqb/eCheYz+gAvFbu8UA= =imiK -----END PGP SIGNATURE-----