Does D have too many features?

Alex Rønne Petersen xtzgzorex at gmail.com
Sun Apr 29 13:46:58 PDT 2012


On 29-04-2012 03:40, Jonathan M Davis wrote:
> On Sunday, April 29, 2012 03:06:53 bearophile wrote:
>>> * Increasingly, I don't like UFCS. I think that in most cases,
>>> it complicates
>>> code for little value. And I _really_ don't like how it results
>>> in people
>>> flipping chains of a(b(c(d(5)))) calls into something like
>>> d(5).c().b.().a(). I
>>> think that it makes the code way harder to read.
>>
>> For me it makes that kind of code way simpler to read...
>>
>>> The code is completely backwards.
>>
>> It means call d on 5, then call c on the result, then call b on
>> the result, and then call a on the result. It's better than
>> before :-)
>
> I know that you find easier to read. A number of people do. But it is just so
> backwards in comparison to how stuff normally works, that it hurts my brain.
> But I've done enough functional programming that I find something
> likea(b(c(d(5)))) to be completely straightforward, and for some reason not
> everyone does. And while I _never_ intend to use UFCS in this manner, I'm
> going to forever have to read the code of others who do, which I find to be a
> major negative.

I've done ML, F#, Erlang, Haskell, Lisp, and others, and I still don't 
like that style. It's the very reason F# has the pipelining operators 
like |> and <|.

>
> But regardless of my personal opinion on the matter, it's clear that enough
> people like UFCS that it's not going anywhere unless something seriously wrong
> is found with it which makes it untenable.
>
> - Jonathan M Davis


-- 
- Alex


More information about the Digitalmars-d mailing list