Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for SA1308 to also mention prefix "t_" #3697

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions documentation/SA1308.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

## Cause

A field name in C# is prefixed with *m_* or *s_*.
A field name in C# is prefixed with *m_*, *s_*, or *t_*.

## Rule description

A violation of this rule occurs when a field name is prefixed by *m_* or *s_*.
A violation of this rule occurs when a field name is prefixed by *m_*, *s_*, or *t_*.

By default, StyleCop disallows the use of underscores, *m_*, etc., to mark local class fields, in favor of the 'this.' prefix. The advantage of using 'this.' is that it applies equally to all element types including methods, properties, etc., and not just fields, making all calls to class members instantly recognizable, regardless of which editor is being used to view the code. Another advantage is that it creates a quick, recognizable differentiation between instance members and static members, which will not be prefixed.

Expand Down