psychology // May 14, 2024

Avoiding the Sunk Cost Bias Trap as a Programmer

Learning to accept that you will invest time in things that will end up being the wrong direction and how to think about the lost time in a positive light.

Avoiding the Sunk Cost Bias Trap as a Programmer

The other night, I spent about two hours implementing drag and drop on a task list feature only to erase all of the work I did and start over.

That hurt.

But, after nearly two decades building software, the pain was short-lived. Why? Well, as you gain experience building stuff, you learn that sometimes—anecdotally, quite often—you end up having to scrap work. In this case, scrapping the work and trying a different approach illuminated an issue in Joystick that I wouldn't have found otherwise.

Yes, throwing work away sucks. The time you put in was time you can't get back. It's easy to just say "well, at least I have a result, so I guess I'll just keep it." Early on, I'd say this and just keep whatever half-working solution I had.

But as my skillset evolved, I learned that the difference between an unserious programmer and a serious programmer is the willingness to throw out ideas. It's also the difference between programmers who advance vs those who plateau and stagnate.

It turns out, this is the mark of anyone who's serious. Jim Keller, the engineer responsible for several major advancements in CPU architecture over the last 30 years says it best:

"If you look at leaders of companies that had really good long-term success, every time they saw that they had to redo something, they did."

No matter how much time was invested, accept that if it isn't right, it shouldn't be in your program.

Some might argue that this thinking is a luxury. "But my manager wanted this yesterday!" Maybe they did. But part of becoming a pro is learning to confidently back up your choices with a clear why.

Why you spent the time. How you found out that it wasn't the right path. Why you made the choice to pivot or reverse course. Pure, raw ownership over the decision rooted in a desire to get it right as opposed to seeking appeasement.

This is hard. You will piss others off. You will piss yourself off. But, if you can get good at knowing when it's time to fold em' and try a different approach, you'll find the quality of your work multiplying rather quickly. Long-term, too, you'll find that your work is something other serious people seek out and reward you for.

The next time your sunk-cost bias kicks in, make sure to ask yourself "is this really the right way...the best way?" If not, wipe the board and do it again.

Written By
Ryan Glover

Ryan Glover

CEO/CTO @ CheatCode