logoalt Hacker News

wat10000last Tuesday at 10:22 PM1 replyview on HN

Postel's Law sounds nice but it can result in major problems. It results in a de facto spec that differs from the written spec, and disagreements about what a piece of data actually means can lead to bugs and even security vulnerabilities.

Having strictly parsed HTML from the start would be fine. You'd check it before you ship it and you'd make sure it's valid.

Requiring it now would be a disaster, of course. There's so much malformed HTML out there. But making HTML parsers accept garbage at the beginning was the wrong choice.


Replies

reshlolast Wednesday at 12:51 AM

The widespread acceptance of Postel’s Law also encourages poor authorship, because if you know clients have to be liberal in what they accept, there is no incentive to be conservative in what you send.