Ask HN: How to be a more diligent programmer
1. Missed use cases. Goal was to do X when Y is the input. But I forgot that Z also could be an input.
2. Passing around entire objects between methods instead of just their id in the db
3. Not using existing util function. I either forget that there's a util function for this, or I'm not aware that there's a util function for this.
4. General lousiness. Missing to mention all params in the docstring, and similar stuff
5. Desire to be regarded as fast. I see an existing method that could be refactored - I skip refactoring it because my priority is to ship my feature right now. In another instance, I copied a few existing methods to my new class because moving them to an abstract class and then re-using them would have been too much work, since I might have to fix the tests as well. There's no pressure on me to work faster from any stakeholder
6. A general tendency to minimize work. Refactor existing methods even though I'm not touching them? Work. Read up on how our deployment works even though I don't really have to know it? Not today maybe tomorrow. I love being a programmer so a lack of interest or an 'I don't care' attitude is not likely to be the problem here.
Have you gone through similar experiences? How can you be a more 'careful' programmer? Any systems that you use? How do you review your own code?
Thanks a lot for your time
Context: 2 years of java/JS. 2.5 months at new job - python + django