Single, Double, and Curly Quotes

Here are my opinions on when you should use different kinds of quotation marks in code and prose.

  • Single: '
  • Double: "
  • Curly: , , ,

Single-Quotes

Efficiency and clean looks matter most with programming languages (Python, JavaScript, etc.). Use single quotes here.

// JavaScript
alert('Hello, world!');
// CSS/Sass
@import 'partials/breakpoints';

Note the 'example' within the Django code block nested in HTML here:

<!-- HTML/Django template -->
<a href="{% url 'example' example.id %}">{{ example.id }}</a>

Double-Quotes

HTML should use double-quotes. It’s more public (view source), so it should feel a little more official. HTML feels old fashioned in a way that befits double quotes.

<img src="http://example.com/fish.png" alt="A fish" />

Curly-Quotes

Any text intended solely for reading should use proper curly quotes.

“Dodging and burning are steps to take care of mistakes God made in establishing tonal relationships.”

Ansel Adams

“Life is full of pain. Let the pain sharpen you, but don’t hold on to it. Don’t be bitter.”

Trevor Noah

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s