Variable Naming Conventions


Java uses camel-case notation for methods, properties, and variables, meaning that they are lowercase for the first letter in the name and capital letter for the first letter of every other word in the name. The first letter of class and object names in Java are uppercase. The following snippet shows the general syntax most Java programmers use:

 int id; int idName; int id_name; //practiced also final int CONSTANT_NAME; //widely adopted int reallyLongId; public class ClassName //every first letter capitalized public interface InterfaceName public void method(){} public void myMethodName(){} 

Based on the C# library classes, it is safe to make certain assumptions about C# naming conventions. A documented naming guideline for C# was not provided at the time of this writing. Each first letter of all method and property identifier names is capitalized, as is each first letter of all class and namespace names. Interfaces are preceded with an I. Variables are camel-cased, as shown in the following examples:

 int id; int idName; public class ClassName //every first letter capitalized public interface IInterfaceName //interface name preceded by I public void Method(){} // first letter always capitalized public void MyMethodName(){} // first letter of all other words capitalized 




Professional C# 2005
Pro Visual C++ 2005 for C# Developers
ISBN: 1590596080
EAN: 2147483647
Year: 2005
Pages: 351
Authors: Dean C. Wills

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net