4 ms·
An annoying half-solution that breaks down as soon as you encounter content with both. Better imho to have one way and become good at it. I think I might even p
by usrusr 5y ago
An annoying half-solution that breaks down as soon as you encounter content with both. Better imho to have one way and become good at it. I think I might even prefer trailing commas to be mandatory.
- staticassertion 5y agoIt solves the problem like 99% of the time in my experience. It's very rare that I have content with both single and double quotes.
- usrusr 5y agoThat's exactly my point: 99% solutions are the worst. Every 99% solution will eventually find someone relying on it, willingly or not. And it's always someone else cleaning up the mess (or failing to find the cause).
- n_e 5y agoThere is no mess. The 99% case is a pretty string. The 1% case is a string with escaped delimiters.
- kwhitefoot 5y agoWhy does it need commas at all? What purpose do they serve?
- kevinmgranger 5y agoIt's either commas or significant whitespace. No matter what you'll find someone who hates one or the other.
- kwhitefoot 5y agoBut everyone puts the whitespace in anyway so why not just make it significant?
- phyrex 5y agoThey don’t serve one. Clojure uses only white space for distinguishing items in lists and hashmaps and after a short period of “this is weird” you embrace it and wonder why you ever needed commas at all
- usrusr 5y agoChecksums, basically, drawing a line between random bytes and structured JSON in a way that comes at zero cost for a human mind (arguably less than zero). We might as well leave out all closing tokens at the end of the stream, in a way those are completely redundant but still worth it for the warm, fuzzy feeling of knowing that you haven't just read a truncated stream.