]> git.mjollnir.org Git - moodle.git/commitdiff
Trivial changes that were hanging around
authormoodler <moodler>
Sun, 26 Oct 2003 16:12:03 +0000 (16:12 +0000)
committermoodler <moodler>
Sun, 26 Oct 2003 16:12:03 +0000 (16:12 +0000)
lang/en/docs/coding.html

index 24dcd45bf41be96772061e34ac14c53c7a02e1f7..e1679c6fad2e50679a94461886218b4c176fff52 100755 (executable)
@@ -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 
     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>
       } </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>