Bruno Haible <[EMAIL PROTECTED]> writes:

> A comment regarding the GCC-in-C++ idea. In slide 16 you merely answer
>
>   "C++ is too complicated!"
>
> with
>
>   "Maintainers will ensure that gcc continues to be maintainable."
>
> C++ has, for example, 12 different ways to represent or invoke a function.
> It has no buikt-in typesafe "enum"s. Sooner or later developers will think
> more about
>   "should this better be a member function or a static inline function?"
>   or "how do I make dynamic_cast work with my enum sets?"
> than about the algorithm they want to implement.
>
> How can maintainers ensure this does not happen?

The point is not to ensure that any particular language feature is not
used.  The language features are not arbitrary; they serve particular
programming techniques.  When those techniques are appropriate, the
language features will be appropriate.

It is possible to write obscure code code in C just as in C++.
Obviously the canonical gcc example of this is vec.h.  Although that
code is obscure, it presents a relatively simple interface.  Thus it
is possible for most compiler developers to use the vec.h routines
without understanding how they actually work.  (As it happens, vec.h
would be much much simpler in C++, but that is not the point I am
making here.)

What matters for gcc going forward is that it continue to be
comprehensible and maintainable.  That is a struggle that gcc has
faced for its entire existence as a free software project.  It is
certainly true that using C++ unwisely can make that struggle more
difficult.  But this issue is not qualitatively different from the
issues we face today.

Whether we use C or C++, we need to try to ensure that interfaces are
easy to understand, that the code is reasonably modular, that the
internal documentation corresponds to the code, that it is possible
for new developers to write new passes and to fix bugs.  Those are the
important issues for us to consider.  The C++ features which are not
present in C--features which are well documented in many books and
many web sites--are not an important issue.

I certainly grant that some programmers new to C++ have been known to
try to use all the advanced C++ features at once, whether or not they
are appropriate.  However, that is not a problem we are going to face
with our existing maintainers, who are all experienced programmers.

Ian

Reply via email to