Z
Zytan
http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconClassNamin...
Like this: I want a class named Socket. It clashes with .NET Socket
class. clsSocket does not. So, in picking single word class names,
there's more likely to be a clash with Word then clsWord. In fact,
clsWord will never clash, so 'clashes are so much more likely' should
really be 'clashes are now possible'.
Didn't know that. Thanks. I can't say I like it, though. Isn't it
best, as Jon Skeet touch upon, to have everything named differently,
including the above example? Looks like a constructor at first glance
to me.
Good idea, and thanks! I won't use it, because I like the "m" telling
me "I'm a *m*ember", but good idea.
Zytan
How are name clashes more likely?
Like this: I want a class named Socket. It clashes with .NET Socket
class. clsSocket does not. So, in picking single word class names,
there's more likely to be a clash with Word then clsWord. In fact,
clsWord will never clash, so 'clashes are so much more likely' should
really be 'clashes are now possible'.
There is nothing stopping you from
having a property / method name the same as a class name, in fact I
prefer it:
public Warehouse Warehouse
{
get { return this._warehouse; }
set { this._warehouse = value; }
}
Didn't know that. Thanks. I can't say I like it, though. Isn't it
best, as Jon Skeet touch upon, to have everything named differently,
including the above example? Looks like a constructor at first glance
to me.
(And yes, I use the _ convention rather than m_ ... I like the fact
that in the debugger and in Intellisense it puts the fields first in
the locals window / pick list. One more convention for you to think
about.![]()
Good idea, and thanks! I won't use it, because I like the "m" telling
me "I'm a *m*ember", but good idea.
Zytan