Variable or scalar is a storage location paired with an associated symbolic name (an identifier), which contains some known or unknown quantity or information referred to as a value.

learn more… | top users | synonyms

7
votes
10answers
6k views

Variable names: underscores, no underscores, or camel case? [closed]

Variable names can be written in many ways, but the most common that I'm familiar with are: thisisavariable, this_is_a_variable, and thisIsAVariable. Which of these are preferred, and why?
10
votes
9answers
5k views

When is it ok to use a Global variable

Ok, so this is a bit of a devils advocate question really. When are global variables ok, and if never, what would you use as an alternative? An interesting side-case to this question, how is a ...
23
votes
6answers
13k views

Explicitly defining variable data types vs. using the keyword 'var'?

In C#, am I encouraged to use the all-purpose var keyword for every variable declaration? If yes, do I have to mention those special characters for literal values within the variable declaration like ...
8
votes
3answers
2k views

Are my method or variable names too long?

So I was currently in the middle of coding, unfortunately for me, I was in "The Zone" then I thought to myself, are my method/variable names to long? POP out of the Zone I go! So I came here to ...
3
votes
2answers
1k views

Why is CATALINA_HOME named that way and other interesting program names [closed]

I work with open source software a lot and keep coming across weird and funny names for executables, variables, constants and etc. Currently I am wondering why CATALINA_HOME environment variable was ...
10
votes
5answers
740 views

Does any programming language use variables as they're in maths?

In maths, a variable means you can put any number there, and an equation will still be true: root(square(x)) = abs(x) In programming languages, this is not so: a var can change. In Python: y = ...
2
votes
2answers
132 views

Best way to delimit variable elements of a path in code documentation?

Often some element of a path is variable, but the path as a whole needs to be documented in some manner for later programmers. Especially when using *nix systems, almost any character is a valid ...
5
votes
18answers
3k views

What do you name functions/variables/etc when you can't think of a good name? [closed]

When you are defining a function/variable/etc and are not sure what to name it, what do you name it? How do you come up with a name? If you use a temporary name as a place-card until you give it it's ...
21
votes
17answers
13k views

How do you name your private variables in C#? [closed]

What is the best practice, most commonly accepted naming conventions for private variables in C#? private int myInteger; private int MyInteger; private int mMyInteger; private int _myInteger; ...
17
votes
3answers
2k views

What's the origin of foo and bar? [duplicate]

Possible Duplicate: Using “Foo” and “Bar” in examples I know AT&T labs used them in their Unix days, but do they have even deeper histories?