This document outlines Naming standards that are useful to developers who use C# or Java as their programming language of choice. This is a great read for those who want to hone up their coding skills.
There are three naming conventions that are prevalent in the OO World. These are Pascal Naming Convention, the Camel Case Notation and Upper Casing. While programmers around the world seem to arbitrarily prefer naming convention, we should make a clear distinction between when one is used over the others, depending on context.
|
In the Pascal Naming convention, the first letter of the first word,
and the first letter of every word being concatenated to make the
identifier.
|
|
|
In the camelCase Convention, the first letter of the first word is
always lowercase, other than that, it is similar to the
PascalNamingConvention.
|
|
|
Not a convention really, but a bad habit that programmers have,
especially those from the days of GW-BASIC and COBOL.
|
|
|
Not mentioned earlier, the lowercase convention is also camelCase, but
with only one concatenatenated word.
|
|
|
This is where the Hungarian Naming Convention developed by a great
Hungarian developer called Charles Simonyi who led Microsoft's
development team in the afx days while the Microsoft Foundation Classes
library was implemented. MFC is still in use to this day, though
abstracted by layers like the .NET framework.
|
|
|
The Hungarian naming convention pertains to all identifiers you will
use in your programming to enable tying the type of identifier to the
identifier’s name. These make your life very simple when adhered.
|
|
|
In a real life (programming) scenario, the Hungarian Naming convention, especially the part where
you need to prefix each variable with the type becomes very cumbersome. Use the convention within
the limits of common sense. Consistency is more important than rigorously adhering to a standard,
which then makes adhering to the standard a bigger job than writing the code itself.
|