Forums Register Login

Variable Naming conventions

+Pie Number of slices to send: Send
Hey Guys!
Just wondering what people out there are doing for their variable naming.
You see I would normally prefix parameter variables with an underscore, to differentiate them from member variables.
But I vaguely recall from the sun conventions that using _ and $ is a no-no (system variables?).
So would it be okay to prefix member variables with 'm_' as I HATE using this.
What are other people doing? This is a VERY IMPORTANT point I feel
Don't think that Sun mentions anything so is it a free for all so. So maybe something that improves readability is good, as this is a key requirement.
Basically I'm looking to pinch a few ideas
+Pie Number of slices to send: Send
Code Conventions for the Java Programming Language
+Pie Number of slices to send: Send
thanks eugene, I've studied the conventions and was just wondering how people differentiate between member, local and parameter variables.
+Pie Number of slices to send: Send
There should be no differentiation between member, local and parameter variables, when it comes to naming. The only exception is final static constants that should be delcared in all caps with underscores, by convention.
The best thing that you can do for clarity and quality is to use meaningful names, declare objects in the narowest scope possible, avoid extra local variables, make your methods focused, etc. In other words, refactor your code if you think it's not clear from the code which variables are what.
[ May 23, 2003: Message edited by: Eugene Kononov ]
+Pie Number of slices to send: Send
so should we use String to represent all the fields in the flat file database , even include the ID and $(charge)?
I think she's lovely. It's this tiny ad that called her crazy:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 501 times.
Similar Threads
Cannot get Struts 2 to Work
Variable Naming Conventions
How to check if file contents read matches what was written
import and member variable conventions
having problem in verifying a character
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:31:07.