Live data from Hacker News

My Case Against Code Comments

jakusys.de

21–23 of 23 posts

Re: My Case Against Code Comments

#21
post #19

Earlier quoted context omitted.

I don't think anyone is advocating for comments explaining that $i is a loop index.

I don't think so either. But that's what comes out of Thou Shalt Comment. And yes, I have seen loop index comments. Haven't you? I think we'd both agree if we saw a good comment. I just want to focus on the 'good' part rather than the 'comment' part.

Of course I've seen loop index comments, and redundant variable declaration comments, and all manner of bad commenting. Thing is, I'll take a bad comment over blank code any day.

Crap comments warn me ahead of time that I'm dealing with a developer who's either too inexperienced to know how to comment well or too sloppy to do a good job at it and in either case I need to be paying closer attention to their code than I might otherwise.

Re: My Case Against Code Comments

#22

Nobody writes clearer code than Peter Norvig, yet he usually gives everything a line-or-so doc comment -- e.g. http://norvig.com/lispy2.html . That's pretty far from the comments-should-be- rare credo. I like it. My actual argument for that style sans appeals to authority: http://stackoverflow.com/questions/499890/what-is-your-perso...

Worthy of a standalone post somewhere so I can add it to my bookmarks. :)

Re: My Case Against Code Comments

#23

Nobody writes clearer code than Peter Norvig, yet he usually gives everything a line-or-so doc comment -- e.g. http://norvig.com/lispy2.html . That's pretty far from the comments-should-be- rare credo. I like it. My actual argument for that style sans appeals to authority: http://stackoverflow.com/questions/499890/what-is-your-perso...

Worthy of a standalone post somewhere so I can add it to my bookmarks. :)

Thanks -- maybe I'll get to it soon.
Post reply on HN