-1
votes
3answers
136 views

Should I always use “is” as prefix for boolean variables? [closed]

Should I always use is as prefix for boolean variables? What about booleans that indicate something in past? Should I write isInitialized or wasInitialized? Should I write for properties IsManyMembers ...
8
votes
2answers
620 views

What does Uncle Bob mean by 'noun phrase names'?

I am reading Clean Code by Uncle Bob. Because I am not a native-English speaker, I couldn't understand following statement: Classes and objects should have noun or noun phrase names like ...
2
votes
2answers
289 views

Choosing between words with different spellings for function names

A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people ...
60
votes
6answers
4k views

Should the variable be named Id or ID?

This is a bit pedantic, but I've seen some people use Id as in: private int userId; public int getUserId(); and others use: private int userID; public int getUserID(); Is one of these a better ...
99
votes
16answers
20k 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 ...
5
votes
3answers
210 views

How to name an subclass that add a minor, detailed thing?

What is the most concise (yet descriptive) way of naming a subclass that only add a specific minor thing to the parent? I encountered this case a lot in WPF, where sometime I have to add a small ...
9
votes
4answers
428 views

How to avoid general names for abstract classes?

In general it's good to avoid words like "handle" or "process" as part of routine names and class names, unless you are dealing with (e.g.) file handles or (e.g.) unix processes. However abstract ...
17
votes
5answers
1k views

What are the benefits of prefixing function parameter names with p*?

I often see projects (in Java projects and teams using Eclipse) that prefix function parameters with p. For example public void filter (Result pResult) ... I personally don't see any benefit in ...
4
votes
6answers
350 views

Order of subject and modifiers in variable names

I'm looking for experiences regarding the ordering of the subject and modifiers in variable names. A simple object Shape would have just a subject for the variable name, such as Area. A slightly ...
5
votes
3answers
512 views

What are the names for various forms of camel-case style naming?

For the purposes of communicating coding styles to my co-workers, what would I formally call the following variants of camel case? camelCase and CamelCase Notice that the former version ...
0
votes
6answers
258 views

Function parameter names

I just found the following code in our code base: public String identifyArchitectureName(String platformName, String input) ... In my opinion input is one of the most meaningless names for a ...
21
votes
7answers
8k views

Practical considerations for HTML / CSS naming conventions (syntax) [closed]

Question: what are the practical considerations for the syntax in class and id values? Note that I'm not asking about the semantics, i.e. the actual words that are being used, as for example ...
13
votes
8answers
1k views

A Class named Class?

This is more of a style question, but it is something I am currently pondering for a project of mine. Assume that you're creating an application which is modeling a school. So there are entities like ...
0
votes
2answers
190 views

Naming Rules: Standards, Reserved, and what do they depend on? [closed]

I want to know the rules of naming (AlwaysCapitalize, _underscore, firstSmallLetter, etc...) for each of Namespaces, Classes, Interfaces, Exceptions, Data Members, Methods, Variables, etc.... also I ...
1
vote
1answer
176 views

Namespaces and naming

I'm having some trouble working this one out, probably more than I should. This is a pretty large project, with a very clearly defined structure, with no obvious problems, but I can't seem to figure ...
74
votes
16answers
17k views

What is the benefit of not using Hungarian notation?

One of the things I struggle with is not using Hungarian notation. I don't want to have to go to the variable definition just to see what type it is. When a project gets extensive, it's nice to be ...
31
votes
11answers
1k views

Intentional misspellings to avoid reserved words

I often see code that include intentional misspellings of common words that for better or worse have become reserved words: klass or clazz for class: Class clazz = ThisClass.class kount for count in ...
5
votes
10answers
4k 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?
25
votes
9answers
1k 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 ...
16
votes
6answers
661 views

“A”, “an”, and “the” in method and function names: What's your take?

I'm sure many of us have seen method names like this at one point or another: UploadTheFileToTheServerPlease CreateATemporaryFile WriteTheRecordToTheDatabase ResetTheSystemClock That is, method ...