Author Archive

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.

(more…)

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.

(more…)

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

PBP: 021 Lists

Monday, July 14th, 2014

Lists need to be formatted to be readable.  The suggestion is to always use parenthesis, indent after a parenthesis, and line things in columns, all with trailing commas.

The book provides clear examples, which I won’t duplicate here. (more…)

PBP: 020 Ternaries

Thursday, July 10th, 2014

The book talks about how confusing the ternary operator can be and how much of a mess it can make.  I’m almost surprised it doesn’t say, “Don’t use it.”

It suggests columns instead, with the condition, then the positive result.

(more…)

Writing 2014-06-05

Saturday, July 5th, 2014

hw20140605-01.jpg (more…)

Writing 2014-06-04

Saturday, July 5th, 2014

hw20140604-01.jpg (more…)

Writing 2014-06-03

Saturday, July 5th, 2014

hw20140603-01.jpg (more…)

Writing 2014-06-02

Saturday, July 5th, 2014

hw20140602-01.jpg (more…)