Poll: do you use @property semantics?
Quirin Schroll
qs.il.paperinik at gmail.com
Fri Sep 16 16:08:40 UTC 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole
wrote:
> Recently Walter has been wanting to remove language features
> that don't need to be kept to simplify the language.
>
> It seems everybody agrees that binary literals are not a worthy
> candidate for removal, but one thing that I kept thinking about
> was @property. As far as I know, hardly anyone actually uses
> its semantic behaviors, and the ones that it does have which
> are incomplete are special cases that don't benefit us all that
> much.
>
> I was going to post this yesterday, but it turns out I am not
> alone in thinking this can be removed safely (can be swapped to
> a UDA to prevent code breakage without any language additions).
>
> So, who uses @property semantics?
>
> https://dlang.org/spec/function.html#property-functions
I don’t. Dump it. Replicate VB.NET’s success story with their
notion property. Why do I write VB.NET and not C#? Because in VB,
properties can have parameters; effectively you hook the
`obj.propName(args)` and `obj.propName(args) = value` expressions.
Also, because it fits a little, add `opCallAssign` and friends to
D akin to `opIndexAssign`.
More information about the Digitalmars-d
mailing list