5 ms·
This behavior is pretty common, though. Typo in variable name in Python? Program will stop mid-execution with a traceback.
by vageli 9y ago
This behavior is pretty common, though. Typo in variable name in Python? Program will stop mid-execution with a traceback.
- eridius 9y agoYes, but that's source code. You can't run a partially-compiled program, so of course an error anywhere stops everything. But HTML isn't a programming language, it's a markup language, and you absolutely can render a partially-correct page. This might be more obvious if you consider a different markup language instead. Let's say you're using Markdown, and you start an italic block with an asterisk and forget to terminate it. Should the whole comment fail to render, or should it just fall back to showing a partially-correct comment?
- zAy0LfpBZLC8mAC 9y ago> Yes, but that's source code. You can't run a partially-compiled program, so of course an error anywhere stops everything. But you absolutely can compile a program with syntax errors. There is nothing that prevents compiler writers to be equally "forgiving" and just inventing random semantics for stuff that does not have any meaning in the language, just as browsers do with HTML. And it would be just as idiotic.
- eridius 9y agoThat would certainly be idiotic. But that would not be "just as idiotic", because it's not even remotely idiotic to do a partial rendering of a document that has some incorrect markup in it. In fact, your claim there is begging the question.
- zAy0LfpBZLC8mAC 9y agoYes, actually it would be. Tell me, what do you think is the advantage of inventing some random meaning for what is declared to be an HTML document but actually isn't (bonus: that would not equally apply to code in a programming language)?
- eridius 9y agoFirst off, nobody has ever said you should "invent some random meaning" for anything. Secondly, it's pretty obvious what the benefit is of doing the best job you can rendering a document that contains some error in part of it. The existence of an error in one section of a document shouldn't have any impact on the rest of the document, and so there's no reason why the error should prevent rendering the rest of the document.
- schoen 9y agoIt seems like you two are arguing over whether or not it's important for documents to have formal semantics. If documents need to have formal semantics, then syntactic errors could be considered fatal because they create ambiguity. If documents don't need to have formal semantics, then you can ignore syntactic errors and accept that an ambiguity was present and was resolved arbitrarily. It seems like both views are quite defensible, depending on your theory of what the markup was meant for.
- zAy0LfpBZLC8mAC 9y agoWell, no, actually the view is not defensible, because it insists on the arbitrary resolution being an implementation of a standard, which it isn't. The view formulated in a non-misleading way is simply "if the standard does not specify semantics, I can as a matter of fact just use my own proprietary interpretation instead". Which is trivially true, but also completely useless if your goal is interoperability, while, if you don't care about interoperability, why care about the standard in the first place?
- inimino 9y agoPeople write software. Standards come later. Your standards zealotry is blinding you to how software development gets done and how the Web really works. You are calling "indefensible" the way the entire industry actually works. Maybe you want to step back and look at why that happens.
- kazinator 9y ago> There is nothing that prevents compiler writers to be equally "forgiving" and just inventing random semantics for stuff that does not have any meaning in the language, just as browsers do with HTML. And it would be just as idiotic. Well, pretty much status quo in the world of ISO C.
- im3w1l 9y agoCompilers do internally invent random semantics. Otherwise they could only give one compiler error at a time which would be pretty unproductive.
- zAy0LfpBZLC8mAC 9y agoWell, yes, and that occasionally shows exactly how idiotic it would be to actually produce code on that basis when errors after the first error are complete nonsense caused by the initial misinterpretation.
- cwyers 9y agoI'd like to introduce you to JavaScript, the HTML of programming languages.