Idiomatic D?
Jonathan M Davis
jmdavisProg at gmx.com
Mon Jun 18 10:27:59 PDT 2012
On Monday, June 18, 2012 18:20:58 Matt Diesel wrote:
> Today I learnt D. I have a lot of experience with other
> languages, but I think D fills a gap. So far I've really liked
> it, having used C# and C a lot it feels right. I'm also pretty
> excited about some of the more powerful features.
>
> I can teach myself a language no problem, but to make it useful
> it's always better to write it the way it was meant to be written.
>
> Firstly, is there any good resource on what idiomatic D usage is?
> For instance Go has a huge page called Effective Go which tells
> you how you should use features, rather than what they are.
>
> And secondly, I would be grateful if anyone could take a look at
> this very simple program and comment on how I'm using the
> language (ignoring the fact it's really simple and the lexer is
> rubbish). Just stuff like interface, class and variable naming
> and program structure.
I haven't looked at your code at all, but probably the biggest concept that's
used heavily in D (especially by the standard library) which is likely new to
you is ranges (which are used rather than iterators). We need better
documentation and articles about them in general, but probably the best
tutorial currently available is this:
http://ddili.org/ders/d.en/ranges.html
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list