Does D have too many features?

Francois Chabot francois.chabot.dev at gmail.com
Sat Apr 28 19:32:35 PDT 2012


> - properties - another incredibly convenient feature. I think a 
> more sexy implementation of properties are in order, but the 
> construct is great. It would be nice to have properties as a 
> language type, rather than a attribute:

To me, properties are much more than a convenience. The important 
part of it comes from its existence, not its usage. Quite simply, 
having properties mean that using public member variables does 
not break encapsulation (as long as having them part of the 
public interface is intentional).

Without properties, you MUST write accessors for all of them on 
the off chance that you might want to refactor/delegate them in 
the future. This adds a huge amount of boilerplate code that ends 
up wasted time 98% of the time.

In short, properties existing, even if not used, end up improving 
both my efficiency and the legibility of my code.


More information about the Digitalmars-d mailing list