在以下人为设计的C#代码中,我不喜欢枚举名称与属性名称相同。如何命名枚举与属性
public enum CollarType
{
Classic,
VNeck
}
public class Shirt
{
public CollarType CollarType { get ... }
}
在旧时代,当越来越多的人使用匈牙利/其他奇怪的命名一样class CShirt
,这种冲突没有发生。但今天我不断遇到它。
你如何处理这种情况?你是否认同这么多事物具有相同的名称,或者你有更好的命名方案?
重复:http://stackoverflow.com/questions/495051/c-naming-convention-for-enum-and-matching-property – wj32 2010-12-10 10:49:30
这编译得很好,它是在.NET框架中的常见模式。你不喜欢它什么? – 2010-12-10 10:56:16