Double Quotes vs Single Quotes – Difference and Comparison – Diffen

Double

quotation marks are used to mark speech, for titles of short works such as television programs, and articles, such as scary quotes to indicate irony or an author’s disagreement with a premise. In the United States, Canada, Australia, and New Zealand, the general rule is that double quotation marks are used to denote direct speech.

Single quotation marks are used to include a quote within a quotation, a quote within a title, or a title within a quotation.

In the UK, the use of single or double quotation marks to mark direct speech depends on the editorial style, but both are acceptable. Quotation

marks are a

pair of symbols, and the text in question must be enclosed inside. When a quote is “opened” to mark the beginning of a direct speech, title, or irony, it should close with the same punctuation (i.e., “She walked her dog today,” not “She walked her dog today” or “She walked her dog today“).

In the video below, The Grammar Girl explains the use of single vs double quotes: Historical quotation marks

were first cut from metal for typesetting purposes in the mid-16th century. Prior to that point, direct speech in texts was marked by a change in the source, or simply indicating the speaker. In 1749, they were used prodigiously in various texts, and at that time, single quotation marks (also called quotation marks) were most often used.

Space

For single quotes, some editors will insert an extra space between the double quotation mark and the single quotation mark inside it, i.e., “Out of nowhere, Tracey told me, ‘I don’t like you anymore,'” Mark said sadly

. Use with other punctuation marks

The punctuation

rules for when quotation marks are used also differ between American and British styles.

In both

British and American punctuation styles, question marks and exclamation points that apply to the entire sentence are placed outside quotation marks: for example, did you just say, “How old are you?” When question marks and exclamation points are applied only to the quoted part of the sentence (such as No, she said, “How cold are you?”), they are placed in quotation marks.

Whether single or double quotation marks, commas and periods usually go outside the subject matter cited in British punctuation: for example, “I watered your flowers today,” Tracey said. In the American punctuation style, the comma will be in quotation marks: for example, “I watered your flowers today,” Tracey said.

Smart

quotes or direct quotes?

There is a perpetual debate among writers and grammarians about whether one should use “straight quotes” (two small lines) or “smart quotes” (the curly ones that look like inverted quotation marks“) in formal writing. Some think either style is fine as long as you consistently stick to one throughout your document, and if you use curly or smart quotes, make sure they’re facing the right direction.

Others argue that smart quotation marks

should be used for speech and as apostrophes, while straight quotation marks are only used to denote feet and inches.

Quotes in other languages

While we are more familiar with English quotation marks [], the punctuation mark of the quote is different in several languages:

  • German, Bulgarian, Czech and Slovak [“]
  • French, Spanish, Italian and Greek quotes with [‘… »]
  • Hungarian, Romanian, Polish and Croatian with [“]
  • Traditional Chinese and Japanese use another symbol [].

Read more on Wikipedia: Use of non-English quotation marks

. In computer

programming

, quotation marks are often used as delimiters around strings. In HTML, CSS, and JavaScript code, single and double quotation marks are interchangeable. XML and XHTML require the use of double quotation marks to delimit element attributes.

Single

vs double quotes in PHP

There is only one difference in the use of double quotes vs. single quotes when delimiting strings in PHP. When using double quotation marks, the string is not used as-is, but is scanned for $var or {$var} to replace variable names with their values. When using single quotation marks, no such substitution is made.

This difference has led some programmers to believe that using single quotation marks offers faster performance. However, there is no significant performance benefit of using single quotes in PHP.

References

  • Wikipedia: Quotation marks
  • Citations and punctuation: American vs. British rules – uhv.edu