Tagged Questions
23
votes
17answers
2k views
Is it a good practice to name the returned variable “result”? [closed]
Is it a good practice to call the variable a method returns with a variable name result?
For instance:
public Zorglub calculate() {
Zorglub result = [...]
[...]
return result;
}
Or ...
11
votes
7answers
371 views
Generalise variable usage inside code
I would like to know if it is a good practice to generalize variables (use single variable to store all the values).
Consider simple example
Strings querycre,queryins,queryup,querydel;
querycre ...
4
votes
5answers
258 views
variable comparison without initialising
I am working with a project in VC++ which involves co-ordinate system having x,y,z axis.
I am trying to check for if a variable(Point with x,y,z values) is assigned on the coordinate system or its a ...
2
votes
7answers
436 views
Should I refactor single letter variables for constructs like pointer/structure names?
And No, i am not referring to single variables in loops or exceptions. Lets say pointer/struct names in large c ,c++ programs . Are there any languages where this type of naming is acceptable or is ...