My Rules for Software Development
1. Use a new git branch to develop new features. After finishing a new feature, switch to the main branch.
It’s much clearer when you’re doing multiple functions at the same time.
2. The committed code needs to push to the remote repository as soon as possible.
Code in a local environment can easily get lost. One time I deleted the entire project directory and my code was lost.
3. The test code is for testing only. Don’t use test code as your functional source code.
4. Use environment variables for configurations. Don’t hardcode configuration.
It’s safe and convenient.
5. Don’t keep uncommitted changes of code all the time. Either commit and push it to a remote branch or restore it.
First, uncommitted and unpushed changes are easily lost. Second, keep uncommitted changes makes new updates to the same file difficult. Third, It also messes up code commits.
If the changes are important and you won’t need them for a while, you can copy and save them to another place.
6. First, solve the problem. Then, write the code. Before writing code, you need to understand and organize the requirements and complete the database design, API design, and detailed design.
It makes development easier.