platform-core-home/documents/coding_conventions.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Wed Nov 5 22:05:45 2003 UTC revision 1.3, Wed Nov 5 22:08:45 2003 UTC
# Line 27  Line 27 
27    <li> comments are a good thing.</li>    <li> comments are a good thing.</li>
28    <li> comment all &quot;unobvious&quot; things (e.g. don't comment setters/getters)</li>    <li> comment all &quot;unobvious&quot; 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 &quot;temp&quot; or &quot;index&quot;
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
# Line 35  Line 47 
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 -&gt; use meaningful values if possible,    <li> data type size initialization -&gt; use meaningful values if possible,
53      not things like: new HashSet(65)</li>      not things like: new HashSet(65)</li>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3