Atom 在重要方面优于 RSS
Atom is better than RSS, in ways that matter

原始链接: https://chrismorgan.info/atom%3Erss

作者认为,Atom 联合格式在技术上优于 RSS,业界本应在几十年前就将其作为标准。RSS 因版本碎片化、互不兼容以及规范模糊而备受诟病,而 Atom 则为内容呈现提供了一个清晰、稳健的框架。 其主要技术痛点在于 Atom 的“文本构造(text construct)”功能,该功能允许开发者明确定义标题和内容的编码方式。这使得在标题中可靠地使用 HTML 标记(如 `` 或 `` 标签)成为可能,而这一操作在 RSS 中往往是不一致且不可靠的。 作者承认这种偏好有一个例外:播客。由于苹果公司早期的垄断,播客生态系统被迫采用了 RSS。结果,现在的播客订阅源充斥着各种遗留的修补程序和权宜之计。尽管如此,作者坚持认为,对于一般的网络联合发布而言,Atom 仍然是客观上更好的选择。其目标是推动社区超越意识形态的偏好,认识到 Atom 的精确性能够解决 RSS 根本无法处理的现实互操作性问题。

这篇 Hacker News 帖子探讨了 Atom 与 RSS 之间的争论,起因是一篇认为 Atom 在技术上更优越的文章。 评论者普遍认为,Atom 在设计时考虑了更完善的标准,但他们也指出,这种区别对于普通消费者而言无关紧要。许多人认为这种情况类似于“VHS 与 Betamax”现象,即一种技术上更优越的格式输给了更成熟、尽管“更差”的格式。 讨论中有很大一部分观点强调,“RSS”实际上已经成为了所有订阅源格式的通用术语,许多现代阅读器可以透明地解析这两种协议,而用户无需了解其中的差异。一些参与者认为这场争论已成往事,并指出由于大多数阅读器现在都支持这两种格式,技术差异主要只与开发人员和解析器编写者有关。最终,大家的共识是:虽然 Atom 可能更简洁,但这场“战争”早已结束,RSS 赢得了品牌之战,而整个行业也已转向对两者提供兼容支持。
相关文章

原文

Draft: started Tagged ,

My feeds are Atom feeds.

Everyone with knowledge agrees that Atom is technically superior to RSS.
Everything should have switched to it twenty years ago.
All feed readers support Atom just fine (except in podcasts, for no good reason).

Unfortunately, many people continued to write and choose RSS,
whether from ignorance of Atom (please stop calling feeds “RSS”!),
or from figuring it doesn’t really matter in the end.

Most of the differences are surface-level, or in practice not a problem:

  • RSS uses a stupid date format? Doesn’t really affect people much.
  • RSS doesn’t specify content encoding, so it’s ambiguous as to whether <description> is text or HTML?
    Used to be a problem, but these days everyone emits and assumes HTML.
    In fact, RSS 2.0 specs settled on it being HTML,
    though people often use the unreasonably-popular, wonkily-versioned, horribly-named
    content:encoded to mean that, even though that’s not what it was supposed to mean.
  • RSS is a travesty and the name refers to nine mutually-incompatible formats, published by a variety of different and competing organisations sometimes even using the same version numbers?
    Meh, just ignore the XML namespaces, be sloppy,
    the feeds you want to cope with will be worse.
    Resign yourself, it’ll be easier in the long run.
    Seriously, you may even be able to get away with forgetting that RSS is supposed to be XML.

But what few realise is that some of the differences matter.
That due to inconsistent treatment and usage,
some reasonable content cannot reliably be expressed in RSS,
whereas it’s unambiguous in Atom and should always work fine
(and if it doesn’t, it’s unambiguously a bug).

So let’s talk about the cases that matter.
I would like to convince people to prefer Atom for useful reasons,
rather than merely ideological purity.
I want RSS dead.

Title encoding semantics

Précis: you can’t reliably use characters like < or & in RSS titles.
Don’t even try mentioning HTML tags in titles.

Content management systems normally allow headings to contain markup;
but they seldom allow titles to contain markup.
This is a tragedy. Many an article calls for <code> or <em>.
I do it often, and I’ve seen a few others do it, but not many.

Atom defines something called text construct,
where you can specify whether the value is text,
entity-encoded HTML, or XML-encoded HTML.
Titles are text constructs.

In RSS… well, not even content gets encoding semantics,
which used to be a real problem,
but over time everyone settled on “it’s always HTML”.
So titles definitely don’t get encoding semantics.
And different implementations do different things.

Suppose you want to encode this title:

All about the <xmp> element

How are you going to do it?

In Atom, you have three clear choices:

  1. Discard the markup, and encode the text as text.
    <title type="text">
    	All about the &amplt;xmp> element
    </title>
  2. Keep the markup, and entity-encode the HTML.
    <title type="html">
    	All about the &amplt;code>&ampamp;lt;xmp>&amplt;/code> element
    </title>
  3. Keep the markup, and represent the HTML as XML.
    <title type="xhtml">
    	<div xmlns="http://www.w3.org/1999/xhtml">
    		All about the <code>&amplt;xmp></code> element
    	</div>
    </title>

TODO: survey RSS readers to find out how they handle all of these cases.
(This is the biggest reason I haven’t published this previously. Probably should have by 2020 or so.)

Hard mode challenge: <_>::v::<_>, a real title I used.

The summary/full item distinction

RSS bad, Atom good. Capiche? 😁

Heuristics, bad for interop, &c. &c.

I feel like there was a third Difference that Matters that I had in mind at some point. Maybe I’ll remember it before I publish.

The fly in the ointment: podcasts

I must, in good faith, mention podcasts.
Although approximately every single feed reader and open-source feed-reading library
from the last twenty years supports both RSS and Atom,
most of the largest podcast feed readers or syndicators only support RSS.

Since this stuff is largely from 20–25 years ago,
and I wasn’t paying attention to the space at the time (few twelve-year-olds would),
details are hazy.

Rough timeline:
Podcasting started to be a thing.
RSS 2.0 added enclosures for it.
Atom was designed, to fix most of the problems with RSS.
It stabilised.
Apple released iTunes podcasting stuff only supporting RSS.
The iTunes client got Atom support, but the iTunes Music Store did not.
Atom was published as RFC 4287.
I have found no clear evidence that the iTunes Music Store
(later the Apple Podcasts catalogue) ever supported Atom.
And whatever iTunes/Apple Podcasts ever did have, was removed in 2023.

So I want to blame Apple.
They controlled the space in the critical early days, and they ruined it.
Some podcast readers or syndicators support Atom.
Some claim to but don’t.
Some (probably the most important ones) just don’t.

RSS is a mess. Podcast RSS is even more of a mess.
Frozen in time, hack is piled upon hack to work around RSS’s shortcomings.
Ugh.

联系我们 contact @ memedata.com