4 ms·
Personally, it's just another ML I need to think about. If it's JSON, I can at least pretend that my data structure stays coherent from A to B (ex: node.js web
by hayksaakian 13y ago
Personally, it's just another ML I need to think about.
If it's JSON, I can at least pretend that my data structure stays coherent from A to B (ex: node.js webapp to js frontend).
It's also easy to look at, appearing much like a dictionary or hash + array set in many programming languages.
- shmerl 13y agoXML is a "must know" kind of thing for any serious developer anyway, so I don't really see your point. XML and JSON have enough different use cases, even though they have common ones as well. For starters, XML can be automatically validated when needed using schemas, while JSON can't (even though there is a draft for JSON schema in the works). So XML has advantages over JSON is various scenarios. The price is more complexity naturally, but one should expect that. But besides the point, XMPP already uses XML. So there is no need to reinvent the wheel here.
- Arelius 13y agoWhile, mostly working in client development, I'm a professional developer of 12 years, and while I've had my random encounter with XML, I've managed to avoid it, and do not "know" XML in any significant capacity. It's easy to forget that there is a large set of different developers. And some don't know what you may consider common knowledge. IMO, something being JSON over XML would be a significant plus in my mind.
- hownowstephen 13y agoWorking for a company that has started adopting JSON Schema as our primary validation tool, I can definitely agree that XML still has the upper hand when it comes to a seamless experience in data validation. Schema validation is still really primitive (though with the love JSON has been getting in the past couple years, it shouldn't be too much longer until it's in fighting shape). Something about XML just has never really sat well with me - whereas JSON just works when it comes to actually modelling objects in a way that makes sense and can be picked up quickly. I can't say I've yet to find a place where I absolutely needed a feature of XML that I couldn't find in JSON, but would love to know more situations where I can be proven wrong. I think ultimately if the goal is just to JSONify the world, then that's no good - but if we're looking to make protocols more accessible and hackable, JSON may be the way to go.
- hayksaakian 13y agoI wasn't referring to knowing it, I was referring to having to _consciously_ wrestling with it. With regards to schema/ validation, wouldn't it be a poor choice to put this logic in the transmission layer?
- shmerl 13y agoWhen mentioning validation I compared them in general, not in the context of XMPP specifically. Validation is always expensive, and is used only when really necessary.