Difference between revisions of "Coding Standards Documentation"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(Created page with "{{Coding Standards Index}} All projects need documentation and BOARD18 is no exception. <br>I have been trying to keep up with this need while developing BOARD18.<br> This pag...")
 
(→‎Called Programs: added example)
Line 3: Line 3:
This page is intended to standardize the documentation (comments) that is actually in the code.
This page is intended to standardize the documentation (comments) that is actually in the code.


==Called Programs==
==Called PHP Programs==
Most of the server side processing for BOARD18 is done in stand alone PHP programs that are executed from the web pages via AJAX calls.<br>
Most of the server side processing for BOARD18 is done in stand alone PHP programs that are executed from the web pages via AJAX calls.<br>
The files that contain these programs should all begin with a block of comments with the following format.
The files that contain these programs should all begin with a block of comments with the following format.
Line 9: Line 9:
* A description of all of the input parameters to this program.
* A description of all of the input parameters to this program.
* A description of the output produced by this program.
* A description of the output produced by this program.
The following is an example of comments that follow this standard.
<pre>
* gameGet.php is the server side code for the AJAX gameGet call.
*
* It returns most fields for a game from the game table.
* It also returns a list of the players who are playing the game.
*
* Input is: gameid.
*
* Output is the following stringified JSON data structure.
*  {
*    "stat":"success||"fail"||"noplayers",
*    "gameid":"nnnn",
*    "gname":"aaaaaa",
*    "boxid":"nnnn",
*    "bname":"bbbbbb",
*    "version":"vvvvvvv",
*    "sdate":"yyy-mm-dd hh:mm:ss",
*    "adate":"yyy-mm-dd hh:mm:ss",
*    "lastupdater":"llllllll",
*    "status":"sssss",
*    "players":
*    [
*      {
*        "playerid":"nnnn",
*        "login":"pppppp",
*        "fname":"fffffff",
*        "lname":"ggggggg"
*      },
*      . . . . more players . . . . .
*    ]
*  }
*
</pre>
==JavaScript Functions==
to be provided.


{{Stub}}
{{Stub}}


[[Category:Standards]]
[[Category:Standards]]

Revision as of 11:23, 14 October 2017

Coding Standards Index edit


All projects need documentation and BOARD18 is no exception.
I have been trying to keep up with this need while developing BOARD18.
This page is intended to standardize the documentation (comments) that is actually in the code.

Called PHP Programs

Most of the server side processing for BOARD18 is done in stand alone PHP programs that are executed from the web pages via AJAX calls.
The files that contain these programs should all begin with a block of comments with the following format.

  • A paragraph explaining the function of the program.
  • A description of all of the input parameters to this program.
  • A description of the output produced by this program.

The following is an example of comments that follow this standard.

 
 * gameGet.php is the server side code for the AJAX gameGet call.
 * 
 * It returns most fields for a game from the game table.
 * It also returns a list of the players who are playing the game.
 * 
 * Input is: gameid.
 * 
 * Output is the following stringified JSON data structure. 
 *   {
 *     "stat":"success||"fail"||"noplayers",
 *     "gameid":"nnnn",
 *     "gname":"aaaaaa",
 *     "boxid":"nnnn",
 *     "bname":"bbbbbb",
 *     "version":"vvvvvvv",
 *     "sdate":"yyy-mm-dd hh:mm:ss",
 *     "adate":"yyy-mm-dd hh:mm:ss",
 *     "lastupdater":"llllllll",
 *     "status":"sssss",
 *     "players":
 *     [
 *       {
 *         "playerid":"nnnn",
 *         "login":"pppppp",
 *         "fname":"fffffff",
 *         "lname":"ggggggg"
 *       },
 *       . . . . more players . . . . . 
 *     ]
 *   }
 *

JavaScript Functions

to be provided.


This page is a stub.
The BOARD18 Project will soon be expanding it.