DIP23 Counter Proposal

Jonathan M Davis jmdavisProg at gmx.com
Thu Feb 7 21:48:33 PST 2013


On Thursday, February 07, 2013 23:15:14 Dan wrote:
> On Thursday, 7 February 2013 at 21:55:12 UTC, Jonathan M Davis
> 
> wrote:
> > Except that mixins are generally unacceptable in APIs, because
> > they don't end
> > up in the documentation. That means that this works only if you
> > don't care
> > about documentation. So, it's almost useless. Putting @property
> > on there also
> > looks better but isn't that big a deal. However, the lack of
> > documentation
> > _is_ a big deal.
> 
> Again, why would you need to @property for the case of a
> read/write pattern.
> Just make it public:
> 
> struct S {
>    // Best int ever
>    int i;
> },

But if you do that, then code that uses S can do stuff like take the address of 
i or pass it by ref. That code will then break when you turn it into property 
functions later. That's unacceptable, meaning that in almost all cases, people 
just create getters and setters which do almost nothing. It's boilerplate that 
we shouldn't need.

- Jonathan M Davis


More information about the Digitalmars-d mailing list