Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: On comments

by Tux (Abbot)
on Dec 20, 2010 at 08:38 UTC ( #877968=note: print w/replies, xml ) Need Help??

in reply to Re: On comments
in thread On comments

I both agree and disagree. I notice that the more experienced a programmer is, the more useful the comments in the code are.

A good programmer codes in a way that comments on how the current code works doesn't need any comments, nor do the variable names or their purpose(s).

What does need comments is the reason why the current code uses a specific algorithm or - maybe double as important - why a certain other, maybe more obvious, algorithm was not used.

Those are the most valuable types of comments in code IMHO. Even if the original reason turns out not to be true after 15 years of hardware development or different compiler optimizations.

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^3: On comments
by BrowserUk (Pope) on Dec 20, 2010 at 09:08 UTC

    If you look above, I was very careful to say "(Most)"; and "Some comments are useful.".

    My contention is that they are far rarer than most people believe. Please also see Programming *is* much more than "just writing code".

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      I didn't miss that. What I'm (also) trying to say is that (new) programmers have to learn along the way what comments are most useful 5 years from now. When you start programming, you have a really wrong approach in that aspect learned at school.

      Enjoy, Have FUN! H.Merijn

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2021-03-01 05:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found