Ten Essential Development Practices Design the module's interface first. [Chapter 17: Interfaces] Write the test cases before the code. [Chapter 18: Test Cases] Create standard POD templates for modules and applications. [Chapter 7: Boilerplates] Use a revision control system. [Chapter 19: Revision Control] Create consistent command-line and configuration interfaces. [Chapter 14: Command-Line Structure, Chapter 19: Configuration Files] Agree upon a coherent layout style and automate it with perltidy. [Chapter 2: Automated Layout] Code in commented paragraphs. [Chapter 2: Chunking] Throw exceptions instead of returning special values or setting flags. [Chapter 13: Exceptions] Add new test cases before you start debugging. [Chapter 18: Debugging and Testing] Don't optimize codebenchmark it. [Chapter 19: Benchmarking] | Ten Essential Coding Practices Always use strict and use warnings. [Chapter 18: Strictures, Warnings] Use grammatical templates when forming identifiers. [Chapter 3: Identifiers, Booleans, Reference Variables, Arrays and Hashes] Use lexical variables, not package variables. [Chapter 5: Lexical Variables] Label every loop that is exited explicitly, and every next, last, or redo. [Chapter 6: Loop Labels] Don't use bareword filehandles; use indirect filehandles. [Chapter 10: Filehandles, Indirect Filehandles] In a subroutine, always unpack @_ first, using a hash of named arguments if there are more than three parameters. [Chapter 9: Argument Lists, Named Arguments] Always return via an explicit return. [Chapter 9: Implicit Returns] Always use the /x, /m, and /s flags, and the \A and \z anchors. [Chapter 12: Extended Formatting, Line Boundaries, Matching Anything, String Boundaries] Use capturing parentheses in regexes only when deliberately capturing, then give the captured substrings proper names. [Chapter 12: Capturing Parentheses, Capture Variables] Never make variables part of a module's interface. [Chapter 17: Interface Variables] |
Ten Essential Module Practices Write tests using the Test::Simple or Test::More modules. [Chapter 18: Modular Testing] use English for the less familiar punctuation variables. [Chapter 5: Punctuation Variables] Use named constants created with the Readonly module. [Chapter 4: Constants] Use the "non-builtin builtins" from Scalar::Util, List::Util, and List::MoreUtils. [Chapter 8: Utilities] Use IO::Prompt when prompting for interactive input. [Chapter 10: Simple Prompting, Power Prompting] Use the Carp and Exception::Class modules to create OO exceptions that report from the caller's location. [Chapter 13: Reporting Failure, Exception Classes] Use the Fatal module to make builtins throw exceptions on failure. [Chapter 13: Builtin Failures, Contextual Failure] Create aliases using the Data::Alias or Lexical::Alias module. [Chapter 6: Necessary Subscripting] Use Regexp::Common instead of writing your own regexes. [Chapter 12: Canned Regexes] Use the Class::Std module to create properly encapsulated classes. [Chapter 16: Automating Class Hierarchies, Attribute Demolition, Attribute Building] | |