News for hackers. Stuff that matters.
Re:Ask HN: Do you ever go back and admire a piece of code yo... by hermitdev on Friday May 08, 2020 @02:45PM (#23118051)
At a previous job, when I transitioned off a few projects that I had solely worked on for 7 years, I warned the dev taking over from me: I don't usually comment my code, but when I do, you'd better pay attention.

I think in one of them, only a single source file (C++) had comments, and there were more comments than code. I was explaining an intricate locking pattern around a data cache.

Like you suggested, I added the comments after I'd done the work because it was a work in progress. I added the comments because it was a very fragile piece of code and sensitive to changes (e.g. really easy to cause a deadlock or race condition if changed).

There are no comments on this comment yet.