June 25, 2021

Single or Double Quotes??

Hola. 👋🏾

This is a conversation I often have with myself whenever looking at a client codebase. Or any codebase really. Lol. I myself prefer to use single quotes. Is it more performant? Probably not. Does it matter what language I'm writing in? (Which at this point is either JavaScript or Ruby) Nope. I just like single quotes. Something about them feels...cleaner. And if we ever work on the same codebase you'll learn that I'm pretty serious about linting. Lol.

Double quotes are still necessary though for string interpolation. That doesn't deter me from wanting single quotes everywhere though. It's not that much context switching honestly.

Will there still be an issue when you'd like to include an apostrophe and you don't want to use escape characters? Not if you wrap the sentence in backtick's instead. 😏 Which look much more similar to single quotes anyway. So it still passes the eye test in my book.

What's your preference?? Write me on Twitter and lets have a conversation!

See you next time. 🙃