4 ms·
> 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 gui
by masklinn 11y ago
> 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.
- applecore 11y agoCoffeeScript follows a more common style: double-quoted strings for interpolated values and single-quoted strings are literal.
- rhgraysonii 11y agoAlso: Ruby/Opal (also transpiled)