Friday, July 22, 2011

Design Patterns: Naming Conventions

Microsoft's Guidelines for naming conventions. At first glance, naming guidelines seem unnecessary (a variable is variable). However, after working on various legacy projects, anything that improves readability and understanding is a good thing.

The most basic concepts are the capitalization names:
  1. Pascal - The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized. Used for class names, property names, method names, and events. example BackColor
  2. Camel - The first letter of an identifier is lowercase and the first letter of each subsequent concatenated word is capitalized. Used for parameter names. example backColor
  3. Hungarian - including a prefix in order to encode some metadata, such as the data type, about the parameter. Should not be used. example stringBackColor

No comments: