5 ms·
Then use this instead: { number: "1.0000000000000000000000000000001" } How is it worse than XML?
by nadam 11y ago
Then use this instead:
{ number: "1.0000000000000000000000000000001" }
How is it worse than XML?
- togusa 11y agoSee: https://news.ycombinator.com/item?id=10385610 https://news.ycombinator.com/item?id=10385610
- nadam 11y agoOk, now I see that you are complaining that the JSON Schema language is not strong enough. In this case I think people should create better new schame languages for JSON, as I find that the JSON syntax is better suited to data than XML, which is better suited to marked up text. (maps, arrays and atomic literals are fundamental data concepts, while tags, attributes, free text are closer to mark-up. )
- togusa 11y agoThe thing with XML is it's actually much lower level. There are no types inferred by an XML document. It's literally just chunks of data. JSON defines strings, boolean, maps, arrays, numbers. It's conceptually easier to think about JSON with simple data sets but it's terribly inflexible and you have to think about how things are represented inside strings. A couple of thought exercises on JSON: 1. How do you represent an image inside JSON? 2. How do you represent a reference to another part of the data in JSON (consider a DAG for example)? 3. How do you represent an ordered set or an unordered set in JSON? 4. How do you represent an unsigned value in JSON?
- deleted 11y ago[deleted]
- zamalek 11y agoAs soon as you are making a schema for JSON you've eliminated XML with no good justification. More and more, people are re-inventing XML on top of JSON: schemas, namespace, the works. JSON is great because when you don't need all the things that XML solves it's extremely succint and readable. Use any single copied feature from XML and it turns out being more verbose and less readable than XML. Use the right tool for the job.
- orbitur 11y ago"As soon as you are making a schema for JSON you've eliminated XML with no good justification" Sure, if you don't consider "human-readable" a good justification. Some of us do.
- togusa 11y agoPeople moan about XML readability somehow forget that it uses approximately the same syntax as HTML. Imagine HTML in JSON. Nope...
- dragonwriter 11y ago> People moan about XML readability somehow forget that it uses approximately the same syntax as HTML No, they don't. > Imagine HTML in JSON. Yes, sure, JSON is a crappy text markup language, and would be much less readable than HTML for that purpose. OTOH, readability when used as a markup language for content consisting largely of prose text and readability when used as a structured serialization format for data that doesn't mostly consist of large blocks of annotated prose isn't necessarily the same thing.
- orless 11y agoThe point is, XML is quite good for unstructured, semi-structured and strongly-structured data and is more versatile from this point of view.
- dragonwriter 11y ago> The point is, XML is quite good for unstructured, semi-structured and strongly-structured data That's a highly-subjective and controversial point. (To me, XML is the Java of data languages -- its a lot worse than the best alternative considered on its own for almost any purpose -- though the best alternative will vary by purpose -- but it has a fairly wide range of uses for which its not intolerably bad, and its often a better choice than its inherent features would suggest because of the strength and maturity of the ecosystem around it.)