| 27 |
<li> comments are a good thing.</li> |
<li> comments are a good thing.</li> |
| 28 |
<li> comment all "unobvious" things (e.g. don't comment setters/getters)</li> |
<li> comment all "unobvious" things (e.g. don't comment setters/getters)</li> |
| 29 |
</ul> |
</ul> |
| 30 |
|
<h3>The art of naming</h3> |
| 31 |
|
<ul> |
| 32 |
|
<li>Chose class/method/field names that describe the purpose of the entire method/class</li> |
| 33 |
|
<li>Don't use word fragments (getProjectValue is better than getProjVal)</li> |
| 34 |
|
<li>Don't use generic variable names like "temp" or "index" |
| 35 |
|
(Exception: really short methods where usage is very straight-forward. Ok to use i,j, |
| 36 |
|
it for loop indexes)</li> |
| 37 |
|
<li>Don't use get/set prefix unless the method really is just an accessor. If the |
| 38 |
|
method does real work, it's not an accessor. (Note: we don't always follow |
| 39 |
|
this rigorously, but we try).</li> |
| 40 |
|
</ul> |
| 41 |
|
|
| 42 |
<h3>General: (use the tool!)</h3> |
<h3>General: (use the tool!)</h3> |
| 43 |
<ul> |
<ul> |
| 44 |
<li>Turn on all the compiler prefs including unused temps, synthetic accessor |
<li>Turn on all the compiler prefs including unused temps, synthetic accessor |
| 47 |
<li> Compiler tasks. We have 3 that we use as a team (TODO, FIXME, XXX) Do not |
<li> Compiler tasks. We have 3 that we use as a team (TODO, FIXME, XXX) Do not |
| 48 |
add your own as this is unecessary and requires everyone on the team to change |
add your own as this is unecessary and requires everyone on the team to change |
| 49 |
their compiler settings in order to see these tasks.</li> |
their compiler settings in order to see these tasks.</li> |
| 50 |
|
<li>Sort the methods within a class alphabetically (use the sort members action).</li> |
| 51 |
<li> All classes MUST have a copyright notice.</li> |
<li> All classes MUST have a copyright notice.</li> |
| 52 |
<li> data type size initialization -> use meaningful values if possible, |
<li> data type size initialization -> use meaningful values if possible, |
| 53 |
not things like: new HashSet(65)</li> |
not things like: new HashSet(65)</li> |