Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re**4: Non-English posts on Perlmonks

by Anonymous Monk
on Jul 13, 2003 at 21:46 UTC ( #273833=note: print w/replies, xml ) Need Help??


in reply to Re**4: Non-English posts on Perlmonks
in thread Non-English posts on Perlmonks

I've never been a fan of comments, and tend to view them as crutches.

Oh, to be young again... ;-)

  • Comment on Re: Re**4: Non-English posts on Perlmonks

Replies are listed 'Best First'.
Re: Re: Re**4: Non-English posts on Perlmonks
by tilly (Archbishop) on Jul 14, 2003 at 01:05 UTC
    When I was younger than I am now, I had the same condescending attitude that you do towards people who comment lightly or not at all.

    But then I learned from painful experience (and advice from wiser programmers) that comments have about as many bugs as code when first written, but only the bugs in code get caught, and going forward only the code is maintained. Therefore in maintainance programming, don't trust comments.

    But if the maintainance programmer ignores your comments, then attempting to make bad code OK by adding comments is worse than useless. You may get warm fuzzies from having the comments, but the energy would have been better spent making the code better...

      So because some programmers aren't bright enough to maintain their code properly (which includes comments), comments aren't as useful?

      Can you (with a straight face) seriously make that argument and say the flexibility of Perl is good in the same sentence?

      Obviously if comments are poorly written, and poorly maintained they're not going to help. Same with poorly written and poorly maintained Perl code, but you don't see us stop using Perl do you?

        So because some programmers aren't bright enough to maintain their code properly (which includes comments), comments aren't as useful?
        You misunderstood my point if you think that this is just an issue of programmer intelligence.

        Code has an inherent advantage over comments in that it is actually executed, which means that obvious nonsense (eg syntax errors) is caught immediately and massively improves the chance that other errors (eg stupid thinkos of various kinds) are caught as well. Comments don't get this kind of testing, and so lack this valuable feedback.

        Can you (with a straight face) seriously make that argument and say the flexibility of Perl is good in the same sentence?
        Yes, I can. A standard solution to the issue that I gave above is to design code so that it is, in so far as possible, a comment on itself. Along this line, quite a few of the syntactic constructs in Perl are present explicitly so that you have a choice about how to say things - and can therefore choose the one which will emphasize to another reader what you mean. (I know that Larry thinks this way because his various speeches and Apocalypses have hit directly on this exact point.)

        Therefore the flexibility of Perl is good in part because it assists in addressing the issue above about comments.

        Obviously if comments are poorly written, and poorly maintained they're not going to help. Same with poorly written and poorly maintained Perl code, but you don't see us stop using Perl do you?
        If you fail to understand the intrinsic maintainance issues that comments have, then I can guarantee that your comments will become poorly maintained.

        For a more detailed explanations of what I think about commenting, see Re (tilly) 2 (disagree): Another commenting question,. Unfortunately that discussion was carried out half in posts, and half in private chats. The private chats was a more positive conversation, and I regret that the public record that was left is more negative than it needed to be...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://273833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2020-02-24 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (104 votes). Check out past polls.

    Notices?