Google-apps
Hoofdmenu

Post a Comment On: C0DE517E

"Good comments, bad code"

3 Comments -

1 – 3 of 3
Anonymous Anonymous said...

I don't agree, dear deadcode (or deadbeef ^_^)

Obviously self-commenting code is great (and commenting it is a bad habit, comments will go out-of-sync with code at first code change) but there are things you cannot explain without a comment.
For example whenever there are two or more algorithms to do the same thing, a comment should be placed to explain your choiche!

So, dear readers, keep commenting your code! ^_^

February 2, 2008 at 2:20 PM

Blogger DEADC0DE said...

Of course you're right. Mine was just an oversimplification, done to make a point about some wrong habits that you often see like writing "dothis(10, true /* do not overwrite */);" that are really awful

February 3, 2008 at 11:04 AM

Anonymous Anonymous said...

I still agree with the original post, though. It doesn't say at all "don't comment a clear code" ... rather try to read it more like "if you have more equivalent choices, choose the one that requires the fewer comments".
That still includes commenting why a choice was made, dear ugasoft ;).
That's my opinion, anyway :)

February 22, 2008 at 6:15 AM

You can use some HTML tags, such as <b>, <i>, <a>

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot