Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

RE: RE: RE: (jcwren) RE: The path to mastery

by Adam (Vicar)
on Aug 08, 2000 at 00:59 UTC ( #26653=note: print w/ replies, xml ) Need Help??


in reply to RE: RE: (jcwren) RE: The path to mastery
in thread The path to mastery

I strive to write self documenting code, but I also like to fill in with helpful comments. When I use a code snippet that I had to look up, I usually put a comment in explaining it. This leads to the funny situation of going back to maintain a bit of code written months prior, and finding comments like, "@_ is the input array to the subroutine" just before a line like "my ( $name, $rank, $serialnumber ) = @_;". I didn't know that when I wrote it, but I do now. Someone new to perl will appreciate that line when they have to work on the code, but an old timer would think it was written by an idiot. (No, not an idiot. A newbie... but sometimes we mistake ignorance for idiocy)

But yes, writting self documenting code is very important. Thats why I use constant.pm instead of writing the routines myself and why I didn't use a regex in my answer to One for the regexp fans


Comment on RE: RE: RE: (jcwren) RE: The path to mastery
RE: RE: RE: RE: (jcwren) RE: The path to mastery
by neophyte (Curate) on Sep 26, 2000 at 19:22 UTC
    When you write any documentation you have to assume some level of information that the future reader might have on the subject. Obviously this is not only a problem with Perl.
    My first comments are nearly useless to me now (or just plain stupid). But on the other hand those scribblings are self-documenting because they are that simple. Nowadays, though I am far from beeing really good, I want to include pod in my code and when I think the code may be used or reviewed by a complete novice I add comments of the redundant form.
     
    I wrote I want to, but it still is an excercise in self discipline. It is far quicker to just enter a few comments.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-09-17 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (100 votes), past polls