Which type of quotation marks are the best or the right ones to use, the single or the double ones? I tend to use double quotation marks because I find those easier to find and use on my Scandinavian keyboard (they do not share the same key) but I would love to hear what you guys suggest.
For example in Python:
print("Hello world!")
print('Hello world!')
Quotation marks, single or double? Which ones do you use and why?
Top comments (10)
Single- and double quotes behave differently depending on the language you're using. For example, in PHP, variables are interpreted inside double-quotes:
So single-quotes are I suppose infinitesimally faster. Don't worry about that.
For general text, use double-quotes, because you're way more likely to use a single-quote as a substitute for an apostrophe in blocks of text than you are to include a quotation.
Single and double quotes mean totally different things in languages like C and C++.
The OP's question is ill-formed.
Just use the default settings of Prettier and stop overthinking things.
Single quotes (in English) are typically used for a quote within a quote. For example: I told my friend, "According to California State University San Marcos (my online source), 'Single Quotation Marks are used to indicate dialogue within another quotation.'"
Double quotes are perfectly fine, I do use them from time to time on my own blog posts. Any quotes of interest can be technically represented using double quotes. However, with the Markdown format, one should use ">" symbol as shown below.
I perfer single
As long as an English Teacher is not having a look at your code, it's fine. Jk, You can use any of them if you are using programming languages like Python, JS, etc. What I did when I shifted from Java, I used single quotations for characters and double quotations for strings 'coz of my habit. And, now I use the one that does not let me overthink.
Single
Some comments have been hidden by the post's author - find out more