Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Are they ‘what?’ or ‘wat?’ comments? Maybe that’s the difference?


what, opposed to ‘why’ or ‘how’


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"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: