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

Without the static typing and IDE completion support thanks to XML Schema.

I will take XML over JSON every time I am the one setting the rules.



Most editors I use (e.g. Visual Studio Code) provide validation and completion of JSON using JSON Schema - which works pretty well.

I much prefer JSON to XML for most scenarios.


How do you validate comment locations?


Well, as JSON doesn't have comments that's not really a problem :-)

NB Not having comments is perhaps the biggest problem I have with JSON when it is used for things like configuration files that will be hand crafted. 99% of the JSON I work with is generated and consumed programmatically so comments aren't really an issue.


Isn't it very easy to add comments support to JSON? Why not just agree to allow /* ... */ anywhere inside it and add this feature to JSON parsers? Honestly I didn't even knew this is not supported to the moment. If nobody bothered so far, doesn't this mean only a tiny portion of people needs this?


My favourite way to go about comments is to have them inline, as first class data members. (Not that I think either JSON or XML are good ideas. Hierarchical structures are really hard to handle).




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

Search: