Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> like no good way to represent 64 bit numbers

Yep, it only has strings either way.

> weak typing

Yep, it only has strings either way (also, "weak typing" does not mean jack shit, and talking about typing strength for a serialization format makes zero sense)

> barely any types in the first place

Yep, it only has one.




If you look at the XML schema specs (http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/#decimal) you will see that they have been standardized numbers.

Things in XML do not need to be just strings.

PS: I still don't like XML, but your comment is technically incorrect.

Edit: Typo FIX.


> Things in XML do not need to be just strings.

Things in XML are just strings.

Schemas are metadata, annotations to tell processors "treat this string as [some other datatype]" (note how it's not going to work if you're not using the schema and a schema-aware processor?)

And guess what? Nothing stops you from doing exactly the same thing in JSON. In fact you don't have much of a choice for the datatypes JSON doesn't natively support (dates being the most common one, but not the only one by any mean). And good JSON interfaces provide for embedding transcodings directly in the parsing or dumping (that's what the `reviver` and `replacer` arguments do in JSON.parse and JSON.stringify) for exactly that purpose.

> PS: I still don't like XML, but your comment is technically incorrect.

Nope. Specific XML dialects may have non-string datatypes (XML-RPC certainly does), but XML only has strings. In the same way CSV only has strings, but specific CSV uses may have more. That's the plain facts of the matter.


"Things in XML are just strings."

XML and JSON are representations -- so they are all just bits. It's meaningless to say that, however.

The metadata and surrounding standards are what give those bits more meaning. So compare what the standards have to offer.

(Aside: I don't like XML and I think JSON is way over-hyped and under-delivers.)


> So compare what the standards have to offer.

Which I did. The XML standard only offers strings, and you can add schemas to JSON.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: