> I’ve mentored juniors and the common trait is that they rush to code without understanding, then they spend days trying to fix things.
As a senior (of sorts), even though I don't quite rush to code, I often find myself starting to code something 'naively', while my understanding is lacking (typically in a tangled, inconsistent and poorly documented codebase). But what probably sets me apart from juniors is how I handle getting stuck, or rather what it means for me to try to "fix things". I spend time thinking about what I've discovered that has gotten me stuck, what I must take into account, and how I should alter my approach (or refactor the existing code to be more accommodating).
Sometimes I manage to formulate ideas apriori that reduce the frequency of my getting stuck, and/or the extent to which I need to backtrack. But - not always.