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

You missed the "/s" bit, I presume? But you certainly have a point.

If JSON still fits somewhere - that's nice, it means the issue is just about YAML syntax (which is a matter of personal preference, really; but I thought we left all the entertainment of putting Pythonistas and Perl Hackers in a virtual ring in the past decade, somewhere next to /.'s grave).

If JSON feels worse - it means YAML's syntax is not a problem, it's a symptom of YAML being misplaced to express something other than a simple data structure.



No /s, either JSON is OK for you or it's not, and if not a slightly nicer looking but way more error prone JSON doesn't solve your problem.

1. If you're making a user-facing program you give them a nice settings menu and store the config as whatever.

2. if it's developer-targeted software, and your config starts approaching a scripting language you don't encode arbitrary computations in YAML (or XML, Microsoft), but rather let the user use a scripting language and preferably you don't invent a new one.

We always cry about fragmentation and complexity in software and yet even in the rare cases when we have universally agreed upon formats/standards we will still go out of our way to make a new one for the amazing benefit of significant whitespace.


> If JSON feels worse - it means YAML's syntax is not a problem

Only if you can say the same of json5.

There are plenty of cases where you have a simple data structure, but having comments and multi-line strings is important.




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

Search: