5 ms·
You'd use escapes: "You can use both \" and ' to delimit a string"
by kangalioo 5y ago
You'd use escapes:
"You can use both \" and ' to delimit a string"
- weird-eye-issue 5y agoThat was their point, you inevitably have to escape one or the other, so just pick one
- samhw 5y agoMy only disagreement is that you imply that this is no better than plain old JSON – I think it's positively _worse_. It makes it difficult to remember which of the two quote marks to escape, without checking the beginning of the string to see what quote marks were there (and this difficulty exists not only for humans but for machines, which introduces more complexity in parsers). The benefit of JSON is that it's simple, opinionated, and pretty. Putting bells and whistles on it ruins the very ethos of JSON. If you want JSON++, use XML or Jsonnet or whatever.
- weird-eye-issue 5y agoI didn't imply that, in fact my comment agrees with what you are saying. Did you reply to the wrong person?
- samhw 5y agoHaha, I only meant that as a "I agree with you, but I'd go even further" preface. In hindsight, this being HN, I should have been more precise!