Ah, source code. Usually, and especially if written by someone else, it's awful. If you suffer from even a slight proclivity to perfectionism, you will inevitably try to refactor it. While doing so, you will equally inevitably realize there's even bigger fruits to reap a little further up, and before you know it you're rewriting the entire application. Now, the younger me might have said, “obviously that was necessary!", utterly ignoring the fact that the end result performs equally well at best, with a ridiculous amount of time having been wasted on playing a zero-sum game.
But even without taking that work time constraint into account, there's a much more fundamental realisation to be made: You will never outpace the amount of “bad” new code being written.
Even more generic: You can't win against entropy.
In nature, there is no such thing as the complete lack of movement, as “perfection”.
Yet I still strive to achieve perfection in everything I do: Despite I know it's ultimately futile.
Looking back, this has caused a lot of frustration for me, both professionally and in private. A lot of bitterness stems from my inability to accept subpar performance, rough edges or mistakes, both in myself and in others.
Therefore, I've decided to not only accept but embrace imperfection for what it is: perfectly normal.
So to avoid going mad over this, I've decided on a strategy I'd like to employ: Isles of sanity.
Such an isle is a small part of a larger construct, say a single method in a piece of code or my apartment. It's a fragment of the world I can control, a thing I can mold into whatever I consider sane. Key to this strategy is accepting the shape of this isle to be fluid: The code might be removed tomorrow, the apartment swapped for another or shared with someone else.
I like to imagine a circle as drawn by a computer: Consisting of pixels, of squares, it can't ever be a real circle but merely an approximation.
As it is a very huge circle, I only ever get to work on a small part of it. So while I might manage to give that part a neatly rounded contour, I will never be able to extend that to the whole circle. Even if I tried, entropic forces would tear down any progress I made.
That, however, is the advantage of my mental model. By accepting this fact and only focusing on the small arc of the circle right in front of me, I can come to terms with myself and the chaos around me.
I'm not quite sure whether that will work out. We'll see!