DEV Community

Talia
Talia

Posted on

8 2 2 1 1

Have you had moments like this?

You realize you've gone down the completely wrong path in your code and basically have to scrap what you've been doing and start over...but you feel bad about all the work you've done and tell yourself there's a slim chance it could be used someday, and so you save your work in another file?

Top comments (11)

Collapse
 
moopet profile image
Ben Sinclair

You're describing what I usually refer to as 4:30PM.

Collapse
 
wraith profile image
Jake Lundberg

Absolutely! I've done this more times over the years than I care to admit (if I did, I might cry!). It's almost always helpful to analyze your decisions to see where you went wrong though...so...

Looking back on the work you did. In the beginning, what made you decide to go down the road you did? Was there information that pointed you in that direction?

Collapse
 
miketalbot profile image
Mike Talbot ⭐

I own that t-shirt for sure :)

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

Even if you'll never use it in production, it's good material for learning and optimizing future strategies. I usually create an alternative git branch to save such a branch.

Collapse
 
ben profile image
Ben Halpern

Absolutely. I really try to focus on what I learned in the process.

Collapse
 
alesten profile image
Cathrine

Oh yeah. It took me years to stop hoarding pieces of my code. But now I try to clean it up right away. It's nearly never practical to go back to your old code and try to make sense of it.
Anyway, it's never a waste of time. It's called a learning process.

Collapse
 
mistval profile image
Randall

Yes I do this all the time. Except I often forget to save the new file after pasting my code, and if I do save it, I'll never use it anyway.

Collapse
 
danielrendox profile image
Daniel Rendox

I feel like there is actually nothing wrong in that

Collapse
 
efpage profile image
Eckehard

You shoud not complain about the work you lost, but be happy about the time you saved using a different approach.

Collapse
 
nasheomirro profile image
Nashe Omirro

I do the opposite, I throw away that code and then actually need it afterwards so I shoot myself in the foot twice.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay