Re:YAML: probably not so great after all (2017)
by Alex3917 on Wednesday June 20, 2018 @02:58PM
(#17358547)
I actually use Python a lot more than Javascript. That's why the double quotes and the no trailing comma are always what get me.
Especially since leaving the trailing comma is considered the best practice in every other language.
Re:YAML: probably not so great after all (2017)
by weberc2 on Wednesday June 20, 2018 @03:10PM
(#17358671)
JS added support for a trailing comma, and single-vs-double quote is a contentious topic in Python land!
Re:YAML: probably not so great after all (2017)
by pphysch on Wednesday June 20, 2018 @02:59PM
(#17358559)
Python dicts are a lot closer to JSON than YAML.
The real schism here, IMO, is Programmer Intuitive vs. Natural Language Intuitive.
Re:YAML: probably not so great after all (2017)
by geoalchimista on Wednesday June 20, 2018 @03:09PM
(#17358659)
Second this. I have used Python dict to write the default config file and JSON Schema to validate a user-supplied config file, which worked quite well in regard of that purpose.
Re:YAML: probably not so great after all (2017)
by dokem on Wednesday June 20, 2018 @03:03PM
(#17358606)
Python objects and JSON are practically identical.
Re:YAML: probably not so great after all (2017)
by weberc2 on Wednesday June 20, 2018 @03:12PM
(#17358693)
In what sense could this be true? Python objects support a whole host of behavior; JSON is a data format. Python dicts might be a closer analogy except Python keys can be anything that is hashable while JSON requires strings, and of course Python dict values can be any Python value; not just the JSON analogs.
Re:YAML: probably not so great after all (2017)
by dokem on Wednesday June 20, 2018 @04:42PM
(#17359565)
I think you are purposely mis-interpreting me. Python dicts are practically, syntactically identical to JSON. Yes, python dict values can be any python value the same way JSON in JS can be any JS value. Point being, someone coming from python would see JSON as identical to a python dict. We can run around in semantic circles all day.
Re:YAML: probably not so great after all (2017)
by weberc2 on Wednesday June 20, 2018 @05:22PM
(#17359913)
> I think you are purposely mis-interpreting me.
You misrepresented yourself by saying "object" when you meant "dict" and saying "practically identical" when you meant "vaguely syntactically similar". I wasn't trying to nitpick your semantics; I just had no idea that "Python objects are practically identical to JSON" meant "Python dicts are to Python what JSON objects are to JS, oh and also Python dicts have some syntactic similarlities to JSON" or whatever.
Intuitive usually means "close to what I'm used to".