Sometimes I look at code that I've written that has been in production for years and it's so transparently wrong I can hardly believe I wrote it. I'm looking at how I persist group DMs to the local database right now and it's wrong on like 3 levels. Incredible.
Discussion
I was just talking to some people I used to work with almost a decade ago.
The system they maintain still has a piece of my logic in it, which is one of the most embarrassing things I ever did.
I made every mistake you could make, I think, in the way that I outlined it, in the way that it works... in the lack of any sensible comments.
To this day, I'm not 100% sure why it works. And yet, it's still there.
I suppose for it running fall asleep for nearly a decade says something?
I think what it ends up saying loudest though is "nobody touch this thing! It can't be understood, and it's absolutely critical!"
Reminds me of some classic stories from https://thedailywtf.com/
I wrote systems which run for more then 15 years without any modifications other then security patching. critical systems.
the code is ugly, sometimes clearly contains bugs I can't now unsee, but hey... it works š¤£
You didnāt write it wrong. You wrote it with the vision you had at the time. Fresh eyes donāt lie. They just show you how far your threat model has evolved.
Man thatās how I look at code from 3 weeks ago š
š
The solution is simple: don't look at the code.