属性的命名约定 [英] Naming convention for property
本文介绍了属性的命名约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
哪一个更好或更清楚?
public int FrozenRegionWidth { get; set; }
或...
public int WidthOfFrozenRegion { get; set; }
推荐答案
我会说FrozenRegionWidth,否则
I'd say FrozenRegionWidth, otherwise you'll end up with a whole bunch of properties starting with 'WidthOf..'.
有这么说,你不应该有像FrozenRegion.Width这样的东西'd寻找FrozenRegionWidth在WidthOfFrozenRegion)?
Having said that, shouldn't you have something like FrozenRegion.Width (another reason why I'd look for FrozenRegionWidth over WidthOfFrozenRegion)?
这篇关于属性的命名约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文