PDPRP Technical Scot's Coding Conventions

PDPRP Technical Scot's Coding Conventions


Here are the conventions I used in the PDPRP code:

Variables

All global variable start with a capital letter. All variables which are defined with a #define statement are in all caps. Local variables are all smalls. I hate names with too many underscores or intermediate capital letters.

Procedures

I like having everything in one file, so there are no header files in the stuff I wrote. You can find procedure and variable declarations at the top of each code. Before each procedure is a comment with the name in all caps. So you can easily go to different procedures by searching the code for the procedure you want with its name spelled in all caps.

I have tried to make error return values all less than 0, and return 1 if everything is ok. I am not sure I always did this, though.

Code Comments

Places in the code where I know I am doing something not quite right, or if I am not sure what I am doing is exactly right, I have a comment that somewhere contains an XXX. So you can easily search for them to see what might be improved, or what might be causing problems. I also put XXX in most of my printf statements which are meant to show debugging, not user-useful information.


Return to PDPRP Technical Files Information Page

Return to PDPRP Technical Info Page

Return toPDPRP Main Page.

sjk@begonias.bbso.njit.edu
10Dec97