Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Naming Warnings
 Short acronyms should be uppercase
Visual Studio Team System
Short acronyms should be uppercase

TypeName

ShortAcronymsShouldBeUppercase

CheckId

CA1706

Category

Microsoft.Naming

Breaking Change

Breaking

The name of an identifier contains a two-letter acronym and the second letter is lowercase.

This rule splits the name into words based on the casing and checks any two-letter words against a list of common two-letter words, such as "In" or "My". If a match is not found, the word is assumed to be an acronym. For parameters, the first word is ignored due to the camel casing convention used for parameter names.

By convention, two-letter acronyms use all uppercase letters, and acronyms of three or more characters use Pascal casing. The following examples conform to this naming convention: 'DB', 'CR', 'Cpa', and 'Ecma'. The following examples violate the convention: 'Io', 'XML', and 'DoD', and for non-parameter names, 'xp' and 'cpl'.

'ID' is special-cased to cause a violation of this rule. 'Id' is not an acronym but is an abbreviation for 'identification'.

Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve required for new software libraries, and increases customer confidence that the library was developed by someone with expertise in developing managed code.

To fix a violation of this rule, change the second letter of the acronym to uppercase.

It is safe to exclude a warning from this rule if the two letters are not an acronym but instead form a word or proper name.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
'OK' should also be cased as 'Ok'      David M. Kean - MSFT   |   Edit   |  
'OK' is another special case which should be cased as 'Ok'.
Tags What's this?: Add a tag
Flag as ContentBug
Acronym != abbreviation      StuartCelarier ... Zeb   |   Edit   |  
Radar and scuba are acronyms , i.e., abbreviations that spell or are pronounced as a word. XML, IBM, and DoD are abbreviations. This topic is about abbreviations, whether or not they are also acronyms.
Tags What's this?: Add a tag
Flag as ContentBug
More Information      David M. Kean - MSFT   |   Edit   |  

For more information on the guidelines this rule enforces, see the following external resources:

Capitalization Conventions, Design Guidelines for Developing Class Libraries
http://msdn2.microsoft.com/en-us/library/ms229043.aspx

Page 36, Framework Design Guidelines: Conventions, Idioms and Patterns for Reusable .NET Libraries
Krzysztof Cwalina and Brad Abrams
http://www.amazon.com/gp/product/0321246756/002-6248839-4752853?v=glance&n=283155

Tags What's this?: Add a tag
Flag as ContentBug
"Id" is a psycological term and its use in UI is generally forbidden...      AStanton1978 ... David M. Kean - MSFT   |   Edit   |  

...even by MS sources on UI design guidelines. Technical Writers constantly point this out to us devs and FxCop complains the opposite. How to you turn off this irritating exception to the rule in FxCop? (...because I cannot turn off my tech writers =) )

[edit - David M. Kean - MSFT] Thanks for your feedback. FxCop fires this rule on API declarations, and not UI terms. API declarations (for most applications) will not appear in the UI.

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker