Re: linux headers and C++

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 6 Jul 1999 13:40:53 +0100 (BST)


> Apart from this C++ is no more just a
> pre-processor. Of course a C and ASM
> hacker could feel in this way, but it's not
> true; C++ could be used as an improved-C
> or as a full-featured OO-language. Using

C++ is a preprocessor, nothing more. Check how the original C++ compiler was
implemented.

> C or ASM or another language in an OO
> way without a specific support for this could
> lead to more complications that it's worth (i.e.
> you could program as you have inheritance
> without having a keyword to do it, but it's
> very difficoult to keep the code clean).

Have a look at all the operation arrays on objects in Linux. Inodes are also
virtual classes and all the other buzzwords.

> results. Linux could be not OO, but the
> sources are (quite) always clean and
> understandable.

I guess it depends what you think of as object oriented. Linux has a very
clear set of abstractions to objects - inodes, files, sk_buffs. I regularly
merge several hundred K of changes with Linus and the kernel is very very
modular in the abstract sense - the number of overlapping changes is almost
nil.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/