From: moodler Date: Sun, 26 Oct 2003 16:12:03 +0000 (+0000) Subject: Trivial changes that were hanging around X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a52ec9020ad25c9ae4fd43c178cbff6c8b5829a3;p=moodle.git Trivial changes that were hanging around --- diff --git a/lang/en/docs/coding.html b/lang/en/docs/coding.html index 24dcd45bf4..e1679c6fad 100755 --- a/lang/en/docs/coding.html +++ b/lang/en/docs/coding.html @@ -28,9 +28,8 @@ using require_login() and isadmin(), isteacher(), iscreator() or isstudent().
  • 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.
  • + 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.
  • Don't create or use global variables except for the standard $CFG, $SESSION, $THEME and $USER.
  • All variables should be initialised or at least tested for @@ -52,9 +51,11 @@ Don't use tabs AT ALL.
  • Variable names 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.

    GOOD: $quiz
    GOOD: $errorstring
    +GOOD: $assignments (for an array of objects)
    GOOD: $i (but only in little loops)

    BAD: $Quiz
    @@ -160,7 +161,6 @@ }

  • -

     


    Moodle Documentation

    Version: $Id$