Published: May 18, 2022 • 2 min read
I used to have a bad habit when working alone: I’d start a feature, begin questioning my progress, and start over from scratch. Sometimes more than once.
The result? Wasted energy, abandoned code, confusion about what I had and hadn’t implemented, and repetitive rework.
This post is a collection of thoughts on this practice. They are:
Code Retreats is a programming community that encourages throwing away first drafts. Starting over can be helpful when you’re learning a new technique or trying to improve.
If something doesn’t feel right, you can throw it away. You don’t have to keep trying something that isn’t working. Persistent not-working is often a fantastic indicator that an approach is flawed.
Conversely, I’ve argued that when building, the best thing you can do is get it working, then make it well-factored.
For me, this means getting the interactions working, and then applying the design. I don’t solve both problems well at the same time.
When you’re feeling the urge to start over, this could save you a lot of work: create a well-named branch, atomically commit your changes, and push to the remote.
First, create a branch with a memorable name, like
Then, break down your changes into small commits like: “Widen button container” or “add new route.”
Finally, push to your remote.
Many times, when I succeed at building something on my second or third attempt, I realize that I need some of those commits again. When I have them, and they’re well-named and small, I can cherry-pick them onto my branch.
$ git cherry-pick <sha-of-useful-commit>
When you’re stuck and ask for help, it’s always better to bring something to work with. In my experience, senior people love to critique and have less patience starting from scratch.
Even if they start your pairing session with “this is bad, let’s start over”, you’re showing that you’ve done the work and aren’t waiting to be rescued.
And with an existing implementation, your pair might be able to teach you something or more quickly arrive at the right answer by seeing your wrong one. As they say, “the fastest way to get the right answer to a question is to post the wrong answer on the internet.”
How do you approach starting over? Let me know in the comments.
✉️ Get better at programming by learning with me. Subscribe to Jake Worth's Newsletter for bi-weekly ideas, creations, and curated resources from across the world of programming. Join me today!
Blog of Jake Worth, software engineer in Maine.