Live data from Hacker News

Introduction to Atom

validator.w3.org

41–50 of 71 posts

Re: Introduction to Atom

#41
post #5

I’m not clear on the difference between atom and RSS. Atom seemed to be the better spec, but for my Astro blog I ended up sticking to the built in `rss` helper it ships with.

Same here. Astro has @astrojs/rss package but not atom. It should be an atom option in the same package or needed an @astrojs/atom package.

There is an npm package called astrojs-atom but i am not use it is official or safe.

Is there any astro core developer reading this, please add atom option addition to rss.

Re: Introduction to Atom

#42

Earlier quoted context omitted.

One of the API providers I use at work returns responses in XML and we use an XML parser to parse it to JSON and even then it's not perfect. What do you like about XML? I feel like I'm missing something.

The main benefit of XML over JSON is that it is structured, and can be associated with Schema's for built in validation. Obviously, that's only a benefit if you care about and utilize those features; most teams doing JSON integrations will just build those into the consumer in lieu of them being provided by the transport. But it is something that some people (especially larger enterprise organizations) value.

Thanks, that's interesting to know. Given that we have json schema now though, what reason would someone use XML over Json now?

Re: Introduction to Atom

#43

Earlier quoted context omitted.

One of the API providers I use at work returns responses in XML and we use an XML parser to parse it to JSON and even then it's not perfect. What do you like about XML? I feel like I'm missing something.

XLM had DTDs and Schemas 20 years ago. JSON is still figuring it out.

If XML+DTD was so great, it would still be used.

Re: Introduction to Atom

#45
post #30

Earlier quoted context omitted.

How is this the hyperscalers fault? YouTube had atom feeds and I don't think Amazon and Microsoft have relevant syndication. Meta is surely responsible but that's it, imo.

YouTube still does I don't think they are linked to anywhere but the url is http://www.youtube.com/feeds/videos.xml?channel_id=

GitHub too for their releases; you just add /atom to get the feed, which works great.

Re: Introduction to Atom

#46

Earlier quoted context omitted.

XLM had DTDs and Schemas 20 years ago. JSON is still figuring it out.

Json has json schema. What are DTDs?

JSON Schema has existed for maybe 6 years in theory, in practice a few years.

As for DTD: https://en.wikipedia.org/wiki/Document_type_definition

Basically it tells the system what elements are allowed in which places and what attributes they can contain.

    
Defines a html element that can contain a head and body, nothing else. Anything extra or missing will fail the validator.

It was kinda-sorta eventually superseded by XML Schema that could also define what KIND of data the attributes could contain, but did exist at the top of XML/HTML/SGML documents for years.

Re: Introduction to Atom

#48
post #24

Earlier quoted context omitted.

The main benefit of XML over JSON is that it is structured, and can be associated with Schema's for built in validation. Obviously, that's only a benefit if you care about and utilize those features; most teams doing JSON integrations will just build those into the consumer in lieu of them being provided by the transport. But it is something that some people (especially larger enterprise organizations) value.

JSON is structured (not plain text to be analyzed by an IA). JSON has JSON Schema. In addition, JSON is easier to parse and to map to common data structures of programming languages.

JSON Schema is an unofficial spec with a bunch of competitors and multiple versions, not all of which are compatible. I don't think you can compare it to XML schema validation.

I'm also not so sure about JSON being easier to map to common data structures. The lack of order guarantees within objects makes things like ordered maps quite annoying (you need to either use an array of entries with key and value, or an index within the mapped objects).

Re: Introduction to Atom

#49

Earlier quoted context omitted.

I don't reach for it often but I've been around the block a bit, CC processors in the iPad point of sale I built circa 2010 used it and it seemed a bit off/unnecessary. In retrospect, its useful for creating islands of sanity/enforcement in a codebase. Lightweight way to give type annotations across organizational boundaries. > we use an XML parser to parse it to JSON and even then it's not perfect I can't quite pict…

> useful for creating islands of sanity/enforcement in a codebase Thanks for the insight! Is this what JSDoc/Swagger is now used for? > I can't quite picture this: how does one parse XML to JSON? I'm not sure actually. I haven't personally seen the code, I just hear my coworkers always lambasting that API provider for their usage of XML. Maybe it's just their lack of documentation that sucks, but it's become a runnin…

> I just hear my coworkers always lambasting that API provider for their usage of XML

I hear this too, but often when I ask why people say things like that, it's either because XML is "outdated" or because they don't like it.

It's like programs written in C or C++: very few large projects chose those languages nowadays, often for good reasons, so the projects written in those languages are usually 10 to 20 years old. Age comes with a lot of legacy cruft and obscure behaviour, but that's not the fault of those languages per se. Or for people blasting banks for using COBOL, even though COBOL is a perfectly fine high-performance language for the niches bank mainframes serve.

Re: Introduction to Atom

#50

At this point, developers have named so many projects "Atom" that there are officially more Atoms in the world than there are atoms in the universe.

To be fair, Atom the XML Feed, similar to RSS (linked here) is probably the oldest one. It's from 2005.

Now why a spec from 2005 is in the front page of hacker news, I have no idea...

Post reply on HN