Here is a checklist of some of the most important stuff (in my opinion) that should be ran through any code change, regardless of a programming language:
- Does what it’s supposed to do
- Process it mentally (proof of correctness)
- Automated tests
- Manual tests
- Can’t be further broken into smaller pieces
- Is written in a generalized way (re-usage)
- Has no repeating parts
- My future-self and coworkers can understand it
- Is documented
- Is readable
- Conforms to (any) coding standards for consistency
- Separation of concerns
With experience, one doesn’t need to think about these, since they occur naturally.
There might be a couple of more that I missed, but these should be a good base.