Blocking points for further D adoption
David via Digitalmars-d
digitalmars-d at puremagic.com
Sun Jun 5 07:35:05 PDT 2016
On Sunday, 5 June 2016 at 14:20:36 UTC, Vladimir Panteleev wrote:
> On Sunday, 5 June 2016 at 12:58:56 UTC, David wrote:
>> D doesn't offer a lot of return on investment for learning it,
>
> That sort of sets the tone for the rest of your post, doesn't
> it...
Maybe. I mean no offense. I just happened to have some
frustrations getting started with actually coding in D (not
setting it up) and saw this post. So I voiced my frustrations. I
really am not meaning to sound confrontational if that is what
you meant by your comment. I obviously found some potential value
otherwise I wouldn't have bothered.
>> ^^^ How is that helpful?
>
> Replied to this on GitHub:
> https://github.com/dlang/phobos/pull/4397#issuecomment-223813719
>
>> The other beef I see, is that examples for functions seem like
>> they are just ripped from random unittests and frequently
>> reference other standard library calls without context of what
>> they are doing.
>
> Yes, many examples are actually unit tests, to verify that the
> displayed examples actually work. Most examples are written in
> the style that the result of the documented function is
> `assert`ed or `enforce`d to be correct, which may be unusual at
> first. The chomp call does seem unnecessary in that example,
> though.
To be honest, I was just looking to read a text file.
string source = readText("file.txt");
...seems like the obvious example to show as it is simple, shows
a common use for the function call and it's using a primitive of
the language. And make no mistake about it, it's a good solution.
I was pleased by the actually D solution. It's just a shame I had
to filter out noise in the documentation to get to see it.
It sounds small, but the delay does propagate over time. The code
that took me 3 hours to figure out in D (not just that little
blerp above) I reproduced in Python in like 20 minutes by just
googling.
More information about the Digitalmars-d
mailing list