Discipline
Good Code Comes from Good Habits.
When looking at what things that I've learned over the last few years that have made me a better developer, I find it a bit of a surprise that the top of the list is just developing the discipline to make sure that alongside doing the fun thing, the building, I also put in the effort to do the less fun things that make the end product better.
That means (in no particular order):
- Using an opinionated Linter
- Following git flow everywhere, even on personal projects
- Meaningful commit messages
- Comments on complex code
- Writing documentation
- Having a test plan
- Following the test plan
- Taking a refactoring pass once a new feature is finished
- Continuous Integration
- Reading documentation
- Following the rule of 3 as a guideline for refactoring repetitive code
- Keeping pull requests on task to a single task
- Talking with other developers about an API early in the design process
- Choose the right approach, be pragmatic about design patterns
None of these ideas are novel, but I find it useful to remember that being a good craftsman about my code helps me get things done. Learning new languages / features / tools is important too, but without discipline none of those are going to make my output better.