YAPC::NA 2004 Perl Style Guides for Large Projects #18

Slash Style Guide: Style 1

  • much is taken from perlstyle

  • uses both object-oriented and procedural programming

  • Variable names

    • typically, lower case variable names with underscores separating words

    • use English hints:

      • Generally, variables form a noun

      • Arrays and hashes should be plural nouns

      • Don't use "_ref" to name references

      • references tell you whether they point to a scalar or a list

        @stories     = (1, 2, 3);      # right
        $comment_ref = [4, 5, 6];      # wrong
        $comments    = [4, 5, 6];      # right
        $comment     = $comments->[0]; # right

<< Previous | Index | Next >> Copyright © 2004 Daniel Allen