Might be a stupid one: Is there any naming convention for constants in C#?
Should I write
const int ERROR_OUTOFMEMORY = 2
or
const int errorOutOfMemory = 2
or is it just a case of personal matter?
Jens
If you like the style of your second example, use that.
As always, be sure to be consistent in whatever style you adopt - that's the
main thing!
-glenn-
"Jens Gruschel" <grus...@esteam.de> wrote in message
news:Ol1Wqma1BHA.2588@tkmsftngp07...
That's the point. Upper-case looks like C / C++, I've not seen it in C# yet
(could be because I just started with C#). Good luck such integer constants
are not used often (I just made a class which does not use such constants
out of the code that was the reason for my question).
Jens
public enum errorCodes
{
OutOfMemory = 2,
InvalidArgument = 3
}
public errorCodes MyMethod()
{
return errorCodes.OutOfMemory;
}
Hope this helps
Chris
"Jens Gruschel" <grus...@esteam.de> wrote in message
news:Ol1Wqma1BHA.2588@tkmsftngp07...
Try looking at the Microsoft .Net Design Guidelines.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht
ml/cpconnetframeworkdesignguidelines.asp
You're not obliged to follow them of course. But I suggest not straying too
far from them.
Kevin
"Jens Gruschel" <grus...@esteam.de> wrote in message
news:Ol1Wqma1BHA.2588@tkmsftngp07...
errorCode.OutOfMemory
"Chris Osborn" <cos...@usdata.com> wrote in message > public enum