4 ms·
I would disagree that JSON is more readable than STON, if only for that fact that all keys have to be quoted in JSON, but I agree with the rest of your comment.
by wtetzner 10y ago
I would disagree that JSON is more readable than STON, if only for that fact that all keys have to be quoted in JSON, but I agree with the rest of your comment.
- rurban 10y agoI was referring to the # pound syntax for fields. fields can be used with a . or - prefix much more pleasingly to the eyes. An untrained eye would take the # for comments. TestDomainObject { #created : DateAndTime [ '2012-02-14T16:40:15+01:00' ], #modified : DateAndTime [ '2012-02-14T16:40:18+01:00' ], #integer : 39581, #float : 73.84789359463944, #description : 'This is a test', #color : #green, #tags : [ #two, #beta, #medium ], #bytes : ByteArray [ 'afabfdf61d030f43eb67960c0ae9f39f' ], #boolean : false }
- s-phi-nl 10y agoYour untrained eye took the # for comments, but I'm not sure that generalized to anyone's. Plenty of languages use # for other things: Smalltalk uses them for symbols, Clojure uses them for reader macros, OCaml uses them for method calls, Haskell can use them as an arbitrary operator, Lua uses them for length, C and C++ use them for compiler directives. See https://en.wikipedia.org/wiki/Number_sign#In_computing https://en.wikipedia.org/wiki/Number_sign#In_computing for a list. Admittedly, Python, Bash, Perl, and Ruby use # for comments, so you do have a point, especially since Python is such a common teaching language.
- rurban 10y agoNo, the point is the clutter. A pound # is the most intrusive ascii character, with about 85% black. Older languages were critised to use $ with about 55% black as prefix. It's like writing in ALL-CAPS.
- yAak 10y agoThis is a very valid critique in terms of graphic design. (For anyone confused by the mention of graphic design: it's all about communicating information through visuals.)
- optimuspaul 10y agoOh, I thought they were hashtags, I was gonna see if they were trending on twitter.
- deleted 10y ago[deleted]
- yellowapple 10y ago"An untrained eye would take the # for comments" \begin{pedantry} I'd argue that an untrained eye would take the # for ordinary syntax noise, since such an eye would have no notion of a "comment". A trained eye might be confused by that, but only if it was trained against an environment that uses # for comments. \end{pedantry}
- rendaw 10y agoSince this looks like another human readable encoding shootout, I humbly offer luxem [0] which allows unquoted keys. Simpler than JSON, much simpler than JSON5, and probably as powerful as STON. [0] https://github.com/rendaw/luxem https://github.com/rendaw/luxem