Required Reading: "How Non-Member Functions Improve Encapsulation"

Dave Jones dave at jones.com
Tue Oct 31 09:40:04 UTC 2017


On Tuesday, 31 October 2017 at 01:44:58 UTC, codephantom wrote:
> On Monday, 30 October 2017 at 23:03:12 UTC, H. S. Teoh wrote:
>>
>> But in D, UFCS allows obj.func() to work for both member 
>> functions and free functions, so if the client code uses the 
>> obj.func() syntax, it won't have to care about the difference.
>>
>
> I don't like it.
>
> When I see obj.func(), to me, func() is a member function. Why 
> should I spend any time trying to work out whether it's a 
> member function or a free function? It doesn't make sense to me.

You dont need to know how its implemented. There's no benefit to 
knowing. It's a waste of time / distraction to even think about 
it.




More information about the Digitalmars-d mailing list