4 ms·
That would be madness. Imagine a browser that did that, or that crashed the tab in case of a JS error. There would be no pages left :P
by unlinker 10y ago
That would be madness. Imagine a browser that did that, or that crashed the tab in case of a JS error. There would be no pages left :P
- catnaroek 10y agoIt would be a lot more sensible than you think. When I get a compilation error, what I do is take a breath, think about the meaning of my code, correct any logical mistakes I can find, and try to compile again. Why couldn't Web developers do the same? Also, there's no need to crash the tab. The browser could simply stop running any JavaScript, and leave the user with a static page.
- regularfry 10y agoAnd this is precisely the point. If the very earliest browsers had insisted on correctness rather than permissively accepting broken HTML (and JS - see semicolon insertion), we would not now have a situation where browsers need to do a ton of work to allow graceful degradation in the face of awful markup, simply because the tooling would have evolved in the other direction. Postel's Law gains a little temporary sender convenience in exchange for a nasty mess of permanent receiver headaches.
- DanBC 10y agoPostel's law has two parts. Be gracious in what you receive is what most people are talking about, but be cautious in what you send is just as important. If people are using broken markup that's the problem that needs fixing. How many web devs bother with validation anymore? (And not for app like functionality, but for what should be simple text and images with a few menus - why are so many newspaper websites so awful?) https://tools.ietf.org/html/rfc793 https://tools.ietf.org/html/rfc793 2.10. Robustness Principle TCP implementations will follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others.
- catnaroek 10y ago> but be cautious in what you send is just as important. How are you going to enforce this for everyone? > TCP implementations will follow a general principle of robustness (...) This rule has worked well for TCP implementors in large part because of their circumstances, which are very different from those of browser implementors and Web developers: (0) Priorities: How much do the following desiderata matter to each group: reliability, performance, new features? (1) Skill: What skills does a representative programmer from each group have? (2) Risk profile: How does each group cope with the possibility of design and implementation errors? How much technical debt are they willing to take? I'd contend that Postel's law doesn't scale beyond relatively small groups of highly skilled programmers, for whom reliability is paramount and trumps all other considerations.
- regularfry 10y agoThe problem is that being conservative and precise isn't enough. You and I can both be conservative, but disagree on the specifics (given an ambiguous spec, for instance). A permissive receiver of both our data now has to support both sides of our disagreement forever.
- DanBC 10y agoNo they don't. They just have to not explode.
- alkonaut 10y agoExactly. So by being permissive from the start we now have this dumpster fire that prevents us from writing sane and performant code. Because we have to assume that with crap input the user doesn't want Imagine what C++ would look like if all compilers had to accept all different variations of it, and the result of compiling 100 almost valid C++ files should, as far as possible, be a program that runs in some sense. Most of the web pages I have ever written have probably been ill-formed because browsers don't tell me what's wrong, and instead show me a (nearly) working web page.
- catnaroek 10y ago> Imagine what C++ would look like if all compilers had to accept all different variations of it, and the result of compiling 100 almost valid C++ files should, as far as possible, be a program that runs in some sense. C++ is still a lot more permissive than it could and should be. > Most of the web pages I have ever written have probably been ill-formed because browsers don't tell me what's wrong, and instead show me a (nearly) working web page. Same here. The idea that JavaScript ought to be permissive and forgiving because its target audience doesn't know what they're doing turned out to be a self-fulfilling prophecy on the part of its designers.