Actions

Talk

Difference between revisions of "Developer Area/Coding guidelines"

From Mahara Wiki

(Suggestions of guidelines changes.)
 
Line 3: Line 3:
 
'''Functions, Classes'''
 
'''Functions, Classes'''
 
* Make sure function name starts from letter (no _ before function names).
 
* Make sure function name starts from letter (no _ before function names).
* Single whitespace between functions within the class and lib files
+
* Single whitespace between functions and between function and code
 
* Double whitespace between classes
 
* Double whitespace between classes
  
Line 12: Line 12:
 
'''general'''
 
'''general'''
 
* No closing php tag
 
* No closing php tag
* No whitespaces at the end is '''required'''
+
* No whitespaces at the end is '''required''' (currently it is just recommend)
  
 
'''Control statements'''
 
'''Control statements'''
* "case" multiline syntax
+
* "case" multiline syntax:
 +
case:
 +
    a = 25;
 +
    b = 100;
 +
    break;
 +
not
 +
case: a = 25; b = 100; break;

Revision as of 03:33, 20 July 2013

What needs to be added

Functions, Classes

  • Make sure function name starts from letter (no _ before function names).
  • Single whitespace between functions and between function and code
  • Double whitespace between classes

Variables

  • No hardcoded binary (security reasons)
  • No hardcoded serialised data (security reasons)

general

  • No closing php tag
  • No whitespaces at the end is required (currently it is just recommend)

Control statements

  • "case" multiline syntax:
case:
   a = 25;
   b = 100;
   break;

not

case: a = 25; b = 100; break;