diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index be78ad0b3b..237bc18d20 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -295,11 +295,17 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c

We will not be using any form of hungarian notation in our naming conventions. Many of us believe that hungarian naming is one of the primary code obfuscation techniques currently in use.

Variable Names:

-

Variable names should be in all lowercase, with words separated by an underscore, example:

+

In PHP, variable names should be in all lowercase, with words separated by an underscore, example:

$current_user is right, but $currentuser and $currentUser are not.

+ +

In JavaScript, variable names should use camel caps:

+ +
+

currentUser is right, but currentuser and current_user are not.

+

Names should be descriptive, but concise. We don't want huge sentences as our variable names, but typing an extra couple of characters is always better than wondering what exactly a certain variable is for.

@@ -317,7 +323,7 @@ for ($i = 0; $i < $outer_size; $i++)

Function Names:

-

Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character. Function names should preferably have a verb in them somewhere. Good function names are print_login_status(), get_user_data(), etc.

+

Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should preferably have a verb in them somewhere. Good function names are print_login_status(), get_user_data(), etc. Constructor functions in JavaScript should begin with a capital letter.

Function Arguments:

Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: do_stuff($a, $b, $c). In most cases, we'd like to be able to tell how to use a function by just looking at its declaration.