|
 |
|
 |
01-13-2005, 12:43 PM
|
#1 (permalink)
|
|
Regular Contributor
Join Date: Oct 2004
Posts: 209
|
your style?
whats your favorite variable style?
lowercase notation:my_name
cammel notation:myName
or for those who know languages that requiore yuo to define the type of each variable.
hungarian style
|
|
|
01-13-2005, 12:57 PM
|
#2 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,486
|
you forgot about PascalCase
it really depends on what language i'm coding in. i used to only use one standard, but now it depends on the language i use. i try to conform to the standards of that language.
for example, on php.net, you will always see them using lowercase: $my_name
in java, you will see variable names in cammel case, and then Class names in pascal case. example: String myName = "Mike";
this helps tremendously when more than one person might be working on a project, or if you are modifying an existing application, or someone might modify your program in the future.
__________________
Mike
|
|
|
01-13-2005, 02:19 PM
|
#3 (permalink)
|
|
Regular Contributor
Join Date: Oct 2004
Posts: 209
|
what is pascal case?
|
|
|
01-13-2005, 04:58 PM
|
#4 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,161
|
If I don't know the accepted standard for a language, or at least can't guess it, I'll lapse into Java style just because it's the one I'm most comfortable with. Otherwise I try to stick to the language standard.
|
|
|
01-13-2005, 05:25 PM
|
#5 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,486
|
Quote:
|
Originally Posted by falsepride
what is pascal case?
|
First letter of each word upper case ( even the first word )
__________________
Mike
|
|
|
01-13-2005, 06:58 PM
|
#6 (permalink)
|
|
Senior Grasshopper
Join Date: Jun 2003
Location: FL
Posts: 317
|
Big willie style..
oh. I'm with sde on this. I seem to lapse into different styles depending on the language. I've never been a big fan of pascal, camel [studly] caps, but seem to use them much more with PHP Classes. Although the vars inside the class will be $my_var. Public methods will be: myFunction() and private methods: _myFunction(). (in php4 .. haven't done anything in 5 yet)
I pretty much stick to $my_var and my_cool_function() in perl.
-r
|
|
|
01-15-2005, 03:32 AM
|
#7 (permalink)
|
|
Regular Contributor
Join Date: Feb 2003
Location: indisclosed
Posts: 210
|
I have to go for the "no one else will read my code easy except me" style. All lowercase, random characters, and have the 2nd or 3rd letter/number represent if it's a enum, array, local variable, etc,etc.
|
|
|
01-16-2005, 09:40 AM
|
#8 (permalink)
|
|
Code Monkey
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
|
I like mixedCase for variable names, with MixedCase for class and function names. This is just personal preference though. If I am working on a project with someone else, I'll obviously conform to whatever style they have for themselves. I have never liked function_name() stuff. I don't know why. Just my $.02.
__________________
while(1) fork();
|
|
|
01-27-2005, 07:51 AM
|
#9 (permalink)
|
|
$_['Your_Mom'];
Join Date: May 2002
Location: Santee
Posts: 627
|
i like fooBar() style.
|
|
|
01-27-2005, 08:45 AM
|
#10 (permalink)
|
|
mike
Join Date: Jan 2005
Location: Ottawa, ON
Posts: 79
|
I tend to switch it up with the language. If I'm doing Windows programming I tend to use czSomeString type style (hungarian I think) but I mostly stick with ThisIsAClass, someFunctionName and someVariableName. THIS_WOULD_BE_A_CONST but I try to stay away from a_variable and a_function unless I'm doing PHP or something (I basically code in C++, PHP and sometimes Java).
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 02:35 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|