Ask HN: Have you ever “lost” a clever bit of code you weren't able to reproduce?
Discussing with a friend on Twitter I was reminded that as a lad I once wrote an AI routine for haggling with a shop owner in an RPG that remains probably the best implementation I've seen.
Unfortunately, my brother then proceeded to power-cycle the drive with the disk still in, corrupting the file ... I was never able to reproduce the code because I couldn't remember exactly how I'd done it once I saved it.
Have you ever done something like this?
11 comments
[ 3.3 ms ] story [ 39.2 ms ] threadSadly I had to scrap the project the next day since it did'nt compile anymore :)
Then he'd wake up and forget the lot.
The code is still in my PC, but I moved overseas, and didn't bring my PC along.
All that's left of all this is the compiler code (decompiled using cavaj), and screenshots of the IDE (that I called Rex).
It was the most complicated piece of software I'd written at that point of time, and there's little left to show for it.
Here's a link to the project page, btw. And don't judge. This is from a long, long time ago.
http://justaddhotwater.webs.com/oojasic.htm
More often than not, it turned out that the code wasn't clever so much as I had remembered it being clever. The code itself often didn't even do what I thought it had.
I actually did rewrite it, and I remember noticing how much better the code was. I didn't have to think about game design at all, just about the code. In fact it was around that time that I finally understood what GOSUB was for. I wouldn't be surprised if it was that rewrite that brought the realization.