Archive for the ‘Perl’ Category

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…)

PBP: 027 Underscores

Monday, August 4th, 2014

The PBP suggests using underscores to separate phrases in a variable name.  Since we can’t use spaces or hyphens, as English (and many other languages, honestly) would have us do, we have to use something else.

The PBP suggests an underscore.  Problem: I dislike underscores. (more…)

PBP: 026 Arrays and Hashes

Thursday, July 31st, 2014

The PBP suggests naming for hashes and arrays; hashes in the singular, and arrays in the plural. (more…)

PBP: 025 Reference Variables

Monday, July 28th, 2014

The PBP suggests suffixing reference variables with _ref.  The book notes in a footnote that this is the only type of “Hungarian notation” suggested in the book.  That’s good, because Hungarian notation is a bad idea. (more…)

PBP: 024 Booleans

Thursday, July 24th, 2014

The PBP suggests that boolean variables and subroutines should get special naming consideration, and be named in ways that read well.  That may involve giving them names like “is_whatever” or “has_whaterver” or “can_whatever”, so that they make contextual sense.


PBP: 023 Identifiers

Monday, July 21st, 2014

This section of the PBP is a long one, and goes into great detail about how to think about naming important parts of your programs.  It covers explicitly modules/namespaces, variables (several types of them), and functions.

I thought, at first glance, it was way too picky and specific, but the more I read it, the more I liked it.


PBP: 022 Automated Layout

Thursday, July 17th, 2014

The Best Practice is to get a tool to do the work for you; it’ll be regular, and not spend your time doing it.

My only concern is that Mr. Conway says, “You can take ugly code like this and turn it into something readable.” where the “readable” code isn’t, to my mind, that much better.  Spaces around the parens and an extra blank line do not readable code make. (more…)