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

> We ended up choosing double quotes based on the fact that JSON already made that decision for us: it requires strings be double-quoted.

My personal style guide is to copy Erlang: double quotes for text, single quotes for programmatic strings (atoms/symbols). The single quote is slightly more convenient to type on a qwerty keyboard, but text regularly contains single quotes (apostrophes). It also provides a semantic visual shortcut.



CoffeeScript follows a more common style: double-quoted strings for interpolated values and single-quoted strings are literal.


Also: Ruby/Opal (also transpiled)




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

Search: