phpc.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A server for PHP programmers & friends. Join us for discussions on the PHP programming language, frameworks, packages, tools, open source, tech, life, and more.

Administered by:

Server stats:

837
active users

Chris Hartjes

When it comes to the anti-XML discussion — readability is an opinion, not a fact. A lot of what programmers claim are facts are just opinions.

I am sorry you dislike XML. I remain unconvinced that using JSON or YAML over it is anything other than a personal preference born out of your chosen programming community’s tribalism.

@grmpyprogrammer my personal "problem" with xml is verbosity.

And probably folks not using a dtd.

I can't remember where or when I learned about them, they seemed to solve many of the problems I saw people having with xml

I still prefer yaml but I'm not an ass about it

@grmpyprogrammer When you need to access data from both PHP and JS, then JSON is the only format that is natively consumable from both languages.
That is a fact.
I _personally_ dislike JSON, but it does not mean in such cases I'm going to use XML or anything else and rely on userland 3rd party libs when parsing JSON is a native function away in both PHP and JSON.

@gmazzap That scenario seems correct to me. I wouldn’t advocate trying to get JS code to parse XML.

@grmpyprogrammer I'm a big fan of XML tbh, and not ashamed of that 😙

@asgrim @grmpyprogrammer as a Child I’m all I’m on , although I get used to yaml and json thanks to and .

TL;DR use what ever format makes you happy, I make it work for you.

(Please don’t start to pack json into xml into yaml or something like this shit!)

@grmpyprogrammer

> I remain unconvinced that using JSON or YAML over it is anything other than a personal preference born out of your chosen programming community’s tribalism.

What sort of evidence might convince you, in either/any direction?

@grmpyprogrammer I'm not trying to change your mind; but if you added a Schema to JSON, would it be less bad? This is what @ocramius [of many Types] does.

@grmpyprogrammer umm, probably thinking about one option for everything, not consodering the use case, the data structure, is a mistake. If you are transmitting ojects and programming variables, etc., Non critical data, between homogeneous layers, simple api calls JSon is great. If you are managing critical data, complex content or encoding complex configurations it is probably an xml case IMO. The readability also, xml may be more apropriate for complex content, mixed data, etc.

@grmpyprogrammer I find the AI models do extremely well with json and you can additionally cram a bunch of different data into the same json file and still completely utilize it esp in AI environments. Obvious reason is that the field name is attached to every data field.