J
Jonathan Wood
Camel case refers to capitalizing the first letter of each subword except
for the first one.
Examples:
camelCase
destinationUrl
thisIsCamelCase.
for the first one.
Examples:
camelCase
destinationUrl
thisIsCamelCase.
Jonathan Wood said:Camel case refers to capitalizing the first letter of each subword except
for the first one.
Examples:
camelCase
destinationUrl
thisIsCamelCase.
value of the parameter myInt.
Not true, if you have:
class Person
{
private string name;
public Person(string name)
{
name = name;
}
}
Then the compiler will simply assign the local variable name to itself,
you
will get a warning about this (hopefully an error since nobody would leave
the "treat warning as error" option unchecked ), after the constructor
has
executed the class field "name" is still null.
Maybe not quite undestand u - it provides anything, just mark that we deal with private/property
item.
Any other ideas how to underpin this?
Michael Nemtsev said:Hello Dave,
DS> But other than the example above, does an "_" prefix provide any
DS> value?
Maybe not quite undestand u - it provides anything, just mark that we deal with private/property
item.
Any other ideas how to underpin this?
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents do not cease to be insipid."
(c) Friedrich Nietzsche
Actually, in the Microsoft guidelines, it really is.
I wouldn't care much about what Microsoft recommends or not,
this "m_" style simply makes sense for me
I must admit that I find it ugly, but that's
probably because i'm not used to read and write it.
Well I was going to look that up again but I see you gave me a trick question. I just stated in
the post you were replying to that I considered references to controls a bit different than
straight variables. Perhaps you didn't read my entire post, eh? We were talking about member
variables.
I read your entire post. No tricks here
We are talking about fields (member variables, as you say), which
txtFirstName and lblFirstName certainly are.
How would you name these two Controls?
Well, as I indicated, I consider that a different issue. I haven't decided on this issue for sure,
but I have a tendancy to stick with what I did in VB, which is to include those prefixes.
BTW, I found two interesting bullets in a Microsoft document [link below]
regarding the use of hungarian notation and the "_" prefix in field names:
I must argue here that my examples of txtFirstName and lblFirstName
indicate both type and semantics. However, I use the notation in other
controls even when there is no ambiguity, but I'm going to try to break
that habit for my next project. Do I really need to know that a field is
a Control by looking at its name when I have intellisense and tooltips on
hand at all times? - I don't think so, but I'll see how it goes
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.