DEV Community

Discussion on: What’s your favorite piece of code that you had to throw away?

Collapse
 
andreasjakof profile image
Andreas Jakof • Edited

I threw away lots of code that was as good as it gets to my abilities at the time. But since I am still learning every time I do something in code (mostly intentionally) I never feel any regret or remorse, when deleting old code of mine.
Even though I might have done it similarly, I never get attached emotionally to code I produce. I code, because I like solving problems and the challenges that force me to learn.
So even though I threw lots of code away in my personal or professional life. I never felt, that I am destroying something invaluable. It‘s a means to an end. And if that end is reached, it can go.
Maybe IF I wrote an AI sometime in the distant future, that shows human treats, I could not, but so far... I always loved hitting the delete button.

But if I had to pick something, I'd choose a BER-Parser-Implementation, that was never used. I just wanted to see, if I can do it and used it at one point in my own code, which was superfluous, when we chose Azure-ADFS for authentication.
Others prefered the one from BouncyCastle or just dont want to have anything to do with certificates.

And I guess, there is another exception, which I wrote about already here: dev.to/andreasjakof/brilliant-but-...
It was wrong to do it this way, but still ...