CSC/ECE 517 Summer 2008/wiki2 2 rapodraz: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
=Naming Conventions= | =Naming Conventions= | ||
In most | In most contexts, the term [http://en.wikipedia.org/wiki/Identifier_naming_convention|"naming conventions"] refers to a set of rules used to name variables that provide information about the variable. Naming conventions are a form of [http://en.wikipedia.org/wiki/Metadata|metadata]. A good set of naming conventions can be very useful and is often part of good programming practice. Naming conventions may differ among programming languages and projects, but the purpose is the same: to provide information about the variable in the name itself. Some examples of common naming conventions include: | ||
-Using lowercase for a single word name | |||
-Using capitalization to separate multi-word names | |||
-Using all caps for constants | |||
-Using variable prefixes to indicate scope or type | |||
Examples of good, well known naming conventions are [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx|Hungarian Notation], and the [http://www.symbian.com/developer/techlib/v70sdocs/doc_source/DevGuides/EssentialIdioms/NamingConvs.guide.html|Symbian OS naming conventions]. | |||
=Naming Choices= | =Naming Choices= | ||
Line 9: | Line 16: | ||
=External Links= | =External Links= | ||
http://www.symbian.com/developer/techlib/v70sdocs/doc_source/DevGuides/EssentialIdioms/NamingConvs.guide.html | |||
http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx | |||
[[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]] | [[CSC/ECE 517 Summer 2008/wiki2 Assignment|Back to the assignment page]] |
Revision as of 17:50, 23 June 2008
Variable Naming in Programming
Almost all programming languages allow the programmer a great deal of freedom when naming variables in a program's source code. It may seem like this is an obvious advantage, as it gives the programmer a great deal of flexibility. However, this level of freedom may incorrectly reflect the notion that variable naming is unimportant. Since variable identifiers can be named in many different ways, they often are, and the result is a high degree of inconsistency that can be problematic for code readability and maintenance.
Naming Conventions
In most contexts, the term "naming conventions" refers to a set of rules used to name variables that provide information about the variable. Naming conventions are a form of [1]. A good set of naming conventions can be very useful and is often part of good programming practice. Naming conventions may differ among programming languages and projects, but the purpose is the same: to provide information about the variable in the name itself. Some examples of common naming conventions include:
-Using lowercase for a single word name -Using capitalization to separate multi-word names -Using all caps for constants -Using variable prefixes to indicate scope or type
Examples of good, well known naming conventions are Notation, and the OS naming conventions.
Naming Choices
Using Design Pattern Names
External Links
http://www.symbian.com/developer/techlib/v70sdocs/doc_source/DevGuides/EssentialIdioms/NamingConvs.guide.html http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx