From 5c0bd8a19a294f178ddd6607dd3f624ca34fa5b7 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 1 Nov 2011 19:36:27 -0400 Subject: added semi-colons after function expressions --- .../coding_standards/javascript_coding_standards.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'documentation/coding_standards') 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'); + }; + -- cgit v1.2.3 From bdbf47c030c6ed8903f6511c5436cd29a234f29f Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Mon, 7 Nov 2011 00:40:23 +0000 Subject: Fixes #3397: Adds 'positive' variable name standard to best practices file. --- documentation/coding_standards/best_practices.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'documentation/coding_standards') 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. -- cgit v1.2.3