Yes, I do that as well, hence why I said depending on the project, and by that I mean, depending on the people involved. Sometimes I also make the constructor variable without underscore and the private variables with.
public class Person
{
private string _name;
public Person(string name)
{
_name = name;
}
}
From Kevin Schaefer (July 28, 2014 3:40 PM)
Last I saw, privates should still start with _
, but not m_
.
From: Scott Dorman (July 28, 2014 4:49 PM)
Guidelines right now are culled from the Framework Design Guidelines, which don't explicitly call out using m_
for class level variables. It does mention s_
and g_
for static/global variables. There is also a guideline about not starting any identifier with just an _
. I can add something about not using m_
to the guidelines...or someone can file a bug and/or pull-request to add it. :)
From Jim Wooley (July 28, 2014 5:15 PM)
Coming from the VB world I still use underscore to I'd module level fields as distinct from public properties since you can't differentiate only on case in VB (which is prohibited in the CLI guidelines.) It also helps to avoid the common mistake of this:
string foo;
public Bar(string foo)
{
foo = foo;
}
When guidelines are summarized or adapted from another source, the attribution link should be more noticeable that it is a link.
(Summarized from a blog comment.)
Recommend Projects
-
-
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
An Open Source Machine Learning Framework for Everyone
-
The Web framework for perfectionists with deadlines.
-
A PHP framework for web artisans
-
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
Some thing interesting about web. New door for the world.
-
A server is a program made to process requests and deliver data to clients.
-
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Some thing interesting about visualization, use data art
-
Some thing interesting about game, make everyone happy.
-
Recommend Org
-
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Open source projects and samples from Microsoft.
-
Google ❤️ Open Source for everyone.
-
Alibaba Open Source for everyone
-
Data-Driven Documents codes.
-
China tencent open source team.
-