From fce493b686c6d0b9a1bdcfd2d46876f4e335cf49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Hellander?= Date: Sat, 16 Sep 2023 10:27:44 +0200 Subject: [PATCH] Update documentation for SA1308 to also mention prefix "t_" #3695 --- documentation/SA1308.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/SA1308.md b/documentation/SA1308.md index 30af452d0..89a6300bf 100644 --- a/documentation/SA1308.md +++ b/documentation/SA1308.md @@ -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.