本文介绍了枚举的单数还是复数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您对枚举使用单数还是复数?我认为在声明中最好使用复数。
Do you use singular or plural for enumerations? I think it makes best sense with plural in the declaration
enum Weekdays
{
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday
}
...但我认为使用类型时更有意义,例如
... but I think it makes more sense with singular when using the type, e.g.
Weekday firstDayOfWeek = Weekday.Monday;
我读了一个建议,使用单数的常规枚举和复数与标志,但我想
I read a recommendation somewhere to use singular whith regular enums and plural with flags, but I would like to hear some more pros and cons.
推荐答案
这里直接来自微软:
这篇关于枚举的单数还是复数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!