Which one is preferable or more clear?
public int FrozenRegionWidth { get; set; }
Or...
public int WidthOfFrozenRegion { get; set; }
Which one is preferable or more clear?
public int FrozenRegionWidth { get; set; }
Or...
public int WidthOfFrozenRegion { get; set; }
I'd say FrozenRegionWidth, otherwise you'll end up with a whole bunch of properties starting with 'WidthOf..'.
Having said that, shouldn't you have something like FrozenRegion.Width (another reason why I'd look for FrozenRegionWidth over WidthOfFrozenRegion)?
I'm not sure if it's a question for this community. I believe it must be a question for your team.
If I was only developer on a team and I have to choose a name, I would create a FrozenRegion class with Width property.
FrozenRegionWidth is what is used everywhere. You just can't use
NameOfCustomer
instead of
CustomerName
This makes our variable short n sweet. You can't go on writing long sentences as variable names. And here you're creating an autoproperty. Remember that. It's more like a variable.
But, consider the following scenario:
You are trying to look for the frozen region's width, but let say that you're not sure that it's called frozen region. Maybesome people call frozen region, another call it RegionThatIsFrozen (I know, lame example) or what ever: in that case, wouldn't it be easier for the programmer to type WidthOf and waits for the autocomplete to kicks in and choose the right one?
I'd would prefer FrozenRegionWidth.
For more informations refer to .NET framework naming guidelines at http://msdn.microsoft.com/en-us/library/ms229012.aspx
I would favour whichever form proffers the more generic information first in the name.
That is to say, I want it so that when I'm looking at a the member list in intellisense they're grouped according to how I want to find them. If "FrozenRegion" is what's important to me than I want to name the related properties FrozenRegionWidth, FrozenRegionFoo, FrozenRegionBar. If I'm looking at "Width" I want WidthFrozenRegion, WidthFoo, WidthBar.
So it depends on your usage, but name from most generic to most specific.
This question I asked on a similar vein may or may not help, it has indicators about noun choice.
To keep inline with the .NET BCL naming conventions I would use FrozenRegionWidth. It's unusual to include prepositions.
As mentioned above, FrozenWidth looks like a prime candidate for a struct/value type.