XRef 与 Xref(.NET 命名)
哪个名称更符合 .NET 属性和方法的命名标准?
1.
public string XRef { get; set; }
2.
public string Xref { get; set; }
Which name is more consistent with .NET naming standards for properties and methods?
1.
public string XRef { get; set; }
2.
public string Xref { get; set; }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想说第一个 - “X”实际上是一个单独的词(十字)。这有点像
CData
类(和XCData
)。它看起来确实有点奇怪,但我认为值得指出的是“R”实际上是单词的开头。另一方面,对于变量,我可能会使用
xref
而不是xRef
,仅仅是因为后者看起来真的很奇怪。I would say the first - the "X" is effectively a separate word (cross). This is a bit like the
CData
class (andXCData
). It does look a bit odd, but I think it's worth indicating that the "R" is effectively the start of a word.On the other hand, for a variable I'd probably use
xref
rather thanxRef
, simply because that latter looks really weird.根据类库设计指南 (http://msdn.microsoft.com /en-us/library/ms229043.aspx),我相信您最终会得到
XRef
。XRef
不是复合词或常用术语。我认为,最终,这实际上取决于您的编码标准是什么。
According to the Design Guidelines for Class Libraries (http://msdn.microsoft.com/en-us/library/ms229043.aspx), I believe you'd end up with
XRef
.XRef
is not a compound word or common term.I think, in the end, it really depends on what your coding standards are.
我认为这取决于您的代码约定。我会写
XRef
因为xref
不是一个单词,它包含 X 和 Ref,并且每个单词都应该以大写字母开头。It depends on your code conventions, I think. I'd write
XRef
becausexref
is not one word, it contains X and Ref, and each word we should start with upper case letter.