Simple Maintainable Code
Simple Maintainable Code
Clean Code
Bijaya Prasad Kuikel
Wash Your Code … make it clean
What makes code to be simple & clean?
- If you are doing PHP follow PSR-12 (Other languages have their
standard too)
- Use a linter or CS fixer to follow the standard. Integrate build tools in
Sublime or use default PHPStorm code refactor, to automate this.
- Makes it easy for everyone - including yourself - in the team, to read
the code
- Share the same settings with the team
- Make habit of pre commit hooks that cleans up the code upto the
same standard
Rule #3: Write Expressive Code
- If you find yourself copying the same code several times, extract
that code into its own method.
- Use language constructs like interfaces, traits to make code more
expressive and reusable
Other Considerations