News for hackers. Stuff that matters.
Re:Why was Pinball removed from Windows Vista? by RegEx on Tuesday December 18, 2012 @04:48PM (#4939779)
This point gets brought up a lot, but I'm not going to complain at all. In fact, just 5-6 months ago I used to be one of those programmers who would do

    # gets the xml
    def get_xml():

It took comments like this to help me realize just how silly the whole thing was. Now I write as much self-documenting code as I can, but comment as needed.
Re:Why was Pinball removed from Windows Vista? by Funnnny on Wednesday December 19, 2012 @05:22AM (#4941971)
Sure.

Comment should be "why I did this", and code should be "how I did this", some people just write in "what did I do" and walk away thought they have comment

Code took from a project I'm working with:

  #End of package
Re:Why was Pinball removed from Windows Vista? by StavrosK on Wednesday December 19, 2012 @06:38AM (#4942144)
I generally become aware that I should leave a comment whenever I write something that is less than trivial (but exactly less than trivial) to write/understand. Longish list comprehension? Summarize what it does. Nested function calls? Summarize why. Etc.
Re:Why was Pinball removed from Windows Vista? by chii on Wednesday December 19, 2012 @08:57AM (#4942556)
> Comment should be "why I did this", and code should be "how I did this"

the problem starts when the 'why' doesn't match the 'how'...which one is "correct"?