Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Style Best Practices

by BuddhaNature (Beadle)
on Apr 27, 2004 at 20:30 UTC ( [id://348635]=perlquestion: print w/replies, xml ) Need Help??

BuddhaNature has asked for the wisdom of the Perl Monks concerning the following question:

Other than perlstyle are there any good places to find suggestions and ideas regarding style-related best practices? Either external links or local nodes would be a great help.

Thanks in advance.

-Shane (just trying to better his coding self)

Replies are listed 'Best First'.
Re: Style Best Practices
by perrin (Chancellor) on Apr 27, 2004 at 20:57 UTC
    The best writing I've seen on this subject is in the book Perl Medic, by Peter Scott. I would recommend it over the Effective Perl book, which is more useful for learning how to use some of the trickier parts of Perl (map, pack, etc.).

      I'll second the Perl Medic recommendation. Loads of relevant information.

Re: Style Best Practices
by pzbagel (Chaplain) on Apr 27, 2004 at 20:38 UTC

    Effective Perl Programming: Writing Better Programs With Perl by Joseph N. Hall and Randal Schwartz

    This book is more about finesse with Perl rather than style per se. But it discusses important topics which definately relate to style (like how using $_ can simplify your code immensely and make it more readable.)

    Later

Re: Style Best Practices
by benrwebb (Scribe) on Apr 27, 2004 at 20:46 UTC
    If you haven't yet, check out Chapter 24 of Programming Perl by Larry Wall, Tom Christiansen and Jon Orwant.
Re: Style Best Practices
by thor (Priest) on Apr 27, 2004 at 21:10 UTC
    Regardless of what you come up with as your "style guide", enforce it with perltidy. It has so many options, I think that it'd be hard to find something that you would want to do that it is unable to handle. I wrote my .perltidyrc a couple of years ago, and haven't looked back since. Plus, if this is part of a large project, you could have perltidy be part of the automated check-in process.

    thor

Re: Style Best Practices
by tilly (Archbishop) on Apr 28, 2004 at 01:50 UTC
    I've been saying it for years, but it is still good advice. Pick up the book Code Complete and read it. Carefully.

    I don't care that it is not a Perl book. I don't care that Perl is not used in any of its examples. It is still relevant.

    If you're willing to wait, you could wait until the second edition comes out this summer and read that instead. Or in addition if you've already read it by then.

      I second that. It should be mandatory reading for every programmer.
      In this context it might be worth noting that there will be a 2nd edition of Code Complete very soon (June 2004).

      -- Hofmator

        Did you read my third paragraph?
      Plenty available at half.com

      The PerlMonk tr/// Advocate
Re: Style Best Practices
by kutsu (Priest) on Apr 27, 2004 at 20:57 UTC

    One simple and free solution would be to Super Search for Perl Style, Coding Style, Programming Style, etc.... For example a very quick search for Perl Style got me Perl Style Guides for Large Projects, and I know there are many more

    "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Re: Style Best Practices
by Anomynous Monk (Scribe) on Apr 28, 2004 at 06:45 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://348635]
Approved by Corion
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found