Great catch, a lot of people would have missed that condition!
Where did you learn about this function? It's super useful!
You've really come a long way in your use of caching, well done!
This documentation is excellent,
thank you!
Note:
* Code reviews aren't just about what was done wrong, but encouraging what was done right, too
- Especially important if you're reviewing code for a more junior developer
- Support good habits and as well as highlighting problem areas
---
## Code Review, minus the "ew"
Note:
I've teased CI as a way to make code reviews easier a couple times, let's dig in!
----
### Let CI be the "bad guy"
The more quality checks that we can automate, the more time we have focus on the important aspects of code review!
Note:
* Big proponent of letting CI be the villain, as it frees reviewers up to focus on the "does it work?" and does it work well?" priorities
* You set the rules, and CI makes sure everyone follows them
* Another example of "shift left"
----
### The value of coding standards
* Determine coding standards at the beginning of the project
* PER 2.0 v. PSR-12 v. PEAR v. ¯\\\_(ツ)_/¯
* Reduces merge conflicts, back-and-forth
* Enforce standards via tooling
Note:
* Coding standards are a way of saying "this is how we write our code"
- Tabs vs spaces, class + variable naming conventions, project file structure, etc.
* Consistent standards => fewer merge conflicts and a more readable codebase
* Once standards are determined, use tooling to ensure compliance
----
### Linting
* Validate against project coding standards
* PHP_CodeSniffer, PHP Coding Standards Fixer
* ESLint, Shellcheck, RuboCop, PyLint
* Highly-configurable, with reasonable defaults
* Often capable of automatically fixing some issues!
Note:
* We can enforce coding standards with linting tools
- In the PHP ecosystem, most popular are PHP_CodeSniffer and PHP Coding Standards Fixer
- Similar tools across languages: JavaScript, Bash, Ruby, Python, etc.
* Generally offer rulesets for common standards, but can be customized for individual teams/projects
* Helps catch the low-hanging fruit: whitespace, naming schemes, syntax errors, missing documentation, undeclared variables, etc.
* Many include automated fixing tools (e.g. PHP Code Beautifier), which can fix a lot of common issues automatically
----
### .editorconfig
* Standard for file encoding, whitespace, line endings, and more
* Defaults available for most popular standards
*