Re: Linux kernel modules development in C++

From: Igmar Palsenberg (maillist@chello.nl)
Date: Fri Sep 29 2000 - 06:44:46 EST


> > - C++ gives overhead. With something like a kernel that's unwanted.
>
> You pay for what you use, no less no more. C++ compilers don't generate
> bloated code `per se' but, yes, it's easier to make mistakes that degenerate
> into bloatedness.

Agree. I never said that C++ was bad. I just use the language that I think
is best suited for the job. I usually end up with C, sometimes C++.

> > - Things like exception handling is hard to do in a kernel.
>
> You don't need it. And if you don't use it you don't pay for it.

You don't. Someone else might think he does need it and screws things
up. The kernel is already full of compiler-specific stuff.

> > - The're a lot more people that know C than C++
>
> Let's put it the other way... there aren't many people who know
> C++ around. Well, there are less people who understand the kernel. Then,
> maybe, to make it more accessible, we should dumb it down.
>
> > And I probably forgot a few :)
>
> Sure :)
>
> Someone mentioned they preferred C because they knew exactly what the
> compiler would be generating. I wonder if they got this knowledge in some
> magic way, and what makes them think that they couldn't learn what C++
> compilers do (at least G++)

C is more asm alike (read : lowlevel) then C++. That's a fact. That fact
can be used to verify what asm the compiler generates, and if it is
correct.

Since I'm not interested in what code it actually generated I don't
care. Some people do.

> Of course, yes, I do agree that if the kernel is in C and putting in C++
> requires more than some little localized glue or similar, C++ shouldn't go
> in.
>
> But I'll never understand this C++ aversion.

I'm only saying that C++ in the kernel is bad. Not that C++ is bad,
because it isn't.

        Igmar

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



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:24 EST