Re: .NET Naming Guidelines (C#)




As one scrolls through lines of code (e.g. when reviewing
the code), it is important to readily identify if the parameter is a
local variable or is being passed in the function from outside.

It is? I can't say that it matters that often to me (unless it's an
output parameter).


Use a parameter prefix (e.g. "r" for inputs, "p" for out, ref).

That's fine for private methods, but I wouldn't use it for publicly
accessible ones. Keep in mind that parameter names becomes part of
your public "interface". Forcing your own naming conventions onto
consumers of your library isn't very nice.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.