--- nbecker@fred.net wrote:
> I'll have to say that I disagree. I find myself in
> the position that
> I know what concept I want to express, but don't
> know how to express
> it in c++. OTOH, I see what others have done to
> express similar
> concepts, and find the logic twisted far beyond any
> recognition. I
> repeat that I have been using c++ for many years. I
> don't believe it
> is a good thing that only a tiny elite set of gurus
> should be able to
> write or understand the code. I'm sure it's not a
> good thing that
> certain concepts are only expressible through some
> sort of bizarre
> twisted logic.
>
When templates were introduced to C++, they were
intended to do a fairly simple and easily understood
task. Stroustrup wrote a simple little C_Array
container as an example of what could be done with
templates. Stepanov showed up with the STL and blew
the socks off the commitee. So much so that they
delayed finalizing the language. Along the way there
were additions to templates that I still can't use
because I'm stuck with an inferior (Microsoft)
compiler.
One could argue that C++ is not truely object oriented
because only a tiny elite set write good object
oriented code, and object oriented has been around in
the mainstream longer than generic programming. I'd
like to qualify my previous statement. I've worked on
a number of large C++ development projects and I can
count on one hand the number of good object oriented
programmers with plenty of room left for more. Those
people are also good at generic programming and have
written some very cool articles in C++ Reports and
User Journal on the subject. The vast majority of the
programmers don't know about decoupling code or why
you would want to, factoring, promotion and demotion
of data, soft and hard coupling, or how to design
frameworks. Most of the features of C++ are degrated
to C with classes status with an obssesive reliance on
inheritance.
Templates in C++ has opened a whole new frontier of
programming and I believe is the most exciting thing
to happen since the 60's. There are no good books, and
very few gurus, and the most widely used piece of
generic programming is the STL, a culmination of years
of trial and error and refinement. Expression
templates and binders and view iterators, etc are all
very complicated examples of generic programming, yet
that is the code programmers look at to try and
understand templates. It's no wonder there are so many
blank expressions and little gobs of drool in the
corners of so many mouths. It's a testament to the
programmers who do know how to write generic code that
one does not need to know it in order to use it.
A final thought on this is that in generic programming
the code is there for all to see. I wonder how we
would think about the math library if we had access to
the code? For this reason, I would like to see a
library of template code that has easily understood
headers and a pre compile object that the compiler
understands but is not read by the user. Not that I
want to keep my code a secret, but I would like to
present the end user with only the data they need to
understand. In line functions should also be included.
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
--------------------- 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