Hacker News new | ask | show | jobs
by user3939382 1175 days ago
If it's not obvious, the issue is that standardizing a data format is going to have trade offs. Interoperability, leveraging tooling universally so all effort is going in the same direction, awesome. The problem is that some uses cases for the format are going to be insanely complex, which will make the standard and tools unnecessarily complex for the simple cases.

JSON is simpler and easier for many cases, but then you lose the interoperability. Go try to make an app right now dealing with Federal government systems or finance, you're going to end up translating JSON<->XML which isn't fun.

There's not going to be a silver bullet solution to this problem, it's not completely solvable.

1 comments

> you're going to end up translating JSON<->XML which isn't fun.

Not fun? It's not even possible in the general sense.

If you have XML that looks like:

    <meal type="breakfast">
       <eggs count="3">
           <topping>cheese</topping>
       </eggs>
    </meal>
How would you convert that to JSON without knowing how the JSON consuming application expects it to be formatted? Where do you put the "breakfast" and "count" attributes?

You'd need to manually write a translator for each potential translation.

> You'd need to manually write a translator

Yep, therein lies the “not fun”. You write a bunch of super complex, brittle code.

Unfortunately because XML is entrenched in certain domains, you have to decide between writing these converters or doing everything in XML which also sucks, especially if you’re trying to write a modern app with a modern stack.