Step 1: Login - Step 2: Vote! Login and vote now.
By Shaharyr
via dev102.com
Published: Jul 17 2008 / 14:23
Yes, I will use m_ prefix for class members. I DO NOT NEGOTIATE WITH TERRORISTS. Shut up.
Actually, I don’t mind which prefix shall be used but in order to make member variables distinct from local variables, we have to give it some prefix. This is a part of a coding convention for C++ adopted by Microsoft called Hungarian notation. Some of you may say that it may be a bit disturbing using C++ naming conventions in C# code, but...
Comments
Nick Brown replied ago:
As long as you are using a modern IDE which can differentiate between local variables and instance variables, this is a non-issue.
galiel replied ago:
It is an issue because it doesn't solve all of the problems which were introduced.
And... VS alone doesn't differentiate between local variables and instance variables, you should use Resharper/Visual Assist ot something like that and those tools cost money!
Nick Brown replied ago:
Eclipse does the job and does not cost a thing. Local variables show up in regular text while instance variables show up as blue and in italics. Exactly which problems is it not solving?
galiel replied ago:
First of all, there are a LOT (I think most) of developers who doesn't use Eclipse, so it doesn't help them...
Besides using prefix helps you when you use intellisense...
Voters For This Link (9)
Voters Against This Link (6)