Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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']}


Wow, interesting. Why do people use YAML syntax then? I find JSON much simpler, less ambiguous. Much prefer JSON for configuration over YAML.


Mostly, 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/ is a decent middle term.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: