writeln, UFCS and flip

bearophile bearophileHUGS at lycos.com
Fri Apr 26 14:59:55 PDT 2013


Tyro[17]:

> With that clarification, I just have one more question, since 
> flip does what is intuitively implied by a reverse function

OK, better to name it reversedArgs :-)


> and flip2 does what is intuitively implied by a flip function,

flip2 swaps just the fist two arguments and leaves the others at 
their place.


> I would expect a flip and flip2 if both accomplish the exact 
> same thing but both outperforms the other in certain scenarios 
> thus warranting both to be present.

I think that the caos of this thread shows that keeping both will 
cause confusion :-(


> why not name them as such? Understand the Haskell influence and 
> all but, influence notwithstanding, this is D so why not 
> designate functions in a manner that intuitively imply 
> functionality?

I am starting to agree with Andrei. Short function names are 
handy, but in many situations the semantic confusion they can 
bring is not worth it. More food for thought for me.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list