Author Archive

Writing 2014-06-12

Tuesday, September 23rd, 2014

hw20140918-01.jpg (more…)

Writing 2014-06-11

Tuesday, September 23rd, 2014

hw20140917-01.jpg (more…)

Writing 2014-06-10

Tuesday, September 23rd, 2014

hw20140916-01.jpg (more…)

PBP: 042 Heredoc Indentation

Monday, September 22nd, 2014

The Best Practices suggest that putting a heredoc in a deeply nested function looks funny because it has to be left-justified, and suggests creating a “theredoc” by writing a function that does nothing besides evaluate and return the heredoc. (more…)

PBP: 041 Here Documents

Thursday, September 18th, 2014

The PBP tells us to use here documents when a multi line string is too long.  It suggests two lines is long enough for a single string, and anything longer should be a here document. (more…)

PBP: 040 Multiline Strings

Monday, September 15th, 2014

The PBP suggests breaking your strings on any embedded newlines so they look in code something like they’ll look when output. (more…)

PBP: 039 Long Numbers

Thursday, September 11th, 2014

Great big numbers full of digits are hard to read and be sure they’re right, so the PBP suggest using the magic underscore in the numbers to spread them out and make them more readable. (more…)

PBP: 038 Leading Zeroes

Monday, September 8th, 2014

Best Practice: Don’t pad decimal numbers with leading zeroes. (more…)

PBP: 036 Escaped Characters

Thursday, September 4th, 2014

The PBP suggests using named escape characters instead of hardcoding ASCII values.  It has some reasonable examples, such as this: (more…)

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