Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: MVC Catalyst Architecture - City, State Zip locator

by Anonymous Monk
on Jul 21, 2008 at 19:02 UTC ( [id://699116] : note . print w/replies, xml ) Need Help??


in reply to Re: MVC Catalyst Architecture - City, State Zip locator
in thread MVC Catalyst Architecture - City, State Zip locator

I'm a regular commenter when using PHP and if I knew Perl at all I would comment it out as well. Thats one thing that has been so difficult with this script and the models with it. Thanks for your help!

Replies are listed 'Best First'.
Re^3: MVC Catalyst Architecture - City, State Zip locator
by Your Mother (Archbishop) on Jul 21, 2008 at 23:40 UTC

    I'd say, general rule, avoid comments in Perl in favor of Pod. Comments have their place (and opinions differ widely) but I personally only like to see them when they illuminate some data or business logic oddity and as you'll read here, they can lie or be out of sync just as often as they help. Well chosen variable and sub names are better than comments most of the time.

    Here are examples of both. See perlpod for more.

    # Perl only has one real comment style, this is it. # Leading pound/number sign. =head2 get_zip L</get_zip> takes blah, blah, and returns blah, blah, blah. Pod has more syntax and is readily convertible to a number of formats +from RTF to WikiText and HTML and plenty in between. =cut sub get_zip { my $self = shift; # ...

      I've never heard of Perlpod before - actually, alot of this is new to me. I can understand bad commenting - just never thought anyone would do something like. Rather tactless. I will look into perlpod now that I'm starting to learn Perl.