2025-06-17
✍🏻 Writing code
We use tooling to help us write better code and avoid mistakes. Make use of the tools described below when writing PHP, HTML, CSS, and JavaScript.
Why have a common standard?
A few good reasons exist to use a shared coding standard when working on code with others. The most important ones which come to mind are:
- Removes cognitive load when writing code since you can focus on what the code does, not what it looks like.
- Makes it easier to scan code from different authors.
- Makes it easier to jump into projects and help each other out.
- Makes commits in Git easier to diff since the only changes between commits are code that actually affects functionality.
- Makes it easier to onboard potential new colleagues or freelancers.
Different types of languages have different types of standards, and we try to be pragmatic about it, but sometimes the syntax also has a deeper meaning. Make sure projects include .editorconfig, esling.config.mjs, .stylelintrc.json, and .prettierrc.json, files.