There are a few convention rules to follow. Here are some simple examples:
Private members (fields)
They are often seen to start with an underscore character, or the small 'm' letter followed by an underscore.
C#
private string _customerName;
private string m_CustomerName;
Visual Basic
Private _customerName As String
Private m_CustomerName As String
The most frequently used approach, is the single underscore charater as pictured in the first line of each C# and VBNET examples.
Methods (always capitalized)
Name of methods, by opposition to Java to give an accurate example, are always capitalized:
Java
public string getString() { }
.NET (both C# and VB)
public string GetString() { } // C#
Public Function GetString() As String ' VB
Interfaces
Interfaces always start with a capitalized I
.
public interface ICustomer { }
Public Interface ICustomer
And Interface
Attributes
Attribute classes are meant to end with the word Attribute
.
public class MyClassAttributeAttribute { }
Public Class MyClassAttributeAttribute
End Class
Here are some links that may help you dig it deeper:
- Guidelines for Names;
- C# Reference;
- General Naming Conventions.
Hope this helps! =)