2
votes
2answers
272 views

What are appropriate metaphors for the pieces of a word processor? [closed]

A word processor is a complicated creature of many layers and pieces, but it represents a relatively simple concept: a piece of paper with writing on it. This leads to the problem of having many ...
102
votes
16answers
21k views

Is there an excuse for short variable names?

This has become a large frustration with the codebase I'm currently working in; many of our variable names are short and undescriptive. I'm the only developer left on the project, and there isn't ...
2
votes
2answers
133 views

Naming variables with fixed point units

What should I name a variable that has units with a fixed point? int herpLimitLo_psig2 = 6000; // 60.00 psig int derpLimitLoPsigwithtwodigits; int herpLimitHiPsigfixedtwo; int ...
4
votes
3answers
321 views

Naming a “do X if needed” method

What is a good way to name a method that checks if X needs to be done, and does X it if necessary? For example, how to name a method that updates a user list if new users have logged in? ...
34
votes
15answers
4k views

Is it bad practice to name an unused variable with a single underscore?

Often when the syntax of the language requires me to name a variable that is never used, I'll name it _. In my mind, this reduces clutter and lets me focus on the meaningful variables in the code. I ...
10
votes
7answers
383 views

What is a good alternative to the name variable for a language that only has immutable references or labels?

For example, in functional languages, variables are single assignment and their values are immutable once assigned. So they have two states unbound and bound, once bound they can't be changed. Is ...
0
votes
3answers
617 views

Collection providing lookup by one of several keys [closed]

What do you call a collection in which each item may be looked up by one of multiple keys? A partial, simplified definition in C# might be: class MyDataStructure<TKey1, TKey2, TValue> { ...
7
votes
2answers
127 views

What do you do when working with multiple languages with different capitalization schemes?

I'm making a webapp using Django. The Python convention for naming variables is lowercase_with_underscores, but the Javascript convention is camelCase. In addition, I've seen many people use ...
25
votes
9answers
2k views

Scientific evidence that supports using long variable names instead of abbreviations?

Is there any scientific evidence that the human brain can read and understand fully written variable names better/faster than abbreviated ones? Like PersistenceManager persistenceManager; in ...