Re: OON: c++ deficient

From: Theodore Papadopoulo (Theodore.Papadopoulo@sophia.inria.fr)
Date: Fri Apr 07 2000 - 13:32:53 EST


> I personally feel that these new techniques are elegant (from the user
> interface standpoint) and worth study. However, I also feel, from my own
> experience, that these methods are experimental and should not be used for
> large, important projects at this time. Just the compilation time for the
> templates is enough to make me shy away from them. Also, non-C++ masters
> have to be able to maintain my code after I finish my degree so I can't
> get too complicated.

        Well, while I agree with the elegance part, I disagree
slightly with the remaining part of this paragraph....

First, I think that we are seeing a all new way of thinking and
designing the programs (I personally think that the most important
feature in C++ IS templates). While such mechnism exists in other
langages, C++ is maybe the first very broad langage to support
generic programming. For myself, I have seen too many people claiming
that "this algorithm is optimal (or O(something)) with the use of
such and such structure)" with the optimal version never implemented
because it was not worth for each specific case. On the contrary,
since STL is existing many people are using red-black trees (or another
``optimal''data structure without even knowing exactly what the
structure is).

Generic programming is difficult yes, but even for the smallest
project, injecting genericity is worth in terms of maintenance of the
code.

Now, I completely agree on the fact that the current compiler are
slow, but whatever is the slowness of these compilers, using
genericity is many times better than:

        1) doing it by hand (ie copy and paste the code and adapt it).
        2) maintaining multiple copies of mostly identical routines...

Agreed, things like template metaprogramming are somewhat difficult
to grab at first sight all the more that these are new techniques and
that compilers are not yet completely up to date. But I bet that this
will be smoothed in the future as the compilers will be more mature
(and the computer faster :-) ) and that people will get more
experience on this type of programming.

        Theo.

--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Mon Apr 10 2000 - 12:47:56 EST