Jens Oliver Meiert

Apocryphal Apostrophes

Post from January 8, 2017, reflecting Jens the , or perhaps .

For JavaScript, W3Schools (caution) says:

The backslash escape character turns special characters into string characters:

var x = 'It\'s alright';

Same for my darling Enki, noting:

str1 = 'I\'m a string.;
str2 = "I'm a string.";

str1 and str2 output the same string but str2 is easier to read since it doesn’t require an escape character in I'm.

For Python, Learn Python the Hard Way says:

[…] you escape double-quotes and single-quotes so Python knows to include in the string. Here’s an example:

"I am 6'2\" tall." # escape double-quote inside string
'I am 6\'2" tall.' # escape single-quote inside string

For Oracle PL/SQL, Tech on the Net says:

When the apostrophe/single quote is in the middle of the string, you need to enter [two] single quotes for Oracle to display a quote symbol. For example:

SELECT 'He''s always the first to arrive'

(This could go on.)

The examples aren’t perfect, the sources, neither, but what’s wrong in this picture?

What’s wrong is what typographers preach for ages: Use real apostrophes.

(On macOS with US keyboard layout you should be able to type a apostrophe through option + shift + ]. On Windows, use something like alt + 0146.)

Yes, we’ll still need to escape characters—perhaps the examples simply aren’t great—and tutorials to say how to. But through proper punctuation do not only our designs benefit but does also our code get a little simpler.

I'm feeling lucky, I’m feeling luckier.

Figure: Google knows.

See the 2009 punctuation cheat sheet for more characters and locales.

About the Author

Jens Oliver Meiert, photo of July 27, 2015.

Jens Oliver Meiert is a philosopher and developer (Google, W3C, O’Reilly). He experiments with arts and adventure. Here on meiert.com he shares and generalizes and exaggerates some of his thoughts and experiences.

There’s more Jens in the archives and at Amazon. If you have any questions or concerns (or recommendations) about what he writes, leave a comment or a message.

Read More

Have a look at the most popular posts, possibly including:

Or maybe say hi on Google+, Twitter, or LinkedIn?

Looking for a way to comment? Comments have been disabled, unfortunately.

Found a mistake? Reward! Email me, jens@meiert.com.

You are here: HomeArchive2017 → Apocryphal Apostrophes

Last update: January 8, 2017.

“Everyone has the right to freedom of information and communication.”