Like everyone else, I began my career "adding new capabilities" on other people's code - I did "maintenance."
Like everyone else, I never admitted I was doing something so humble at my job. How I hated a lot of the code I had to slog through! But a funny thing happened to me on the way to my big fat career: I learned things from the "lousy" code I maintained.
I like to think - in other topics - that anyone can speak the truth, even the humble can correct the exalted. After all, Balaam was reproved by an ass!
But I don't think I quite expected this to happen with crufty, buggy, limited old code!
Well, a funny thing often happens as you're escorting someone else's work to the bit bucket. You get an insight into their thinking. However much you disagree, that person attacked the problem with a perspective different from yours.
The interesting part comes when they come to a part of the problem where their solution completely diverges from yours. From your perspective, they've painted themselves into a corner. How they get out of the corner you avoided can be terrifically illuminating. They can uncover pieces of the problem that you might never have discovered yourself.
The 'style' might be atrocious and exasperating. Repetitive streams of drek might be mind-numbing. Comments are misleading. But even these can make you wiser about the code behavior, the program behavior, the programmer - and ultimately, the actual problem.