Just where has this language gone wrong?

Timon Gehr timon.gehr at gmx.ch
Thu Jul 19 08:31:29 PDT 2012


On 07/19/2012 05:20 PM, Brad Anderson wrote:
> On Thu, Jul 19, 2012 at 9:03 AM, Petr Janda <janda.petr at gmail.com
> <mailto:janda.petr at gmail.com>> wrote:
>
>         It's just syntax. Eliminating syntax noise is fine. Code should look
>         like what it does.
>
>
>     Not if "eliminating noise" equals to making things harder to understand.
>
>     When you say (int x) { return x; } it's clear about what it is, a
>     _function_ without name.
>
>
> Nothing is stopping someone from being explicit with their types like
> that, of course.
>
> Here is the original code written in a way that is probably more
> familiar to you:
>
> auto r = map!((int x) { to!(string)(x); })(uniq(sort([5, 3, 5, 6, 8])));
                          ^
                        return
>
> Personally I find the original version to be much more readable but that
> does require a basic knowledge of D's syntax. People coming from other
> languages are free to use the more classic way if they wish.  It's
> better to learn idiomatic usage of a language, though, instead of
> forcing it to be a language you are more comfortable in.
>
> Regards,
> Brad Anderson



More information about the Digitalmars-d mailing list