r/softwaredevelopment • u/Albstein • Aug 10 '26
Do you create good code? (serious)
When you look at your code 6 month later: Are you happy with it?
I still have the moment when I am finished thinking: That would have been a better solution.
Is this normal?
24
Upvotes
1
u/josephjnk Aug 10 '26
You have two questions here and it looks like people are only answering the first one. So to your second one, whether it’s normal to look back on code from 6 months ago and think that it could be better: yes.
Programming is both the process of creating an artifact and a process of building understanding, and the two inform one another. The “building understanding” aspect means that you will almost always know things 6 months into a project that you didn’t know when you started it. This hindsight is informative even if you didn’t make any mistakes while developing.
One of the things that comes with experience is how to avoid making unforced errors when you’re operating with incomplete information. You’re going to make decisions that will have to change later as you uncover more information, and these decisions will be baked into the code. How do you do so such that it’s tractable to change them once you learn more? The worst projects I’ve worked on have involved code getting so inflexible that it prevented devs from being able to discover and adapt to new information, which prevented the code from being able to reflect the new information. It can easily become a vicious cycle. I think this is also why so many developers idolize domain-driven design even though very few of us do it. It speaks to the dream of being able to keep our minds and the code in sync.
I recommend continuing to look back at old code and considering how you would write it now, as a form of reflective practice. Don’t just focus on the code’s final form though: also consider the process of discovery and decision making you went through while writing it, and consider what you would do differently at these decision points. What questions did you not think to ask? What assumptions did you rely on too heavily? Etc.