Do non-member functions improve encapsulation in D?
via Digitalmars-d
digitalmars-d at puremagic.com
Mon Apr 21 07:46:27 PDT 2014
On Monday, 21 April 2014 at 14:10:08 UTC, Steven Schveighoffer
wrote:
> You may recall that I am a big proponent of explicit properties
> because I think the ways of calling functions have strong
> implications to the reader, regardless of the functions. This
> is the same thing. I look at foo(x) much differently than
> x.foo().
I agree. What was the reasoning by conflating the two?
I only see disadvantages:
- harder to read
- reduced namespace
- possibility of breaking application code when adding members to
libraries?
More information about the Digitalmars-d
mailing list