> since I didn't write the code, in order to understand it I have to read it. But gaining understanding that way takes longer than writing it myself does.
I remember reading Joel Spolsky's blog 25 years ago, and he wrote something like: "It is harder to read code than to write code." I was quite young at that stage in my programming journey, but I remember being simultaneously surprised and relieved -- to know that reading code was so damn hard! I kept thinking if I just worked harder at reading code that eventually it would be as easy as writing code.
“Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. ...[Therefore,] making it easy to read makes it easier to write.”
― Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship
Also:
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?
— Brian Kernighan: The Elements of Programming Style, 2nd edition, chapter 2
In summary: write simple code, it's easy to read and understand - by future you who forgot why you did something and others.