Re: Postel's law

From: Marshall <>
Date: Fri, 23 May 2008 10:18:15 -0700 (PDT)
Message-ID: <>

On May 22, 10:28 pm, David BL <> wrote:
> Have you heard of Postel's Law?
> "Be liberal in what you accept, and conservative in what you send."
> I can imagine it being applied to many things. Eg file formats, APIs,
> compilers, databases ...
> I think it generally leads to unnecessary complexity and sweep errors
> under the carpet.

Postel's law makes enormous intuitive sense. Its benefits are immediately obvious. There's just the one teeny problem that it leads to widespread ruination.

Many related arguments, and in some cases Postel's Law in particular, have been used to justify various wonky behaviors in Haphazard Text Markup Language parsers. The argument goes something along the line of, any file you can get anything out of, you ought to. And also that this enables shitty amateurs to write code that writes files. As I said: ruination. Blurring the line between what is accepted and what is malformed leads to problematic questions about the semantics of only-slightly- broken files. If it's not part of the standard, then anyone is free to interpret the input however they want. This defeats the purpose of having a standard in the first place.

The counter argument for me has always been JPEG. JPEG may actually be such a success *because* it's so technically difficult. You don't get shitty amateurs writing JPEG writers. They just use a library that already works, which was written by an actual expert. (Which is what the "E" in "JPEG" stands for anyway.) And JPEG is an enormously successful file format; there are probably more JPEG files on the web than HTML files.

Marshall Received on Fri May 23 2008 - 19:18:15 CEST

Original text of this message