in reply to Re: Documenting Methods/Subs
in thread Documenting Methods/Subs
There is no such thing as too much documentation, no matter how redundant it may be.
Whew! Obviously you haven't seen the code I have.
use warnings; # turn warnings on use CGI; # use Stein's CGI.pm for parsing params my $q = new CGI; # create the CGI.pm instance # get the customer's name (in the name parameter) # place in in variable $customer_name my $customer_name = $q->param("name") # if the customer's name is "Bobby" # print "Hi Bobby" if ($customer_name eq "Bobby") { print "Hi Bobby\n"; } else { # if not, print "You're not Bobby" print "You're not Bobby\n"; }
Get the point? This completely distracts from the code and takes way more time on the part of the programmer.
As for subs, I say one comment directly above them. Anymore and the sub is too long and should be broken into multiple subs.
|
|---|