Permalink
Browse files

Trivial changes that were hanging around

  • Loading branch information...
1 parent d2e3fa1 commit a52ec9020ad25c9ae4fd43c178cbff6c8b5829a3 moodler committed Oct 26, 2003
Showing with 5 additions and 5 deletions.
  1. +5 −5 lang/en/docs/coding.html
View
@@ -28,9 +28,8 @@
using require_login() and isadmin(), isteacher(), iscreator() or isstudent().</li>
<li class="spaced">All access to databases should use the functions in lib/datalib.php
whenever possible - this allows compatibility across a wide range of databases.
- You should find that almost anything is possible using these functions. Any
- other SQL statements should be: cross-platform; restricted to specific functions
- within your code (usally a lib.php file); and clearly marked.</li>
+ You should find that almost anything is possible using these functions. If you must write SQL code then make sure it is: cross-platform; restricted to specific functions
+ within your code (usually a lib.php file); and clearly marked.</li>
<li class="spaced">Don't create or use global variables except for the standard
$CFG, $SESSION, $THEME and $USER.</li>
<li class="spaced">All variables should be initialised or at least tested for
@@ -52,9 +51,11 @@
Don't use tabs AT ALL. </li>
<li class="spaced"><strong>Variable names</strong> should always be easy-to-read,
meaningful lowercase English words. If you really need more than one word
- then run them together, but keep them short as possible.
+ then run them together, but keep them short as possible. Use
+plural names for arrays of objects.
<p class="examplecode"><font color="#006600">GOOD: $quiz<br>
GOOD: $errorstring<br>
+GOOD: $assignments (for an array of objects)<br>
GOOD: $i (but only in little loops)<br>
<br />
BAD: $Quiz <br>
@@ -160,7 +161,6 @@
} </font></p>
</li>
</ol>
-<p align="center" class="normaltext">&nbsp;</p>
<hr>
<p align="CENTER"><font size="1"><a href="." target="_top">Moodle Documentation</a></font></p>
<p align="CENTER"><font size="1">Version: $Id$</font></p>

0 comments on commit a52ec90

Please sign in to comment.