DEV Community

Cover image for Throw away your code
Matt Goodwin
Matt Goodwin

Posted on • Edited on

1

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?

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️