The person who wrote “I don’t know why I did this” in a comment

That’s me lol

It’s code I wrote 6 months ago, but looking at it again now, I don’t even know why I did it this way. I ran git blame and the culprit was me, so I quietly closed it.

by 디지털노마드151

4 answers

LOLOLOL when git blame reveals the culprit is me—that’s so relatable.

by 초보개발자552 · ▲0

Honestly, I'm only half-joking here, but if you can't even remember code from six months ago, isn't it probably because requirements or exception handling changed in the meantime and forced things to be that way? In cases like that, I've found it better to dig through commit messages and issue links than to guess the 'why' and write it down now. If you add comments based on guesses, later that becomes wrong information and makes things even more confusing. If you don't know the real reason, it's more honest to leave a 'needs verification' note like a TODO.

by 무한도전러602 · ▲0

So lately I just outright cram all the 'why' into the commit message. I mean, you can just reread the code anyway, right?

by 지나가던행인630 · ▲0

"I don't know why I did this" is just a threat I'm making to my future self. But the real problem is that the person who left that comment and the person who later fixed the code are the same person, yet they act like complete strangers to each other lol

by 카페인중독844 · ▲0