177 reputation
210
bio website
location
age
visits member for 3 years, 6 months
seen Oct 14 at 18:48

i haz teh codez


Sep
24
awarded  Autobiographer
Aug
22
awarded  Notable Question
Mar
18
awarded  Citizen Patrol
Jan
2
awarded  Notable Question
Jul
7
awarded  Nice Question
Jun
20
awarded  Popular Question
Jun
19
awarded  Critic
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
@Mr.Mindor Or you can hover your mouse over the item in question and let your IDE tell you what it is. With your method, you're trusting that the previous coder followed an established casing convention. What if they didn't? What if this property you speak of is actually named nuggetCount? What do you do then?
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
So it really appears that some older languages have paved the road for coding standards of future languages (like your C/C# example). That is most unfortunate because having to keep track of how to case variables and object members just adds an unnecessary level of complexity that can be done without.
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
"If I see a capitalized variable, an educated guess will dictate I'll need to instantiate it to use it." I do not understand. How would seeing a capitalized variable make you think you need to instantiate it before using it? Because it looks like a class name? So you don't know the difference between MyClass MyClass = null and class MyClass { }?
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
@JamieF: I'll argue that Employee Employee looks more consistent. This, of course, assumes that the reader understands the underlying framework of the language they're using.
Jun
19
revised What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
edited body
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
Karl: In .NET, you can say Employee Employee and VS manages the scope perfectly. In .NET, you cannot have an instance method and static method in the same class with the same name and signature. Lastly, semantics on the word "proper". What should I use in its place? I can't say "uppercase" because that suggests the entire name is uppercase. How about full camel? @MainMa: In .NET, I do this all the time: class x { int i { publix x(i) { this.i = i; } } }. Not sure if that's what you were addressing or not.
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
Re: your edit: Your first code example demonstrates simply poorly constructed, disaster-prone code. My OP is not about poorly constructed, disaster-prone code. It is about the exact same code as your second example, but different casing convention. I edited your second code example and posted it in my OP with my casing convention. Replace that with your first code example, please.
Jun
19
revised What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
added 613 characters in body
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
In my OP, I clearly talked about intuitive naming conventions (eg, GetNuggetCount() vs SetNuggetCount() vs plain ol' NuggetCount). I've never met anyone who needs a casing convention to tell them what something is or how to properly use it. So far, every bit of your contention here relates to 1) ambigous naming conventions, 2) improper use of access modifiers, and 3) inability to tell the difference between GetNuggetCount() and NuggetCount.
Jun
19
awarded  Commentator
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
So what is your contention with NuggetCount as a variable or property name? WHY does it matter? What do you mean by never need to think NuggetCount? Are you suggesting the naming convention (not casing convention) itself is flawed? Give me some objective answers here.
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
As for the part about code being less readable because it follows a slightly different standard, I've never had that problem. Unless someone's variables are named like hookyDookyDoo, no naming or casing convention detracts from the readability. Also, do keep in mind that I am not saying my convention is "better" since it doesn't truly bring anything special to the dev table. Lastly, I don't understand your point of [Properties have a larger scope...goes in this direction]. What does the scope have to do with casing convention? Go in what direction?
Jun
19
comment What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)
Did you read my question in full? Take a look toward the end where I said: NuggetCount all by itself suggests a property or local variable that is simply holding a value. To that last one, one may be tempted to say, "Ah ha! That is the question. Property or variable? WHICH IS IT?" To that, I'd reply with, "Does it really matter?"