3 ms·
Isn't a path just a slash-delimited array? To me, it's more readable as a path since we all deal with those everyday in our address bar. The machine can make i
by andrewstuart2 12y ago
Isn't a path just a slash-delimited array?
To me, it's more readable as a path since we all deal with those everyday in our address bar. The machine can make it an array if it wants, but I'd prefer to see it in one line.
I do wish they'd gone with backslash as an escape character. Don't know what possessed them to pull ~0 and ~1 out of their butts.
- philh 12y agoThe problem with backslash is that it's already used by the JSON parser. If you happened to have a key `\/`, that would need to be written "\\\\\\/".
- andrewstuart2 12y agoThat kind of inflation is just a side effect of format encapsulation. You're representing a path format inside the JSON format, both of which need to escape their delimiters if they're to be taken literally. I still think a single consistent escape character is cleanest. The same argument applies when I have any defined escape character or delimiter that I want to use as a literal. I'll admit it's less human readable if you have a key `\/` but I can't think of many good reasons you'd want that as a key, which is what makes them good escape characters and delimiters.