Making code readable is fundamental for development
- it is key to maintainability
- by yourself
- by others
- working together with a team
PEAR Coding Standard
The PEAR (PHP Extension & Application Repository) Coding Standard is just one standard method of encouraging different programmers, of PHP in this case, to work to a common standard so their code can be easily shared. There is a list of their standards here
WikiText
Even for comparatively simple documentation, Wikipedia has its own published standards and procedures
Good Practice
- Commenting & Documentation
- Avoid Obvious Comments
- Consistent Indentation
- Code Grouping
- Separation of Code and Data
- Consistent Naming Scheme
- using Case & camelCase naming schemes
- Capitalize SQL and Special Words
- Consistent Temporary Names
- Use Meaningful Names for Variables and Functions
- DRY Principle
- Avoid Deep Nesting
- Limit Line Length
- File and Folder Organisation
- Object-Oriented vs. Procedural (organisation)
- Avoid Using Magic Numbers (constants)
- Code Refactoring
- Using IDEs with colour coding
- Find 3 examples of different styles of writing comments
- Create names for 6 variables you could use when programming an ecommerce store
- What is the difference between Python and other languages in terms of indentation