Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the idea is that if you use single quotes for strings, you don't have to escape the double quotes that are often found in html. '<p id="foo">something</p>'

But the same goes for something like "you can't do that"

I guess it just depends what you don't want to escape. For Google, the more probable scenario was probably the former.



The former isn't a very good reason: HTML/XML accept both double and single quotes, so "<p id='foo'>something</p>" would work equally well.


yes, but it is much more common for double quotes to be used in html




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: