News for hackers. Stuff that matters.
Re:Ask HN: Do you ever go back and admire a piece of code yo... by CmdrKrool on Friday May 08, 2020 @11:32AM (#23115892)
Yes, the greatest value add of comments for me is the potential time-saving, in the ideal case (re)acquainting you with a large work of code by guiding your attention from the top-down - firstly to orient you in the broad structural aspects, then to fly you smoothly down towards the minutae of reading individual lines of code.

This does sometimes entail a few 'what'-style comments, so I'm disappointed to regularly read of programmers that have apparently taken up arms against them.

Re:Ask HN: Do you ever go back and admire a piece of code yo... by t-writescode on Friday May 08, 2020 @10:07PM (#23121571)
Are they ‘what?’ or ‘wat?’ comments? Maybe that’s the difference?
Re:Ask HN: Do you ever go back and admire a piece of code yo... by whynaut on Friday May 08, 2020 @10:29PM (#23121693)
what, opposed to ‘why’ or ‘how’
Re:Ask HN: Do you ever go back and admire a piece of code yo... by t-writescode on Saturday May 09, 2020 @03:21AM (#23122909)
No, I understand that part; but, I think of a "what" comment as "incrementing value of X"

a "wat" comment, like the meme, is more of a "this is a really weird blob of code that might be obvious when you break the whole thing apart; but, what it's doing is _this_ this is the implementation of it because we have a complicated data structure that's connecting all these pieces"