Sometimes, of course, you write code that is just right, and it still is after a year.
But, yes, that "What-was-I-Thinking" moment happens on a fairly regular basis. ;-)
Sometimes, of course, you write code that is just right, and it still is after a year.
But, yes, that "What-was-I-Thinking" moment happens on a fairly regular basis. ;-)
Insist the person documents all the quirks and gotchas in a block of code or library. Sometimes the embarrassment at having to justify it will prompt them to fix the problem, other times they (or I) will realize that it literally takes less time to fix the issue than it does to apologize for it.
Something about the writing process unearths simpler solutions to tricky sounding problems. Possibly the same phenomenon that TDD tries to exploit.
In the grand scheme of things you'd hardly notice that it takes me a little bit longer. Over time those improvements become habituated and I just do a lot of them while I'm coding. Especially when I get stuck.
It's not in like cleaning while you cook. Once you have a tempo it hardly takes any longer to prepare the food but you don't leave yourself with a mess that discourages you from doing it again.