News for hackers. Stuff that matters.
Re:Why aren't you commenting your code? by da_n on Monday March 25, 2013 @10:44AM (#5437198)
Yeah, but what about

    // $set $foo to $bar
    $foo == $bar; 
    
    // print out value of $foo
    echo $foo; 

    // is $bar the same as $foo? if so, return true, otherwise return false
    if ( $bar === $foo ) { // check if the same
        return true; // great, it's true!
    } else { // here we check if it isn't true
        return false; // nope, not true, let's return false
    }
I have nothing against comments where something needs to be documented, but not everything needs comments as most code is essentially self-documenting.

Edited for clarity.

Re:Why aren't you commenting your code? by andreasvc on Monday March 25, 2013 @11:25AM (#5437478)
It's completely uncontroversial that those comments are unnecessary. When you see them you remove them; no reason not to write any comments at all.
Re:Why aren't you commenting your code? by sethetter on Monday March 25, 2013 @11:59AM (#5437704)
I expected it to be a given that these kinds of comments are unnecessary. It's better to comment on the "why" than the "how" or "what". Comments are useful when they help explain a piece of code's integration into the rest of the system. Why is it there in the first place?