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

RE: (jcwren) RE: The path to mastery

by lindex (Friar)
on Aug 06, 2000 at 18:29 UTC ( #26428=note: print w/ replies, xml ) Need Help??


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

Why not write ultra tight code if you document it well?
If your co-workers read your documentation then they will understand
Maybe even learn something?
Just a thought



lindex
/****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/


Comment on RE: (jcwren) RE: The path to mastery
Download Code
RE: RE: (jcwren) RE: The path to mastery
by larsen (Parson) on Aug 07, 2000 at 12:02 UTC
    Why not write self-documenting code?
    In my opinion programmer's goals should be: efficience, maintainability, readability. Not necessarily in this order :)
    Artificial languages are supposed to be used to communicate with humans, not only with machines.
    see you
    Larsen
      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

        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://26428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-12-28 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls