Naming Advice Required (Re-Worded)

  • Thread starter Thread starter C# Learner
  • Start date Start date
C

C# Learner

In a class containing only public constants - a class which will never
be instantiated or subclassed - should the class name be pluralized?

e.g.:

sealed class ErrorMessages
{
private ErrorMessages()
{
}

public const string UnableToWrite = "Unable to write to output file.";
public const string UnableToRead = "Unable to read from input file.";
}

Should this be called "ErrorMessages" or "ErrorMessage"? I
instinctively think that the plural is suitable, but then, when
declaring enumerations we use the singular. Then again, enumerations
are different in that they can be instantiated.

So which is the correct way?
 
Hi,

A class is a blue print of object(s).
Here we talk about a generic entity.
Though you can create many employee instances, we still use the name
Employee for employee class.

Hence I prefer to use ErrorMessage.

Regards,
R.Balaji
 
R.Balaji said:
A class is a blue print of object(s).
Here we talk about a generic entity.
Though you can create many employee instances, we still use the name
Employee for employee class.

Hence I prefer to use ErrorMessage.

Hi,

I understand your point, but in *this* case the class /isn't/ a
blueprint for an object, since it never gets instantiated...
 
Back
Top