Rud*_*udy 1 c# syntax coding-style
以下第二种缩进方法的一般意见是什么?
// Normal indentation
a.Value = "foobar";
ab.Checked = false;
foo.Value = "foobar";
foobar.Checked = true;
// Spaces before the dot to align the properties/methods
a .Value = "foobar";
ab .Checked = false;
foo .Value = "foobar";
foobar.Checked = true;
Run Code Online (Sandbox Code Playgroud)
这应该是一个维基,但我要么没有足够的权限,要么不知道如何更改它.
编辑
我已经决定添加另一个例子来更好地展示这种缩进样式可能有用的地方.
fooA .PropertyA = true;
foobarB.PropertyA = true;
Run Code Online (Sandbox Code Playgroud)
使用VS2010中的新多线编辑功能,可以更轻松地更改所有线路上的PropertyA.
在C#中也有空格,甚至在点之前的换行并不罕见(参见LINQ).
| 归档时间: |
|
| 查看次数: |
204 次 |
| 最近记录: |