Live data from Hacker News

JSON vs. XML

corecursive.com

111–120 of 252 posts

Re: JSON vs. XML

#111
post #102

Earlier quoted context omitted.

I had a power strip which had "works with windows 95" on the packaging box.

Did it work with 98?

I wasn't working at the same place in 1998, so I can't verify.

The hype around Windows 95 at the time was... incredible. Midnight store openings, hours-long line waits... insanity.

Re: JSON vs. XML

#112

I have huge respect for Doug Crockford, and I never imagined I would disagree with him. However I think by now we've seen that a lot of that "unnecessary" XML complexity was not, in fact, entirely unnecessary. These days we use JSON for everything, but now we've got JSON Schema, Swagger/OpenAPI, Zod, etc etc. It's not really simpler and there's a lot of manual work - we might as well be using XML, XSD & SOAP/WSDL.

> but now we've got JSON Schema, Swagger/OpenAPI, Zod, etc etc. It's not really simpler and there's a lot of manual work - we might as well be using XML, XSD & SOAP/WSDL.

Uh... do we? I've never used any of those. Plain JSON has always worked fine for me.

Re: JSON vs. XML

#113
post #26

Earlier quoted context omitted.

JSON is great, but I surely wish it supported comments. That's the nature of its failings: too minimal.

That depends on what you want it to be. For a data interchange format, having no comments is arguably a strength. For a config file format, having no comments is a big weakness.

Many people use text format protobufs for config. It vaguely resembles yaml, and the schema is enforced by virtue of requiring a message definition in order to parse it.

Re: JSON vs. XML

#114
post #93

What if I hate both formats? XML is overly verbose, while JSON isn't specific enough or precise enough for a lot of my needs. - This message brought to you by TOML gang

Absolutely agree. TOML is far and away the best for config files.

You can't be serious; I can't stand having to guess what kind of crazy markup is required to express things in toml. As a concrete example I converted my local kubeconfig (which is yaml) and here are the completely random characters indicating some kind of hierarchy

    apiVersion = "v1"
    current-context = ""
    kind = "Config"

    [[clusters]]
    name = "my-cluster"

    [clusters.cluster]
    certificate-authority-data = "LS0tL..."
    server = "https://example.com"

    [[contexts]]
    name = "context0"

    [contexts.context]
    cluster = "my-cluster"
    user = "my-user"

    [[contexts]]
    name = "context1"

    [contexts.context]
    cluster = "my-cluster"
    user = "my-user"

    [[users]]
    name = "my-user"

    [users.user]
    [users.user.exec]
    apiVersion = "client.authentication.k8s.io/v1beta1"
    args = ["eks", "get-token"]
    command = "aws"

Re: JSON vs. XML

#115
a lot of people started programming in this thing and were writing in a style of programming that the professional programmers of the day thought was impossibly hard, which was doing stuff based on events.

Not so different from today. That quote is about HyperCard, not JS, by the way.

Re: JSON vs. XML

#116

Earlier quoted context omitted.

I had a power strip which had "works with windows 95" on the packaging box.

This is just an example of how marketing knows nothing about the products they are marketing, or are just flat out snake oil sales. Like packaging for bacon exclaiming "gluten free"

>This is just an example of how marketing knows nothing about the products they are marketing

Or it is a question that people who are not familiar with technology will ask frequently and makes no sense to people who are.

Re: JSON vs. XML

#117
post #16

Earlier quoted context omitted.

> I started my career during peak XML crazy and while I liked parts of it at the time, the number of things it was used for was quite insane. I had to maintain a system once where a major part of it was XSLT, when could have just been a simple imperative algo with some config settings. Same here. XML was going to save the world! Remember XML data islands with data embedded in page source and displayed via XSLT? The c…

Nowadays you have the same type of tools, only for YAML. Not sure if that's so much better.

Which tools are you thinking of?

Re: JSON vs. XML

#118
My biggest gripe with XML is that it can't represent arbitrary strings easily. Even in the latest versions of XML, you can't easily serialize strings with embedded nulls since it is forbidden by the spec to even use something like "�". XML 1.0 was even worse since it doesn't allow any characters which require surrogate pairs under UTF-16. Instead, the spec writers apparently expect devs to come up with their own escaping scheme in which case why bother having a standard at all?

Even C# just punts on this issue and won't emit valid XML if a string you serialize happens to have a null character in it.

Re: JSON vs. XML

#119

Earlier quoted context omitted.

With XML, the complexity is the baseline, and it only goes up from there. With JSON, the complexity is just an option, the baseline is pretty simple. Also, good XML-tools are rare or expensive.

Baseline for XML would be a document that doesn't use schemas, namespaces, attributes, or any of the SGML legacy stuff like DTDs and PCDATA. Such a document is essentially as simple as the equivalent JSON.

Even that is more complicated than JSON.

Re: JSON vs. XML

#120

Earlier quoted context omitted.

This is just an example of how marketing knows nothing about the products they are marketing, or are just flat out snake oil sales. Like packaging for bacon exclaiming "gluten free"

>This is just an example of how marketing knows nothing about the products they are marketing Or it is a question that people who are not familiar with technology will ask frequently and makes no sense to people who are.

I use bing, and tell people to 'bing it' sometimes (instead of 'google it').

I had a family member ask "will bing work with my yahoo?"

So... I know those words individually, but... man... together, in that order... I don't know how to respond. I think I said something like "don't worry about it - it's not that big a deal" and left it at that.

Post reply on HN