Re: linux headers and C++

Marco Ermini (mail@markoer.org)
Tue, 6 Jul 1999 21:06:20 +0100


----- Original Message -----
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Marco Ermini <mail@markoer.org>
Cc: <alan@lxorguk.ukuu.org.uk>; <linux-kernel@vger.rutgers.edu>
Sent: Tuesday, July 06, 1999 5:01 PM
Subject: Re: linux headers and C++

> > from "USB" and "modem". And the like with
> > USB soundcards, etc. Then you could
>
> Unfortunately planed earth doesn't work like that. USB sound is very
>different
> at the low level to conventional sound cards. At the higher level well gee
>we
> inherit the behaviour from the sound core and from the OSS layer if we
>want.

In fact, this is exactly what I meant.

> Linux is text book good OO. There is little multiple inheritance, there is
> very clean modularity. At the same time you don't need a VRML 3D class
> browsers to view the class structure.
>
> People with strange naive ideas that somehow C++ gives you instant USB
>need
> to write more low level code. Unfortunately many people who write text
>books
> write the books before they do that, or because they can't.

In fact, again, this is exactly what I meant.
Maybe language boundaries, and/or my poor
english, don't make you understand exactly
what I wanted to say, but I tried to keep clearly
(I hope this was clear, maybe it wasn't) that
I used this USB example as a paradox. I wrote
drivers, although mainly not for Linux, and I
know they don't appear automagically. Last
year I took one week of vacancy to learn
Linux drivers programming with the Rubini's
book, and I applyed and patched Inaki's
USB drivers to my RedHat 5.0, getting
keyboard and mouse to work. I'm not
an expert but not a total novice too, but
I saw other development models (WinNT
and BeOS drivers). Do you?

> > suited than C (how could you do multiple
> > inheritance in C, without writing very
> > unreadable code?), but you know, you
>
> Function arrays. BTW Multiple inheritance is seen as a terrible evil sin
> by OO purists, because your programs just turn to crud once you start
> abusing it

The program just become what you
turn it to be. Every language you are
using. This is what I understood you
were saying, and this is what I agreed.
And nothing more. No religion on what
is the "best language in any case". I feel C
is best for Linux because Linux was born
as it was, and the state of the art of Linux
needs C. In the specific example, I think that
using function arrays leads to more
complicated and less extensible,
readable and maintenanceable code than
multiple inheritance. If you abuse of multiple
inheritance it's another topic, you are just
a poor OO programmer and you are better
using C. And this don't just come from a
book, but from my personal experience.
I never wrote an OS as I said, so my opinion
may be less worth than another one's.

As I say, OO programming needs much
more planning of pure C, and the Linux
kernel development method is not suited
to OO planning.

Cheers

Marco

-
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/