IMHO: XML is a file format, JSON is a data transfer format. Reinventing things like RSS or SVG to use JSON wouldn’t be helpful, but using XML to communicate between your app’s frontend and backend wouldn’t be either.
Most web frameworks contain code to exchange JSON over XMLHttpRequest for a reason. XML is and always has been a data transfer format as well as a file format. JSON is, too. The amount of config.jsons I’ve had to mess with…
but using XML to communicate between your app’s frontend and backend wouldn’t be either
I don’t see why not? The entrypoint of web frontends is sent as HTML already. I guess that’s based on SGML, XML’s weird and broken cousin. Outputting XML is just a matter of configuring whatever model serialiser from JSON to XML.
There are a few good arguments against XML, but those also work against JSON.
Of course you can use XML that way, but it is unnecessarily verbose and complex because you have to make decisions, like, whether to store things as attributes or as nested elements.
I stand by my statement that if you’re saving things to a file you should probably use XML, if you’re transferring data over a network you should probably use JSON.
Of course you can use XML that way, but it is unnecessarily verbose and complex because you have to make decisions, like, whether to store things as attributes or as nested elements.
That’s a rather annoying shortcoming of XML, I agree. Then again, the choice is pretty inconsequential and the XSD for your data exchange format will lift any ambiguity anyway.
The choice between XML and JSON are a matter of preference, nothing more. XML is much more powerful than JSON and it’s usually a better choice in my opinion, but if you’re writing your applications well, you may as well be sending your data as pixels in a PNG because your serialiser/deserialiser should be dealing with the file format anyway.
IMHO: XML is a file format, JSON is a data transfer format. Reinventing things like RSS or SVG to use JSON wouldn’t be helpful, but using XML to communicate between your app’s frontend and backend wouldn’t be either.
We were using XML for that before JSON.
Yes and it is a good thing we don’t anymore.
Why? JSON hasn’t given us anything XML hasn’t, except maybe a bit of terseness.
I do agree SOAP is a bit over engineered, though, but that’s not the fault of XML.
As a pentester, if I see XML in HTTP I start crying.
XML is much more annoying to read/write by hand
Most web frameworks contain code to exchange JSON over
XMLHttpRequest
for a reason. XML is and always has been a data transfer format as well as a file format. JSON is, too. The amount ofconfig.json
s I’ve had to mess with…I don’t see why not? The entrypoint of web frontends is sent as HTML already. I guess that’s based on SGML, XML’s weird and broken cousin. Outputting XML is just a matter of configuring whatever model serialiser from JSON to XML.
There are a few good arguments against XML, but those also work against JSON.
Of course you can use XML that way, but it is unnecessarily verbose and complex because you have to make decisions, like, whether to store things as attributes or as nested elements.
I stand by my statement that if you’re saving things to a file you should probably use XML, if you’re transferring data over a network you should probably use JSON.
That’s a rather annoying shortcoming of XML, I agree. Then again, the choice is pretty inconsequential and the XSD for your data exchange format will lift any ambiguity anyway.
The choice between XML and JSON are a matter of preference, nothing more. XML is much more powerful than JSON and it’s usually a better choice in my opinion, but if you’re writing your applications well, you may as well be sending your data as pixels in a PNG because your serialiser/deserialiser should be dealing with the file format anyway.
Yeah, json is not a good config format. As much as xml is not. Please use something like YAML or TOML.
I never moved away from ini I’ve just been sititng back watching you all re-invent the wheel over and over and over and over and over.
It’s a wheel, it’s supposed to turn over and over and over ad infinitum!
/S (because it’s big sarcasm instead of small.)