5 ms·
You use JavaScript a lot more than python, right? Intuitive usually means "close to what I'm used to".
by dorfsmay 8y ago
You use JavaScript a lot more than python, right?
Intuitive usually means "close to what I'm used to".
- Alex3917 8y agoI 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.
- weberc2 8y agoJS added support for a trailing comma, and single-vs-double quote is a contentious topic in Python land!
- pphysch 8y agoPython dicts are a lot closer to JSON than YAML. The real schism here, IMO, is Programmer Intuitive vs. Natural Language Intuitive.
- geoalchimista 8y agoSecond 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.
- dokem 8y agoPython objects and JSON are practically identical.
- weberc2 8y agoIn 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.
- dokem 8y agoI 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.
- weberc2 8y ago> 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.
- dokem 8y agoYou sure are difficult. There is a non-trivial set of text that is both valid JSON and a valid python dict. Many people would consider the two very similar.