Re: C++ equivalent to spaghetti code
On Jul 18, 9:27 am, Michael DOUBEZ <michael.dou...@free.fr> wrote:
Wolfgang Draxinger a =E9crit :
fnegroni wrote:
Polymorphism is only one aspect and one you can easily avoid
especially for something as simple as a driver.
Actually, drivers are, by their very nature, polymorphic, and if
you don't use an abstract base class and derive from it, you
have to implement by hand what the compiler does.
[...]
IMHO C++ was once a fine language, but it took some problematic
turns.
When was it, before the standard (CFront) ?
Back in the good ole days (which, of course, weren't so good
when we were actually living them).
For the rest, of course, there are places in an OS kernel where
you would want to restrict the use of certain C++ features---an
exception which tries to propagate back through your context
switch routine isn't likely to work very well. But off hand,
exceptions are about the only C++ feature I see which would
cause problems (and then only in specific contexts---which
represent less than 10% of the OS). And C++ gives you a lot
more safety than C, even when used as a "better C". I can see a
lot of OS's sticking with C because that's what they were
originally written in, and they're not undergoing active enough
evolution to warrent porting to C++, but other than that, it
would be foolish and irresponsible not to take advantages of the
extra safety C++ provides.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34