3 ms·
Once I wrote non-prototype, non-throwaway code to start a large project. After about a month of work on that, due to a dead disk and my own stupidity, I lost al
by hirundo 7y ago
Once I wrote non-prototype, non-throwaway code to start a large project. After about a month of work on that, due to a dead disk and my own stupidity, I lost all of it. It was throwaway code after all. I was about as upset and angry as I ever get.
Then I sat down and rewrote it in about a week, and it was much better the second time, and turned out to be the start of a code base that's still in daily use and evolving 25 years later.
The lesson I took from that is, don't write throwaway code, but given a chance, throw it away anyway.
- mgkimsal 7y agoI've had a couple of times where I've been called in to lend a hand on code I wrote 10-15 years earlier. I'm always surprised that it's still going, but perhaps shouldn't be (and may not be in the future). There's sometimes good reasons to upgrade/Greenfield - at some point, in one case, there were structural issues that prevented much more 'refactoring' without heavy work, and 'start over and migrate data' was a more cost effective option. But, until you've done this for 20 years, it's sort of hard to imagine going back to code you wrote 20 years earlier to work on it again. Many of those "best practices" take on a much more concrete meaning. In many cases, I've been ... moderately proud of how well some decisions stood up, and in other cases I remember exactly what I was doing when I cut a particular corner (was late getting home that night, needed to get back home before a winter storm, etc).