Hello .NET, D Here Calling

Lutger lutger.blijdestijn at gmail.com
Tue Dec 23 09:39:09 PST 2008


Daniel de Kok wrote:

> With no intention to flame, but I never quite understood why people are
> so keen on properties over getter/setter member functions. What
> advantage does it have over obscuring direct member access and indirect
> member access?

This 'obscuring' is exactly what makes properties a bit more attractive. There are a lots of extra little niceties, but I forgot them all (after a two day course on .NET :) ).
But, in the end, properties *are* getter/setter pairs.
 
> I think that the D approach is good enough, since it does not add
> complexity for library designers.
> 
> -- Daniel

The D approach is a little more pleasant to write imho, but it's not good enough. You can't write 'foo.bar += n' if bar is a property in D and make that work. Imho, if you can't do that, it doesn't behave like a property, it isn't really a property.




More information about the Digitalmars-d mailing list