次の方法で共有


Comments

If only people spent as much time writing comments as they did speaking to the evils of comments.  Everything from useless, inaccurate, to many comments make code unreadable, you should code better ... etc. 

I haven't ever looked at a piece of code and thought "wow, way too many comments" or "that code would be beautiful if it weren't for the comments."

Do the next guy a favor, comment your code.

Comments

  • Anonymous
    August 26, 2008
    PingBack from http://hubsfunnywallpaper.cn/?p=2348

  • Anonymous
    August 26, 2008
    The comment has been removed

  • Anonymous
    August 26, 2008
    @int19h Only one word to describe that bad situation: wow :(

  • Anonymous
    August 26, 2008
    I hear ya.  However, unit tests are pretty good "comments" too.

  • Anonymous
    August 26, 2008
    I can think of a time when comments are superfluous and just plain pointless: I was asked to comment the functionality of PInvokes into standard Windows functions (such as GetWindowText, CreateEvent, etc) a month ago. What's even worse is that I used your PInvoke Utility to mass import a bunch of them. My reaction: "... so, have you heard of MSDN or Google?"

  • Anonymous
    August 26, 2008
    @Koush, The PInvoke tool comments are as verbose as possible.  Mainly because I wrote it as a tool to help people understand the issues involved with PInvoke.  Giving a full type history hit this band.   At the same time it's generated code so turning off comments is easy.  I've gotten several requests to add the MSDN information for the particular function.  I'm definately looking at doing that.  

  • Anonymous
    August 26, 2008
    Plenty of comments have led me astray, causing me to waste time trying to merge the text laid out in the comment and what the actual code seemed to be doing, only to find out the comment is wrong, formulated in a way that seems confusing, or using vague terminology I don't get. Comment = more stuff to keep up to date, and there's no compiler aiding you, to keep the text in check with the code.