| 1 |
<HTML> |
|---|
| 2 |
<HEAD> |
|---|
| 3 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> |
|---|
| 4 |
<META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; IRIX64 6.4 IP30) [Netscape]"> |
|---|
| 5 |
</HEAD> |
|---|
| 6 |
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000"> |
|---|
| 7 |
|
|---|
| 8 |
<CENTER> |
|---|
| 9 |
<H1> |
|---|
| 10 |
Coding Standard</H1></CENTER> |
|---|
| 11 |
The following link has a good desciption of a coding standard and why one |
|---|
| 12 |
is needed: |
|---|
| 13 |
<BR><A HREF="http://www.possibility.com/Cpp/CppCodingStandard.html">http://www.possibility.com/Cpp/CppCodingStandard.html</A> |
|---|
| 14 |
|
|---|
| 15 |
<P>The coding standard for VR Juggler will be based on a simplified version |
|---|
| 16 |
of the above standard. The standard will be minimal and still try |
|---|
| 17 |
to allow for flexibility. We just need a way to make the source code |
|---|
| 18 |
readably and maintainable across all classes. |
|---|
| 19 |
<BR> |
|---|
| 20 |
<H4> |
|---|
| 21 |
Documentation</H4> |
|---|
| 22 |
We will be using a modified PERCEPS script to automatically create documentation. |
|---|
| 23 |
In order to allow for this, the source code must be commented with this |
|---|
| 24 |
in mind. |
|---|
| 25 |
<BR> |
|---|
| 26 |
<H4> |
|---|
| 27 |
Code Standard</H4> |
|---|
| 28 |
The following is a brief summary of the way the code in VR Juggler should |
|---|
| 29 |
be written. Of course there are always various exceptions, but if |
|---|
| 30 |
the code is relatively consistent it will make it much easier for us all. |
|---|
| 31 |
<BR> |
|---|
| 32 |
<H4> |
|---|
| 33 |
Names</H4> |
|---|
| 34 |
|
|---|
| 35 |
<UL> |
|---|
| 36 |
<LI> |
|---|
| 37 |
Class Names: Name the class after what it does</LI> |
|---|
| 38 |
|
|---|
| 39 |
<LI> |
|---|
| 40 |
Method Names: Name it after the actions it does</LI> |
|---|
| 41 |
|
|---|
| 42 |
<UL> |
|---|
| 43 |
<LI> |
|---|
| 44 |
Suffixes are sometimes useful:</LI> |
|---|
| 45 |
</UL> |
|---|
| 46 |
Max - to mean the maximum value |
|---|
| 47 |
something can have. |
|---|
| 48 |
<BR> Cnt - the current count |
|---|
| 49 |
of a running count variable. |
|---|
| 50 |
<BR> Key - key value. |
|---|
| 51 |
<BR> For example: RetryMax to mean the maximum number |
|---|
| 52 |
of retries, RetryCnt to mean the current |
|---|
| 53 |
<BR> retry count. |
|---|
| 54 |
<UL> |
|---|
| 55 |
<LI> |
|---|
| 56 |
Prefixes are sometimes useful:</LI> |
|---|
| 57 |
</UL> |
|---|
| 58 |
Is - to ask a question about |
|---|
| 59 |
something. Whenever someone sees Is they will know it's a question. |
|---|
| 60 |
<BR> Get - get a value. |
|---|
| 61 |
<BR> Set - set a value.</UL> |
|---|
| 62 |
|
|---|
| 63 |
</BODY> |
|---|
| 64 |
</HTML> |
|---|