what is better, JSON or XML and why?
>>60853785
YAML
>>60853820
>simple question on /g/
>literally in the first post becomes an opportunity to see who can think of the most obscure useless meme technology
its no wonder you fucking clowns think that indians are "stealing" your jobs. i can just see your resume now. and endless list of meme frameworks and half-broken open sores bullshit
>>60853785
json.
A custom DSL that produces a custom binary protocol.
>>60853919
why
>>60853853
thanks for (you)
i'm not from burgerland
>YAML - obscure
have you ever encountered config files? oh right you're neet
>>60853785
XML is an abomination when used for config files
I look at you apache, maven, etc
>>60853785
For what? For pure data, I would say JSON, but for a largely text-based document with markup in between XML seems much better, as characters "default" to being in text nodes.
>>60853785
>>60853820
neither
also see >>60854294
t. typesettingfag
to transfer data? json
to transfer complex data? xml
for config files? yaml
small and allows comments
(post
(name "Anonymous")
(comment "What about sexpr?"))
“The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well.” – Phil Wadler, POPL 2003
http://harmful.cat-v.org/software/xml/
>>60853785
They are both fairly simple, so I would suggest that you implement a json parser and a xml parser, then write a file in both formats and come to the same conclusion that json is better for small files and xml is better for large files that tend to get damaged.
>>60854644
XML is better when you know a human is never going to read or manipulate it unless something goes wrong. JSON is easier to work with by hand.
Something about XML is just comfy in a way I can't really explain, but for a more practical answer:
XML is designed to be extensible, while JSON was just kinda discovered to exist* and happened to be loosely extensible. Features such as namespaces and prefixes are really helpful and missing from standard JSON. XML document formats can even be defined in XML itself, while for JSON as far as I know there is no such standard machine-readable system for validating JSON documents. Correct me if I'm wrong though.
* I remember reading this somewhere but I can't find a source for it now so if it's wrong go ahead and ignore this bit