Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37675

Re: FALSE or false?

$
0
0
by Davo Smith.  

PHP also allows for the following variable names:

$helloWorld, $hello_world, $ms_helloWorld

And the following function names:

printHelloWorld, mv_printHelloWorld

and code layouts like this:

function my_myfunction()
{
   return false;
}

But Moodle coding guidelines do not allow them.

The point of coding guidelines is not to catch things that are forbidden by the language itself (those should be caught by syntax-checkers in the IDE, or by runtime errors/warnings), but to make sure that the code looks consistent (making it easier to work with).

As for picking holes in Moodle code that doesn't follow coding guidelines, it is always worth double-checking how old the code is and whether or not it was written before the current coding guidelines were finalised.


Viewing all articles
Browse latest Browse all 37675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>