January 20, 2004

Postel's Law is not an absolute.

Dave Hyatt has finally weighed in on an issue that I have been following and commenting on in various places. The issue at hand is whether requiring valid XML from servers makes sense. Dave is speaking exclusively in terms of how web browsers handle invalid XML. It is also, however, a critical issue for the new(ish) Atom syndication specification.

The issue began as an unwarranted flame by Mark Pilgrim on Brent Simmons' blog, arguing that his decision to require that Atom feeds be valid XML for NetNewsWire to render them was both a violation of Postel's Law and a blatant attempt to undermine the Atom spec.

Before we go on to discuss Postel's Law, which is the point of this rambling, I will point out, as I did on both Brent S. and Mark's weblogs, that requiring Atom feeds to be valid XML is in fact a -favor- to the Atom community, since the draft Atom spec does require that a feed be valid XML. Allowing malformed XML to be rendered starts a long slippery-slope slide into the abyss in which HTML currently dwells. Mark argues that this is necessity. I argue that XML, and thus Atom and RSS are different beasts entirely, and that forcing software that generates XML to be strict makes everyone's life easier. Unlike HTML, very few people write XML by hand.

Postel's Law: "Be liberal in what you accept, and conservative in what you send."

On the face of things, this seems to be good general advice. The truly wise man knows when and why his aphorisms are appropriate. I argue that Postel's Law is a tradeoff, not an absolute. What Postel's Law competes against is actually a generalization of Metcalfe's Law. Defining Metcalfe's term "network" to mean the users of any specification, whether it is TCP/IP, or HTTP/HTML or HTTP/RSS, there is value in ensuring the maximum number of users possible can and will use the specification. If a specification is not a reliable blueprint for engineers to develop applications around, it does not maximise users. Failure to require at least modestly strict interpretation of the spec creates a huge barrier to entry for applications, and ensures confusion on the part of the end user when their applications are not interoperable or are marginally interoperable.

A case in point is the now-ancient incompatibility in Microsoft's TCP stack. In 1997, it was noticed that Solaris webservers served Windows machinese very slowly. The cause of this problem turned out to be due to Microsoft failing to implement a relevant portion of the TCP specification (support for slowstart), compounded with a bad implementation of delayed_ack. (Of course, consipiracy theorists of the time charged that Microsoft was trying to drive sales of Windows-based servers. Hanlon's Razor applies.) Of course, the point is that whether by sins of omission or of commission, Microsoft reduced the utility of the whole Web at the time, by making a partially incompatible implementation of the spec.

It is easy to envision the future of the Atom spec, and of XML in web browsers in general, if this corollary to Metcalfe's Law is not allowed to weigh against the demands of Postel's Law.

As a closing note, I will also point out that such interpretation of Postel's Law as we are seeing applied to this debate place a disproportionately large emphasis on the first half of the law. There is a certain amount of irony in seeing the folks championing the "universal truth" of Postel's Law as an excuse to allow some developers to violate its second half with impunity.

Posted by brent at 20:42
Comments