3 ms·
> This assumes the developer sees the output. That’s why doing the opposite of Postel’s Law is so effective. If your protocol or file format mandates fatal err
by JimDabell 2y ago
> This assumes the developer sees the output.
That’s why doing the opposite of Postel’s Law is so effective. If your protocol or file format mandates fatal errors instead of being lenient in what you accept, you surface the error immediately during development and stop it from getting into production.
How many HTML or CSS parse errors do you think make it into production?
How many Python, Ruby, Java, Go, or PHP parse errors do you think make it into production?
> It seemed like successful sites had to triangulate what the de facto standards are and code in a way that made testing really tough.
Yes, and this is the consequence of Postel’s Law that the article is arguing against.
- prepend 2y agoSurfacing the error immediately means customers not buying your stuff. Or people not seeing your site. Personally, I’d rather have some functionality than none. When you have a really diverse audience with high stakes, being accommodating is valuable. When I have control over the pipeline then I can afford to be strict in surfacing and correcting errors. But when I have 10,000 different users who will not report errors and just move on, I need something else.
- JimDabell 2y ago> Surfacing the error immediately means customers not buying your stuff. Or people not seeing your site. No, immediately means when the code is written, not some arbitrary time later in production. When somebody writes Python, Ruby, Java, Go, or PHP with a parse error, the developer notices immediately because the runtime is conservative in what it accepts and refuses to run it. Fixing the error is mandatory before the code can make it into production where it can affect your customers and make them not buy stuff. When somebody writes HTML or CSS with a parse error, that can easily make it into production because nothing between the point where the mistake is made and production will refuse to parse it, everything in the chain is lenient in what they accept and pass it along to where your customers can be affected.
- prepend 2y agoIsn’t the point of a protocol is that anyone can write a parser and browser? How would I test immediately in every browser, since there’s so many different things parsing and interpreting and rendering?
- JimDabell 2y agoThe whole point of what we are discussing is to define the protocol to require unambiguous errors instead of lax undefined behaviour. If every parser rejects errors instead of trying to work around them in their own special way, errors are surfaced in the first browser you test with because it won’t be trying to compensate for the error in ways you might not be aware of.