This repository is a personal compilation of coding best practices I learned or not, the easy or the hard way, along my journey as a software engineer.
- There are no bugs, only unintended features.
- Since there are no bugs, no need to plan for an emergency rollback.
- Just commit garbage without proofreading it, thanks to github suggested changes reviewers will take care of fixing it.
- Friend Driven Development is the practice of approving your friends' pull requests without reading them. Obviously an implicit friendship agreement stipulates that one approval is worth another approval, so that the Friend Driven Development can keep going.
- The previous point shall not be confused with the Genius Driven Development, which consists in approving your teammates' pull requests without reading them because they are geniuses. The approval is merely here to by-pass the branch protection rules. Please refer to the inner json effect for more details on this best practice.
- Sometimes reviewers want you to add minimal documentation ( like an entry in the changelog ) and execute a smooth transition, especially when breaking an existing behavior on which users rely. This is time-consuming and, to be fair, your time would be better used shipping more breaking changes. The best way here is to avoid reviews all together and directly commit on the main branch.
- There is no problem that cannot be solved either with
git push --force
or withgit merge -X theirs
.
- The golden rule is that new is always better, no need to stick to the existing text formatting.
- In comments and other forms of documentation, infinitive form ( e.g. "add" ), third-person singular simple present ( e.g. "adds" ), present participle ( e.g. "adding" ) and simple past ( e.g. "added" ) can be mixed up.
"
and'
are the same things, one can use them interchangeably in the same file.- Spaces and tabs are the same things, one can also use them interchangeably in the same file.
- If it works, don't touch it.
- If it works now, it will work with 100 times more load.
- This is a temporary solution.
- TODO: fix it later.
- You touch it, you own it.
- Deletion Driven Development, also known as Scream Driven Development, consists in a nutshell in deleting this unknown and apparently-unused piece of software/infrastructure and transferring ownership to the first person to complain.
- Want to know if your change will break prod? Ship it. Prod is the best testing environment because it's the closest thing to prod.
- Hope for the worst, but prepare for the best.
- RFCs are a waste of time. You want to know how people feel about something you want to do? Do it, and see who complains.
- If you have no choice but to write an RFC, make sure it's imprecise enough so that no constructive criticism can be made.
- If you have no choice but to write a precise RFC, make sure to send it for review so late that nobody has time to comment. The best timeline in this case is to send the RFC once the project is actually implemented.
- After introducing a breaking change, add a description in the breaking-change section of the changelog, and only bump the semver PATCH version.
- Monorepo just works.
- Multirepo just works.
Obviously, everything described in here is purely ironic. These pro-tips should not be used in real life for the sake of readability, maintainability and scalability.
Unless explicitly stated to the contrary, all contents licensed under the Creative Commons Attribution 4.0 license.