Code Style

Clay Smith clayasaurus at gmail.com
Fri Jun 15 13:41:50 PDT 2007


Alexander Panek wrote:
> Clay Smith wrote:
>> [...]
>> Oh, and I use this too: 
>> http://www.dsource.org/projects/arclib/wiki/CodingStyle
> 
> What exactly does following rule mean?
> 
>  > use get/set accessors, not the property syntax
> 
> So basically one should use setProperty/getProperty instead of an 
> overloaded property method? This is so un-D-ish, IMHO.
> 
> Kind regards,
> Alex

It's more explicit for the user, to prevent bugs like

glGenTextures(1, &tex.ID)

with property syntax, you don't know if ID is a getter (crash program), 
setter (compiler error), or a variable by itself.





More information about the Digitalmars-d mailing list