<p>For some reason I never see this done.  Is there a reason why not?  For instance I like _blah for private variables, and at least in Windows Forms controls are by default private member variables, but I can't remember ever seeing them named that way.  In the case that I am creating/storing control objects in local variables within a member function, it is especially useful to have some visual distinction.</p>

[{'answer_id': 9436, 'author': 'Matt Hamilton', 'author_id': 615, 'author_profile': 'https://Stackoverflow.com/users/615', 'pm_score': 0, 'selected': False, 'text': "<p>I don't, but I appreciate your logic. I guess the reason most people don't is that underscores would look kind of ugly in the Properties window at design time. It'd also take up an extra character of horizontal space, which is at a premium in a docked window like that.</p>\n"}, {'answer_id': 9453, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 5, 'selected': True, 'text': '<p>This might be counter-intuitive for some, but we use the dreaded Hungarian notation for UI elements.</p>\n\n<p>The logic is simple: for any given data object you may have two or more controls associated with it. For example, you have a control that indicates a birth date on a text box, you will have:</p>\n\n<ul>\n<li>the text box</li>\n<li>a label indicating that the text box is for birth dates</li>\n<li>a calendar control that will allow you to select a date</li>\n</ul>\n\n<p>For that, I would have lblBirthDate for the label, txtBirthDate for the text box, and calBirthDate for the calendar control.</p>\n\n<p>I am interested in hearing how others do this, however. :)</p>\n'}, {'answer_id': 9456, 'author': 'Luke', 'author_id': 327, 'author_profile': 'https://Stackoverflow.com/users/327', 'pm_score': 2, 'selected': False, 'text': "<p>Hungarian notation or not, I'm more curious if people prepend m_ or _ or whatever they use for standard private member variables.  </p>\n"}, {'answer_id': 9465, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <p>Hungarian notation or not, I'm more\n  curious if people prepend m_ or _ or\n  whatever they use for standard private\n  member variables.</p>\n</blockquote>\n\n<p>Luke,</p>\n\n<p>I use _ prefix for my class library objects. I use Hungarian notation exclusively for the UI, for the reason I stated.</p>\n"}, {'answer_id': 9466, 'author': 'Orion Edwards', 'author_id': 234, 'author_profile': 'https://Stackoverflow.com/users/234', 'pm_score': -1, 'selected': False, 'text': "<p>I use m_ for member variables, but I'm increasingly becoming tempted to just using lowerCamelCase like I do for method parameters and local variables. Public stuff is in UpperCamelCase.</p>\n\n<p>This seems to be more or less accepted convention across the .NET community.</p>\n"}, {'answer_id': 9485, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 1, 'selected': False, 'text': '<p>I personally prefix private objects with _</p>\n\n<p>Form controls are always prefixed with the type, the <em>only</em> reason I do this is because of intellisense. With large forms it becomes easier to "get a labels value" by just typing <em>lbl</em> and selecting it from the list ^_^ It also follows the <a href="https://stackoverflow.com/questions/9433/do-you-name-controls-on-forms-using-the-same-convention-as-a-private-variable#9453">logic stated by Jon Limjap</a>.</p>\n\n<p>Although this does go again Microsofts .NET Coding Guidelines, check them out <a href="http://search.msdn.microsoft.com/Default.aspx?query=naming+guidelines&amp;brand=msdn&amp;locale=en-us&amp;refinement=" rel="nofollow noreferrer">here</a>.</p>\n'}, {'answer_id': 9512, 'author': 'Burton', 'author_id': 1493, 'author_profile': 'https://Stackoverflow.com/users/1493', 'pm_score': 1, 'selected': False, 'text': "<p>For me, the big win with the naming convention of prepending an underscore to private members has to do with Intellisense.  Since underscore precedes any letter in the alphabet, when I do a ctrl-space to bring up Intellisense, there are all of my _privateMembers, right at the top.</p>\n\n<p>Controls, though, are a different story, as far as naming goes.  I think that scope is assumed, and prepending a few letters to indicate type (txtMyGroovyTextbox, for example) makes more sense for the same reason; controls are grouped in Intellisense by type.</p>\n\n<p>But at work, it's VB all the way, and we do mPrivateMember.  I think the m might stand for module.</p>\n"}, {'answer_id': 9528, 'author': 'icco', 'author_id': 1063, 'author_profile': 'https://Stackoverflow.com/users/1063', 'pm_score': 0, 'selected': False, 'text': "<p>I never use underscores in my variable names. I've found that anything besides alpha (sometimes alphanumeric) characters is excessive unless demanded by the language.</p>\n"}, {'answer_id': 9596, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 0, 'selected': False, 'text': '<p>I\'m in the Uppercase/Lowercase camp ("title" is private, "Title" is public), mixed with the "hungarian" notation for UI Components (tbTextbox, lblLabel etc.), and I am happy that we do not have Visual Case-Insensitive-Basic developers in the team :-)</p>\n\n<p>I don\'t like the underscore because it looks kinda ugly, but I have to admit it has an advantage (or a disadvantage, depending on your point): In the debugger, all the private Variables will be on top due to the _ being on top of the alphabet. But then again, I prefer my private/public pair to be together, because that allows for easier debugging of getter/setter logic as you see the private and public property next to each other,</p>\n'}, {'answer_id': 9606, 'author': 'Zooba', 'author_id': 891, 'author_profile': 'https://Stackoverflow.com/users/891', 'pm_score': 1, 'selected': False, 'text': '<p>I came through VB and have held onto the control type prefix for controls. My private members use lower-camel case (firstLetterLowercase) while public members use Pascal/upper-camel case (FirstLetterUppercase).</p>\n\n<p>If there are too many identifiers/members/locals to have a 90% chance of remembering/guessing what it is called, more abstraction is probably necessary.</p>\n\n<p>I have never been convinced that a storage type prefix is useful and/or necessary. I do, however, make a strong habit of following the style of whatever code I am using.</p>\n'}, {'answer_id': 412333, 'author': 'Ali', 'author_id': 49153, 'author_profile': 'https://Stackoverflow.com/users/49153', 'pm_score': 0, 'selected': False, 'text': '<p>I write down the name of the database column they represent.</p>\n'}]
['https://Stackoverflow.com/questions/9433', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/327/']