Think about Loose Coupling | |
PerlMonks |
Re: Another commenting question,by japhy (Canon) |
on Mar 15, 2001 at 23:31 UTC ( [id://64759]=note: print w/replies, xml ) | Need Help?? |
At my job, we recently started a style guide for our code. One point of order is the documentation we put in our code. We are putting Pod in all our modules, and even some of our CGI programs (that accept an insane number of CGI parameters).
In addition, we are moving towards commenting blocks of code, to increase readability, and to keep everyone on the same level -- just because I wrote the code doesn't mean the guy next to me will never touch it, or maybe even modify it. But documenting your code line-by-line is not efficient. If you have to do that, you're not using descriptive variable and function names. They have names for a reason -- you can give them names that fit their functionality. One of the most informative comments I wrote today was an ASCII depiction of two images I was creating with GD. The variable names are helpful, but it's difficult to get a grasp of what the coordinates mean without some graphical representation of the figure: And then I went on and used those alphabetic labels when I created the polygons:
japhy -- Perl and Regex Hacker
In Section
Meditations
|
|