Does D have too many features?

Jonathan M Davis jmdavisProg at gmx.com
Sat Apr 28 18:40:36 PDT 2012


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.

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


More information about the Digitalmars-d mailing list