DEV Community


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)

moopet profile image
Ben Sinclair

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

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

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?

miketalbot profile image
Mike Talbot ⭐

I own that t-shirt for sure :)

ingosteinke profile image
Ingo Steinke

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.

ben profile image
Ben Halpern

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

alesten profile image

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.

mistval profile image

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.

danielrendox profile image
Daniel Rendox

I feel like there is actually nothing wrong in that

efpage profile image

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

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.

citronbrick profile image

I've done this quite sometimes.
Even though, it might have been a better solution to keep it in a different git branch, instead of another folder.