DEV Community

Talia
Talia

Posted on

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.