On the richness of C++
Edward Diener
eddielee_no_spam_here at tropicsoft.com
Mon Apr 14 13:32:55 PDT 2008
Bill Baxter wrote:
> Edward Diener wrote:
>
>> D has some really nice features but it really needs much better
>> language documentation to attract programmers, especially C++
>> programmers.
>
> Hah, I think the same thing every time I'm forced to try to use a boost
> library. :-) Like just today when I had to go look at Boost::MPL to
> see what it was all about.
That is a little unfair as you are comparing documentation about a
computer language library to documentation about a computer language
itself. While I think library documentation can often be better, I am
sure that computer language documentation shouold always be very good
just to attract people to that language.
When one is going head-to-head against the other good and popular
computer languages today, such as C++, C#, Java, Python etc., all of
which have many detailed books written just on the language itself, one
needs to have very good documentation which enables an intelligent
programmer to pick up the language easily. After 9 years of D the
documentation about the language remains extremely sparse.
>
>> In other words it seems as if D should be able to do some of the Boost
>> libraries, which makes C++ so pleasurable to use in general despite
>> the difficulty of dealing with C++ templates, fairly easily. At the
>> same time most of the Boost libraries are tremendously useful. I will
>> look in the Phobos library for their equivalents to see if D has some
>> of the same abilities in its library.
>
> The book with the misleading title is about Tango, actually.
OK. Hopefully it will about D enough for me to pick up the particulars
better than I have been able to do from the specification.
>
> Maybe you could tackle porting whatever you find useful about Boost::MPL
> to D as a first project? :-)
MPL is a template metaprogramming library which is beyond me in many
ways. I wouldn't try to port it to D unless it could be used to create
other libraries in D. But trying to port boost::function/boost::bind
might be an interesting project. I have already made the point to
Walter that since D has delegates and function pointers that they should
be merged into a single callable type, which is what boost::function is.
Boost::bind is simply a way of creating that callable type while
possibly binding arguments to values. Boost::lambda is very similar to
boost::bind with a lambda-like syntax.
>
> I'm sure many here would be happy to help.
> (And would also be interested to find out what people find useful about
> Boost::MPL -- my one experience trying to use Boost::lambda sent me
> screaming back to good old for loops.)
Really ? I always though using boost::lambda was pretty clear for the
main part, while some of its esoteric usages might be a bit strange. The
only problem with boost::lambda is that it takes a very conformant C++
compiler.
Unfortunately Digital Mars C++ is really not quite good enough to handle
many Boost libraries. I think Walter got a little tired of trying to
make Digital Mars C++ follow all of the C++ standard, especially as
regards templates and/or overloading, where the rules get very arcane,
so that may have been another impetus toward creating D where the rules
are simpler but perhaps just as effective.
In a way I can see why he created D, since C++ is so slow to move
forward to fix difficulties and inconsistencies in its syntax, and I am
very sympathetic to not having to argue tirelessly with some of the C++
standard committee members who are so locked into the past. Even
Stroustrup disappoints me with his argument about having to maintain
compatibility with C seemingly forever. C++ should have dropped that
necessity a long time ago and moved off on its own in order to make a
language that was just as rich but easier to use. Thus D is very
interesting to me because it has followed that path. I just need to
learn it much better and perhaps appreciate what it can do much better
before I take on any serious programming project with it.
More information about the Digitalmars-d
mailing list