diff options
Diffstat (limited to 'documentation/coding_standards')
-rw-r--r-- | documentation/coding_standards/best_practices.txt | 2 | ||||
-rw-r--r-- | documentation/coding_standards/javascript_coding_standards.txt | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/documentation/coding_standards/best_practices.txt b/documentation/coding_standards/best_practices.txt index 069ac42aa..df04aa845 100644 --- a/documentation/coding_standards/best_practices.txt +++ b/documentation/coding_standards/best_practices.txt @@ -15,6 +15,8 @@ work for developers, which means happier, more productive developers. * Use self-documenting variable names. $group_guids is better than $array. +* Use "positive" variable names. Prefer `$enable = true` to `$disable = false`. + * Functions returning an array should return an empty array instead of FALSE on no results. diff --git a/documentation/coding_standards/javascript_coding_standards.txt b/documentation/coding_standards/javascript_coding_standards.txt index 7d3b842ec..9939e80ab 100644 --- a/documentation/coding_standards/javascript_coding_standards.txt +++ b/documentation/coding_standards/javascript_coding_standards.txt @@ -1,2 +1,13 @@ *** JAVASCRIPT CODING STANDARDS *** +* Same formatting standards as PHP. + +* All functions should be in the elgg namespace. + +* Function expressions should end with a semi-colon: + + elgg.ui.toggles = function(event) { + event.preventDefault(); + $(target).slideToggle('medium'); + }; + |