473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Which c# naming convention?

Hi,

I found these suggestions from Woody Pewitt on the net. Do you agree this is
a best practice?

Rick

BEGIN

- Hungarian notation is out!
- For public interfaces, use PascalCasing
- For private members, use camelCasing
- Use underscore "_" character to denote private class members
- Use camelCasing for all method parameters
public class Customer
{
private string _password;

public void SetPassword(string newPassword)
{
_password = newPassword;
}
}
END
Nov 18 '05 #1
1 1227
This link on MSDN has a bunch of guidelines, including coding/naming
guidelines from Microsoft.

http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpconnetframeworkdesignguidelines.asp

--
- Paul Glavich
"Rick" <no@spam.com> wrote in message
news:#g**************@TK2MSFTNGP10.phx.gbl...
Hi,

I found these suggestions from Woody Pewitt on the net. Do you agree this is a best practice?

Rick

BEGIN

- Hungarian notation is out!
- For public interfaces, use PascalCasing
- For private members, use camelCasing
- Use underscore "_" character to denote private class members
- Use camelCasing for all method parameters
public class Customer
{
private string _password;

public void SetPassword(string newPassword)
{
_password = newPassword;
}
}
END

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Sandeep Sharma | last post by:
For many years I have been following the convention of naming all class attributes with a leading underscore. This enables me to quickly identify the class attributes when I encounter them in the...
27
by: Derek | last post by:
The company where I work uses a naming convention that I have never used before. They use mixed-case letters for public member functions, but lower-case with underscores for the rest, like this:...
5
by: Marco Solchio | last post by:
I'm coming from C++ world, where I've been using #define SALSA 1 and #define SALSA_DANCE "Salsa Dance" in a header file to define my constants..., all uppercase and underscores. Does the...
48
by: Robert Jacobson | last post by:
Hello all, If I have a class called "Foo," is there a preferred naming convention for iterating through each Foo instance in a collection of Foos? I've seen several different variations, even...
10
by: jjkboswell | last post by:
I'm trying to pin down a good naming convention for the 3 things required to implement an event. You need: 1) a delegate 2) an event 3) an event handler Below is my understanding of a...
6
by: dm1608 | last post by:
I'm relatively new to ASP.NET 2.0 and am struggling with trying to find the best naming convention for the BAL and DAL objects within my database. Does anyone have any recommendations or best...
3
by: rsine | last post by:
I have searched around a little and have yet to find a naming convention for the string builder object. I really do not want to use "str" since this is for string objects and thus could be...
114
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
14
by: Ronald S. Cook | last post by:
I've been weaning myself off of Hungarian notation because that's what Microsoft is telling me to do, and I want to be a good little MS developer. But things keep coming up that make me miss my...
17
by: Miguel Guedes | last post by:
Hello, Does anyone have a link to the C++ Standard Library naming conventions that they could share? I have found a few links to pages on C++ naming conventions but am unsure as to what standard...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.