Archive for the ‘Perl Best Practices’ Category

PBP: 035 Single-Character Strings

Monday, September 1st, 2014

Much like empty strings, the PBP suggests being careful of how you write single character strings.  It points out a number of them it considers “ambiguous”, including: (more…)

PBP: 037 Constants

Saturday, August 30th, 2014

Mr. Conway’s book suggests that constants are good but “use constant;” is the wrong way to go about them.  It suggests the Readonly module.  Later commenters have suggested Const::Fast instead.  Feh, I say. (more…)

PBP: 034 Empty Strings

Thursday, August 28th, 2014

The PBP suggests never using “” or ” for empty strings, and using q{} instead.  Because clearly that’s so much more readable. (more…)

PBP: 033 String Delimiters

Monday, August 25th, 2014

The PBP suggests using interpolating string delimiters only when they’re needed.  How much of my time do I get to waste changing single to double quotes because there’s a contraction in a message, or the other way because there isn’t? (more…)

PBP: 032 Utility Subroutines

Thursday, August 21st, 2014

Here’s where the PBP tells you to prefix “internal use only” subroutines with an underscore.  Why it calls them “utility subroutines” I don’t know. (more…)

PBP: 031 Ambiguous Names

Monday, August 18th, 2014

Some words are easily misinterpreted, and the PBP suggests avoiding them for names.  I don’t agree with one of the things it suggests you always avoid, though… (more…)

PBP: 030 Ambiguous Abbreviations

Thursday, August 14th, 2014

This boils down to “don’t abbreviate when it isn’t clear.”  The response to this should be, “Well, duh!” (more…)

PBP: Too Many Posts? Feedback, please!

Tuesday, August 12th, 2014

A commenter on another one of the PBP posts pointed requested I stop posting so often.

Rather than have a discussion there in comments where it is easy to get lost, I thought I’d start a new post and ask: Is it too many posts?  Is is useless?  Should I stop? (more…)

PBP: 029 Abbreviations

Monday, August 11th, 2014

Abbreviations are hard, and the PBP suggests making them by keeping the start of each word, rather than other habits like chopping out vowels or other ways to shorten thing.  It has an effective reason why in a ftnt. (more…)

PBP: 028 Capitalization

Thursday, August 7th, 2014

The PBP suggests using different formats of case to help explain what a thing is. (more…)