-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathNamingConventionsVariables.qhelp
More file actions
41 lines (32 loc) · 1022 Bytes
/
NamingConventionsVariables.qhelp
File metadata and controls
41 lines (32 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>A variable name that begins with an uppercase letter does not follow standard
naming conventions, which decreases code readability. For example, <code>Numberofguests</code>.
This applies to local variables, parameters, and non-constant fields.
</p>
</overview>
<recommendation>
<p>
Begin the variable name with a lowercase letter and use camel case: capitalize the first letter of each word within
the variable name. For example, <code>numberOfGuests</code>.
</p>
</recommendation>
<references>
<li>
J. Bloch, <em>Effective Java (second edition)</em>,
Item 56.
Addison-Wesley, 2008.
</li>
<li>
Java Language Specification:
<a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-6.1">6.1. Declarations</a>.
</li>
<li>
Java SE Documentation:
<a href="https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html">9 - Naming Conventions</a>.
</li>
</references>
</qhelp>