Software Engineers Handbook/Supporting Processes/Coding Standards
Appearance
Here is the wikipedia entry for coding standards.
Coding standards generally contain a set of conventions for a specific language. Items typically covered are:
- Naming conventions including:
- how descriptive and long the names should be,
- what the capitalization scheme should be, and
- what the postfix and prefix conventions are.
- Physical organization, such as Definitions shall be located in the header files. and Do not include more than one class in one file.
- Structure conventions, such as Opening and closing braces shall be located in the same column like this:
{ { // code in here } }
- Style guides, such as Classes containing pointers shall have a virtual destructor. It is useful to include the reasoning and references for this type of standard.
- Legacy code guidance, such as When editing existing code, follow the coding naming and structure conventions of the existing code.
C++
[edit | edit source]- www.possibility.com coding standard
- www.chris-lott.org standard
- Effective C++: 55 Specific Ways to Improve Your Programs and Designs by Scott Meyers ISBN 0321334876 is a reference for creating style guides.
- More Effective C++: 35 New Ways to Improve Your Programs and Designs by Scott Meyers ISBN 020163371X is a reference for creating style guides.
Java
[edit | edit source]C
[edit | edit source]Eiffel
[edit | edit source]Naming conventions
[edit | edit source]"Always, always, always use good, unabbreviated, correctly-spelled meaningful names." -- c2: MeaningfulName
Popular naming conventions (naming formats) include:
- ALL_UPPERCASE_WITH_UNDERSCORES
- all_lowercase_with_underscores
- CamelCase
- uppercaseOnlyInTheMiddle
- _UnderscorePrefixedCamelCase
- Camel_Case_With_Underscores
For surprisingly long conversations about naming conventions, see c2: UnderscoreVersusCapitalAndLowerCaseVariableNaming; Wikipedia: CamelCase; c2: CamelCase; and "Underscores vs CamelCase".
Further reading
[edit | edit source]- See C++ Programming/Weblinks#C++ Coding Conventions for many more C++ coding conventions.