DEV Community

Cover image for Throw away your code
Matt Goodwin
Matt Goodwin

Posted on • Edited on

Throw away your code

"Throw away your code if you can't implement the feature in a day" - Toni Lütke, Shopify CEO

When I first heard this phrase in conjunction with the claim it helped Toni write the best code he has ever written during the early days of building the Shopify platform, I was confused.

I've had many features that have taken days and days, sometimes weeks, to implement... line after line of code. Toni's approach was very different, if you can't complete the implementation in a day - delete the source code, leaving behind the unit tests and try again tomorrow.

I stared at my phone, the reel repeating itself over and over again, trying to understand the comment. As I mulled over the phrase it began to make a lot of sense.

The idea is creating a time limit to write the code and forcing yourself to start again if you exceed the limit. Limiting the time limits the amount of code you can write, resulting in more efficient code being written. Throwing away code forces you to write better code.

It's a fascinating concept and I'm looking forward to trying it out, will I improve the code that I write.

What are your thoughts on this concept?

Top comments (0)