Open scottdorman opened 10 years ago
That's my point, Jim. Differentiating only by case wouldn't work for languages like VB, which are case insensitive. The guidelines right now are very generic in nature and are .NET language agnostic. I can easily create more language specific variants.
The Framework Design Guideline says explicitly on naming private fields (emphasis mine):
The field-naming guidelines apply to static public and protected fields. Internal and private fields are not covered by guidelines, and public or protected instance fields are not allowed by the member design guidelines.
So no help by Microsoft :wink:
I always prefix my private fields with _
:
this.param = param
, see Jonas' comment above)@thoemmi: Distinguishing between local variables and class variables shouldn't be an issue. Local variables can't be prefixed with "this". As for "easier code in constructors", I prefer the this.param = param
syntax as it's completely unambiguous.
From Joe Healy (July 28, 2014 3:04 PM)
From Jonas Stawski (July 28, 2014 3:12 PM)
From Shayne Boyer (July 28, 2014 3:34 PM)
From Jonas Stawski (July 28, 2014 3:36 PM)
From Kevin Schaefer (July 28, 2014 3:40 PM)
From: Scott Dorman (July 28, 2014 4:49 PM)
From Jim Wooley (July 28, 2014 5:15 PM)