Is D more cryptic than C++?
deadalnix
deadalnix at gmail.com
Thu Dec 1 02:50:05 PST 2011
Le 01/12/2011 05:32, Abrahm a écrit :
> "Jesse Phillips"<jessekphillips+d at gmail.com> wrote in message
> news:jb6qfv$1kut$1 at digitalmars.com...
>> What bearophile was referring to was the use of templates is common.
>
> Are you sure about that? What say you Bear?
>
>> D's
>> templates have the advantage of being easier on the eyes and more
>> powerful (with the inclusion of 'static if' in the language).
>
> Having "come from" C++land, and knowing what some people do with it,
> making it EASIER to apply templates does not seem necessarily a good
> thing to me. (Ref: template metaprogramming). That said, does your
> statement above about D's template machinery being "powerful" etc., mean
> "it's easier to do template metaprogramming in D"? If so, I, personally,
> do not find that any asset at all (though I know some surely will, for
> there have been books written on that "abhorrence").
>
It means basically that many things are easier to do, AND, many thing
that cannot be done in C++ metaprogramming can be done in D.
Your assertion about metaprogramming isn't quite true IMO. Template are
a good thing and are usually overcomplicating stuff is C++. But the
source of this complication is more C++ language itself than what
metaprogramming is about. Making it easier to use IS a good thing.
Consider what auto, static if and compile time reflection can do for you
when it comes to metaprogramming. This is amazing.
More information about the Digitalmars-d
mailing list