[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ equivalent to spaghetti code

From: Tim Smith
Subject: Re: C++ equivalent to spaghetti code
Date: Fri, 18 Jul 2008 12:24:45 -0700
User-agent: MT-NewsWatcher/3.5.3b2 (PPC Mac OS X)

In article <>,
 Wolfgang Draxinger <> wrote:
> Well, I know only the comments Linus Torvalds made about the
> implications of using C++ to develop a kernel. And I totally
> agree with him in his statements. Programming a kernel you want
> to control every bit of the program (yes I know, that this
> sentence can be interpreted in many ways, and each way totaly
> matches what I mean).
> A languages like C++, that hides (some) vital aspects of the
> underlying mechanisms can break things at such a low level
> application. I'm thinking mainly about the way, polymorphism is
> implemented (there's no standard about that in current C++), how
> name mangling is performed (dito), calling conventions if
> objects are passed by reference (dito). Another problem is, that
> the use of some C++ features (I'm looking at templates here)
> will start a chain reaction in which code is created generically
> w/o having any influence on the exact outcome. This is not the
> same like using macros to create a similair effect; doing it
> with a macro one must exactly know what's going on.

I have yet to encounter a C++ compiler that will refuse to compile a 
program if it does not use polymorphism, passing objects by reference, 
and templates.  There is nothing forcing someone who writes a kernel in 
C++ to do those (possibly) questionable things.

--Tim Smith

reply via email to

[Prev in Thread] Current Thread [Next in Thread]