News for hackers. Stuff that matters.
Re:On Comments in Code by forgotmypw17 on Tuesday June 15, 2021 @11:20PM (#27524528)
>Many times I've gone back to code I'd written previously, it seemed overly complicated, I replaced it with a simpler version... that failed... that reminded me that was what I'd tried originally and then replaced it with the more complicated version for a good reason.

>So now I have a new rule: every time I try a simple approach and it fails and I replace it with a more complicated one that works, I add a comment explaining the previous strategy and why it didn't work.

My strategy is to comment out the failed attempt and leave it there for next time.

There are no comments on this comment yet.