让我给你举个例子:
public class MyClass
{
public string MyProperty { get; set; }
public MyClass(string myProperty)
{
MyProperty = myProperty; // bad?
this.MyProperty = myProperty; // good?
}
}
我已经开始this
在这种情况下使用,因为我有轻微的偏执狂,认为仅依靠案例可能会令人困惑,或者更糟糕的是实际上可能会导致错误。
这里的“最佳实践”是什么?
编辑:
到目前为止,这听起来比我想象的要主观得多。我想人们会强烈地从一边或另一边下来。