When we write code, it is absolutely vital that we can understand what we have written and have a very good idea of why we have written it. That sounds like a statement of the obvious, but I'm sure that, like me, you have encountered one too many developers who take a look at their own code and can't understand why they have written a section of code in a particular way. If a developer can't understand their own code, then what hope is there for the rest of us?
Every project should have its own coding style, supported by fully documented coding guidelines, and Moodle is no exception. Full details of the Moodle guidelines are given in the developer documentation at https://docs.moodle.org/dev/Coding_style. In this section, we provide an overview of these guidelines to get you started. We also investigate a code checking tool that will help ensure...