byKey and byValue: properties or methods?

Jonathan M Davis jmdavisProg at gmx.com
Fri Jan 20 02:24:34 PST 2012


On Friday, January 20, 2012 11:01:10 Jens Mueller wrote:
> Jonathan M Davis wrote:
> > On Thursday, January 19, 2012 22:30:46 Jose Armando Garcia wrote:
> > > I think MSDN has some decent advice on when to use properties vs
> > > methods:
> > > http://msdn.microsoft.com/en-us/library/bzwdh01d(v=vs.71).aspx#cpcon
> > > propert yusageguidelinesanchor1
> > 
> > Those do seem like pretty good guidelines.
> 
> Then why not add these in a condensed form to
> http://www.dlang.org/dstyle.html?
> Convention may be a way to end these discussions.

Oh, it may be a good idea to add them (or something like them) to the style 
guide or elsewhere on the site, but it won't really end any discussions. Just 
like function names are subjective, whether something is a property or not is 
subjective. You can objectively narrow it down pretty thoroughly based on good 
naming rules (or good rules on what's a property), but in many cases, it still 
comes down to a subjective decision. So, there will always be debate. You 
can't get around that. At best, you can reduce it.

- Jonathan M Davis


More information about the Digitalmars-d mailing list