views:

317

answers:

4

Which is more correct, "PriceList" or "Pricelist"?

FxCop says: CA1702 : Microsoft.Naming : The compound word 'PriceList' in type name 'PriceList' exists as a discrete term. If your usage is intended to be single word, case it as 'Pricelist'.

Edit: This is an object with Title, Start/End date etc.

+7  A: 

You should use PriceList. Standard naming conventions call for Pascal case for class names and properties. Since the dictionary lists the phrase price list as two words, the second word should be capitalized using Pascal casing.

tvanfosson
+3  A: 

Like FxCop it depends on your intention. IF you have an object that represents a Pricelist, which perhaps has a Title and an issue date and then contains a list of items which carry a name and price then Pricelist seems correct.

OTH if you have an object of type List<Price> then PriceList (or Prices) would be better.

Its important not too get hung up on obeying the rules and miss the principle involved. In this case its an entirely human issue (as far as the compiler is concerned it could be called Pinkelephants, pinkElephants or PinkElephants, it doesn't care). In which case you should pick whatever feels the most natural or normal.

AnthonyWJones
It's the first. Object with title, dates etc.
Allrameest
+3  A: 

Pricelist does not exist as a discrete term in either Merriam Webster or Oxford. FxCop must be making up words.

Don Reba
+2  A: 

Both "PriceList" and "Pricelist" are ok.

However if it is a List then “PriceList” (or Prices) would be better, as it makes it clears it is two concepts joined together. But if you have a class called “Pricelist” (maybe with a Title and an issue date) and/or Pricelist is a concept that is in your problem domain, I would tend to use “Pricelist”

In the end it does not matter as both are easy to understand and read, it would be best if witch ever you choose was used throughout the system.

The standard FxCop rules tends to gives lots of output, only some of witch is helpful. If you are working on a big system, you may wish to write a custom FxCop rule to enforce witch ever one of "PriceList" or "Pricelist" you choose in use in this system.

Ian Ringrose