The Coder-Journalist Problem

Two facts:

  1. A.P. Style and just about every other grammatical reference for US English advocates placing a comma within quotes. I was a high-school journalist and continue to use AP Style when editing.
  2. PHP and every other programming language I’ve ever used require strings (that’s coder-talk for some text) to be wrapped in quotes. Function parameters need to be separated by commas.

See where this is going? When coding, I constantly find myself putting the comma correctly within the quotes and having to go back and change it to the outside. The reverse is usually not an issue: when I write, I don’t habitually put the comma outside quotes. I guess that means I’m more of a writer than a coder?

One solution: move across the pond and use British English, where commas and other punctuation go outside quotes! < Gasp! > What savages!

Leave a Reply

You must be logged in to post a comment.