observation: D getting a bit complex

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 30 06:00:52 PDT 2015


On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
> The following reminds me of the good old C++ template errors 
> the C++ compiler spits out.
>
> Whilst D has fixed that problem, some things have gotten more 
> complex. I just wanted to find a replacement for D1 path join, 
> and found this, but it doesn't seem very easy to wade though 
> this stuff.
>
>
> immutable(ElementEncodingType!(ElementType!Range))[] 
> buildPath(Range)(Range segments) if (isInputRange!Range && 
> isSomeString!(ElementType!Range));
> pure nothrow @safe immutable(C)[] buildPath(C)(const(C)[][] 
> paths...) if (isSomeChar!C);
>
> http://dlang.org/phobos/std_path.html
>
> It would take me a lot of time to appeciate what that all 
> means, although I can imagine what it is for.
>
> ...just and observation. The complexity is building.

With C++ I rarely have trouble finding a good explanation, it's 
just a really complex language that doesn't get easier when you 
use it. For D, the documentation is a work in progress, 
amplifying the learning curve for the things that make life 
easier for experienced programmers.

The official documentation is going to have to take a better 
approach when dealing with ranges and generic programming because 
the current approach doesn't work at all.


More information about the Digitalmars-d-learn mailing list