Visual Studio Team System
Use preferred terms

TypeName

UsePreferredTerms

CheckId

CA1723

Category

Microsoft.Naming

Breaking Change

Breaking

Cause

The name of an externally visible identifier includes a term for which an alternative, preferred term exists.

Rule Description

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.

Obsolete term Preferred term

ComPlus

EnterpriseServices

Cancelled

Canceled

Indices

Indexes

LogIn

LogOn

LogOut

LogOff

SignOn

SignIn

SignOff

SignOut

Writeable

Writable

How to Fix Violations

To fix a violation of this rule, replace the term with the preferred alternative term.

When to Exclude Warnings

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.

Related Rules

Naming Warnings

Tags :


Community Content

Shawn Poulson
Cancelled vs. Canceled

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

Tags :

Kyle Huntley
in/out on/off

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!

Tags :

Adam Vandenberg
Log vs. Sign
I wouldn't mind seeing the "LogXyz" forms completely deprecated in favor of the "SignXyz" forms.
Tags :

Nick Wallace
English for Cancelled

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>

 

Tags :

MNK Boulos
re - why is 'Cancelled' an obsolete term?

... 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!

Tags :

Sean Kinsey
Why is "Cancelled" an obsolete term?

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?

Tags :

Gregory C Lee
Indices vs. Indexes
I believe that indices should be used when the meaning is a plural of the noun index and indexes should be used only for the present tense of the verb to index . English is sufficiently imprecise without unnecessarily compounding the problem.
Tags :

alexsh
Is CheckId correct?
Visual Studio shows this rule as CA1726. Who is right?
Tags : contentbug

Peter Ritchie
Overriding a particular term without disabling CA1723

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.

Tags : guidance

Page view tracker