Real programmers don’t use comments

This is nice. Jay Kimble talked to some senior DBA’r who claimed that comments are useless. If you can’t read his code and understand it, you shouldn’t be in it.

Jay asked us how we feel about this and should post our feelings on our blogs. I’ve gotten the link from Steve Eichert and already have given my opinion there, but I’ll repost some here.

About the “I prefer no comments over bad comments”. I come across comments like the next one all the time!

// Begin loop
while ( …

There’s another thing to the “no comments over bad comments”, because the type of comments I just mentioned irritate the @)#$*#^& out of me and I start throwing with keyboards, books and sometimes even monitors when I see something like that.
As if I don’t understand we’re going into a loop of some kind. You (#&$(# moron!

Please people, describe what the loop is for!!! Or any other code, for that matter.

I really do think comments can add a lot to your code. If written in what it does functionally. I can see we’re going into a loop, do some if’s or a switch or that we’re loading a document or something. But why, why are we doing this? Explain!

You may also like...

4 Responses

  1. Jan Schreuder says:

    I totally agree. I’ve seen plenty of code such as this one.

    // JS – Start change

    some code

    // JS – End change.

    I don’t care who changed it.

    Another thing that always annoys the s**t out of me is complete procedures that are in the code as comments. Usually, the argument is that the developer in question is not sure the procedure should be there at all. Another argument is that it supports some functionality that had to be disabled and the developer is afraid it has to be re-enabled at some later stage. DUH, that’s what source safe is for!

  2. Paul Gielens says:

    I have the habit of writing just as much comments as actual code. Guess this is mostly due to me writing business logic 90% where the complexity increases. My golden rule is… someone reading through my code should not have to fallback on design documents to accomplish general understanding.

  3. @Jan: That’s something I’d really like to know. Ofcourse we do have SourceSafe most of the times, but most of the time, when I add just a few lines and something really changes, I try to add comments that explain who build it (that would be me), what the situation was before and what it does after the change. But that’s mostly only when I change something in business rules and I’m on a development team or have to work with someone else’s code.

    That methods that are all commented out is really annoying indeed.

    @Paul: I don’t really get the 90% sentence. Do you mean you only write business logic 90% of the time? Writing extra comments where business logic is, is indeed a good thing.

    And about the design documents, I don’t think developers should not have to fall back on design documents. The thing is though, that most of these design documents don’t say shit. You really need a good designer and he/she should be on a team so the design was checked. Most people don’t write that good of designs. Not where I come from, anyway. 🙂

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.