TypeName
UsePreferredTerms
CheckId
CA1723
Category
Microsoft.Naming
Breaking Change
Breaking
The name of an externally visible identifier includes a term for which an alternative, preferred term exists.
This rule parses an identifier into tokens. Each single token and each contiguous dual token combination is compared against terms built into the rule and in the Deprecated section of any custom dictionaries. The following table shows the terms built into the rule and their preferred alternatives.
ComPlus
EnterpriseServices
Cancelled
Canceled
Indices
Indexes
LogIn
LogOn
LogOut
LogOff
SignOn
SignIn
SignOff
SignOut
Writeable
Writable
To fix a violation of this rule, replace the term with the preferred alternative term.
Exclude a warning from this rule only if the name of the identifier intentionally and specifically relates to the original term, as opposed to the preferred term.
Naming Warnings
Dictionary.com listed 'Canceled' as the past tense of Cancel, where 'Cancelled' as a British spelling of that tense. http://dictionary.reference.com/browse/canceled
Merriam-Webster merely lists both forms as inflected forms. http://www.m-w.com/dictionary/canceled
I'd love to understand why "Log" goes from in/out to on/off and "Sign" does the opposite and goes from on/off to in/out.
There must be a deeper meaning here... Is there an important semantic difference between Log[in|on] and Sign[in|on] that warrants different naming styles?
Sorry, just being picky and I wanted to try out the community content feature!
If you'd like to override the preferred terms and use British English for 'Cancelled' rather than the American version 'Canceled', forget about it. Even if you put it in the the CustomDictionary.xml it will be overridden by the built-in rule.
<Deprecated> <Term PreferredAlternate="Cancelled">Canceled</Term> </Deprecated>
... because it's English English, not American English - and the American's fired the English as the arbiters of the language a few hundred years ago. *grin*
ps - I'm 50% English and 50% American, grew up 'over there' but now live 'over here' (and does it matter which is which?). "When in Rome, ..." and all that seems to apply (Microsoft is, after all, an American company).
It is also a global company!
I have checked in the .NET Framework Developer's Guide under the section Best Practices for Implementing the Event-based Asynchronous Pattern and it asserts that "In the case of cancellation, set the Cancelled flag in the AsyncCompletedEventArgs object".
Which guideline has precedence?
If you would like to override this behaviour for a particular term, simple add the term to the <Unrecognized> element of CustomDictionary.xml. For example, with the following section:
<Unrecognized> <Word>canceled</Word> </Unrecognized>
...this warning will not be raised when "Cancelled" is encountered.