|
-
Aug 23rd, 2003, 08:54 PM
#1
Thread Starter
Addicted Member
Naming Conventions?
In my .NET Class, they teach us all these naming conventions. "pstrWhatever" for Procedure-level String variable, etc. However, I notice in a lot of the code I see posted here, they aren't used much. Are they something I should get in the habit of using, or are they more of a teaching tool, but something that I'll drop once I get into the "Real World"? I just want to know, so I know whether or not they are worht getting used to.
Take my love
Take my land
Take me where I cannot stand
I don't care, I'm still free
You can't take the sky from me...
-
Aug 23rd, 2003, 09:14 PM
#2
It's preference, who cares everyone ends up using something similar or different.
-
Aug 23rd, 2003, 10:25 PM
#3
Frenzied Member
What you're talking about is the Hungarian Naming Convention and is generally standard practice or procedure in many development businesses. It is a good idea to become familiar with why and how it is used.
the link below will help.
Hungarian Naming Convention
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Aug 23rd, 2003, 10:39 PM
#4
Thread Starter
Addicted Member
Okay, cool. Thanks Memnoch1207. That's what I wanted to know. Also, thanks for that link.
Take my love
Take my land
Take me where I cannot stand
I don't care, I'm still free
You can't take the sky from me...
-
Aug 24th, 2003, 12:43 PM
#5
I wonder how many charact
This convention may be standard among certain businesses... but depending on what firm you work for, you will have to adapt to their convention.
Most people seem to consider that naming a variable should include what type of variable it is, the access level of the variable (public, private), and a descriptive name.
For variables that simply increment through a loop (counters), many people simply use a lowercase i .... works for me, whenever i see it, I assume its not a very important variable and only holds scope for a short period of time.
Additionally, function headers sometimes stray from conventions...
Many C++ programmers also use _ (underscore), which personally is a pet peeve of mine. Although no one interprets it as an operator, it lends that impression, making the reading of the code less friendly than it should be. You see code in which that variable is used 10 times, and it looks messy in my view.
String p_TempString;
Personally, i rather use
pTempString
instead of:
p_TempString
p_strTempString
pStrTempString
In function headers, I use a lowercase l, don't ask why, but I like it...
Round (lValuetoRound As Decimal, etc)
Anyway, here's a good overview of C++ programming conventions
"The experience of many projects leads to the conclusion that using coding standards makes the project go smoother. Are standards necessary for success? Of course not. But they help, and we need all the help we can get! Be honest, most arguments against a particular standard come from the ego. Few decisions in a reasonable standard really can be said to be technically deficient, just matters of taste. So be flexible, control the ego a bit, and remember any project is fundamentally a team effort. "
http://www.chris-lott.org/resources/...gStandard.html
Last edited by nemaroller; Aug 24th, 2003 at 12:49 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|