Re: C++ in kernel (was Re: exception in a device driver)

Stephen Williams (steve@icarus.com)
Thu, 14 Jan 1999 13:07:16 -0800


tytso@mit.edu said:
> On the one hand, C++ advocates keep saying that "the compiler will
> make things easy, because then we won't have to think about it". Yet
> when folks argue about performance, the argument is "you just have to
> know what the compiler is doing". This often means not just being an
> expert C++ programmer who can second guess the compiler, but searching
> through hundreds of C++ header files to see exactly how the classes
> were implemented!

The C++ freestanding standard is considerably better. I use C++ for my
embedded work, and I'm happy with it. But then again, I don't work with
a bunch of C++ Space Cadets who think that every language feature must be
used twice in each program before it can be considered complete. I agree
that poor C++ code is horrifying.

80% of the C++ standard can and should be ignored.

That is NOT to say I think the Linux kernel should be rewritten in C++:-O

It does make sense to get rid of some of the more blatant cases of
C++ incompatibility, i.e. stay away from C++ keywords. That's just a good
habit whenever writing C code.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

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