4 ms·
No, it's not. See my post downstream. Every JSON file is a valid YAML file. Example: using PyYAML to parse the JSON file from above: >> import yaml >> val
by icebraining 11y ago
No, it's not. See my post downstream. Every JSON file is a valid YAML file.
Example: using PyYAML to parse the JSON file from above:
>> import yaml
>> val = yaml.load('{"extensions": ["cpp", "cc", "cxx", "c++", "h", "hpp",
"hxx", "h++", "inl", "ipp"]}')
>> print val
{'extensions': ['cpp', 'cc', 'cxx', 'c++', 'h', 'hpp', 'hxx', 'h++', 'inl', 'ipp']}
- BillinghamJ 11y agoWow, interesting. Why do people use YAML syntax then? I find JSON much simpler, less ambiguous. Much prefer JSON for configuration over YAML.
- icebraining 11y agoMostly, I'd say people who prefer YAML-specific syntax (myself included) think it's generally more readable and easier to write. It's also easier to keep clean commits (no trailing comma issue). That said, I think http://json5.org/ http://json5.org/ is a decent middle term.