4 ms·
Can We Do Better Than XML and JSON?
- KaiserPro 13y agoyes. There is a time and place for both XML and JSON. Making a website? want to create a data feed for web type stuff? JSON away. Work in enterprise world? perhaps you like JRR tolkien? XML is your friend. Working in mobile/embedded/low bandwidth applications? no, XML/JSON is not your friend.<edit> unless you don't care about network/power efficiency.</edit> I know Binary protocols strike fear into the hearts of programmers, but what is JSON? its a string of binary. Its just there happens to be lots of lovely tools to make it dirt simple. as with all things there is a tradeoff. You need fast low latency interchange of large amount of data? Binary, and yes you'll need to make a schema first. I know it sounds a lot like planning, but trust me, giving real structure to your data will save you weeks in debugging later. just want to send and address to javascript? well hello JSON. The example that is given there, is just utterly horrible. however if it works and is easy, then who cares? its only a problem if you need to scale. But then you've got bigger issues.
- toomuchtodo 13y agoI laughed at this line: "Work in enterprise world? perhaps you like JRR tolkien? XML is your friend." Thank you :)
- toyg 13y agoBinary is the enemy of View Source, with all that it entails. Tou think code is self-documenting and you only use FORTRAN because anything invented after 1990 is rubbish? Can't interop. Your schema doc is a bit out of date? Can't interop. Your schema is under NDA? Can't interop. Your competing standard is plaintext? You've already lost. And so on, and so on. The search for network efficiency is often just premature optimization.