News for hackers. Stuff that matters.
Re:Programmers and Sadomasochism by johngunderman on Saturday February 21, 2009 @11:56PM (#490386)
While the author does bring up a good point, I feel that he just skims the surface of the major drawbacks of a permissive parser:

1. It is hell to write a new parser for convoluted standards.

2. permissive parsers have to waste more CPU cycles trying to fix everything (admittedly this is not as big of a problem in the current day and age)

3. Weak standards leads to badly coded pages. Badly coded pages generally have bad design. Badly designed pages don't help anyone.

4. It drives the people who care crazy (Ok, maybe that's not a real reason :))

5. I'm sure there are others I can't think of.

Re:Programmers and Sadomasochism by peregrine on Sunday February 22, 2009 @01:57AM (#490431)
Lets face it, its always best to accept poor formats. If you write the program to handle it and clean it then your fine. If one program before it has a bug and forgets a quotations then instead of your whole system failing and you needing to go through a long process of testing debugging documenting releasing you save everyone time and money.
Re:Programmers and Sadomasochism by tlrobinson on Sunday February 22, 2009 @03:20AM (#490468)
I disagree. Postel's Law can be harmful. It's nice in theory, and if everyone was "conservative in what [they] send" or "liberal in what [they] accept" in the same way, it would work well.

But it's a slippery slope. If one implementation accepts some obscure edge case, and someone relies on it, from then on every implementation must go out of it's way to handle it in the same way. This leads to complex and bloated software.

Re:Programmers and Sadomasochism by peregrine on Sunday February 22, 2009 @12:30PM (#490699)
You provide a good argument, but what I was trying to communicate was that the sender is still sending an standard format. The coder just makes a bug in his XML and instead of bringing down the whole house its handled.
Re:Programmers and Sadomasochism by jerf on Sunday February 22, 2009 @12:43PM (#490701)
XML isn't "this sort of thing with tags and attributes". It's a rigidly-specified format, and for any given series of bytes and an encoding, it either is or is not XML. If there's a "bug in his XML", it isn't XML anymore.

You can talk about what to do with this not-XML, but you can't just pretend it is XML. It isn't, because XML is not just this fuzzy thing, it's a very, very, very specific thing.

Re:Programmers and Sadomasochism by tlrobinson on Sunday February 22, 2009 @06:51PM (#491018)
If the parser allows the programmer to be sloppy they may not know they're making a mistake. If they try to use another parser that doesn't handle their mistake the same way, it will break.

Worse, in the case of browsers, each browser vendor wants to be sure every major site works in their browser, so they have to go out of their way to program in all these special cases. See tolmasky's comment above.