HTML 的宽松标准对互联网是有害还是有益

发布于 2024-07-14 03:55:07 字数 408 浏览 6 评论 0原文

我正在阅读 O'Reilly 的 学习 XML 书籍并阅读以下内容

HTML 在某些方面是一种倒退。 为了实现必要的简单性 真正有用的一些原则 必须牺牲通用编码。 ...回到理想 通用编码,有些人试图 使 SGML 适应网络...这证明了 太难了。

这让我想起了一个 StackOverflow 播客,其中他们讨论了在浏览器上运行的格式不良的 HTML。

我的问题是,如果标准像开发人员现在希望的那样严格,互联网还会如此成功吗?

I was reading O'Reilly's Learning XML Book and read the following

HTML was in some ways a step backward.
To achieve the simplicity necessary to
be truly useful, some principles of
generic coding had to be sacrificed.
... To return to the ideals of
generic coding, some people tried to
adapt SGML for the web ... This proved
too difficult.

This reminded me of a StackOverflow Podcast where they discussed the poorly formed HTML that works on browsers.

My question is, would the Internet still be as successful if the standards were as strict as developers would want them to be now?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

‘画卷フ 2024-07-21 03:55:07

标准执行的缺乏丝毫没有影响网络的采用。 如果有什么的话,那就是它有所帮助。 该网络最初是为科学家(他们通常对编程缺乏耐心)设计的,用于发布研究结果。 因此自由解析器允许他们不关心标记 - 足够好就足够了。

如果它没有在科学家中取得成功,它永远不会迁移到学术界的其他领域,也不会从那里迁移到更广阔的世界,而且今天它仍然是一项学术活动。

但既然它已在更广阔的世界中传播,我们是否应该加以限制? 我认为没有任何人这样做的动力。 浏览器制造商想要获得市场份额,但他们无法通过对自己正确显示的页面感到恼火来获得市场份额。 内容网站想要吸引人们,但他们不能仅通过在 Opera 中正确显示来实现这一目标。 开发商的游说团体目前还不够。

此外,前端开发人员可以收取高额费用(相对于视觉设计师)的原因之一是因为他们了解各种浏览器的来龙去脉。 如果只有一种正确的方法,那么它可以自动完成,并且不再需要这些人 - 好吧,无论如何,不​​需要程序员的薪水。

Lack of standard enforcement didn't hurt the adoption of the web in the slightest. If anything, it helped it. The web was originally designed for scientists (who generally have little patience for programming) to post research results. So liberal parsers allowed them to not care about the markup - good enough was good enough.

If it hadn't been successful with scientists, it never would have migrated to the rest of academia, nor from there to the wider world, and it would still today be an academic exercise.

But now that it's out in the wider world, should we clamp down? I see no incentive for anyone to do so. Browser makers want market share, and they don't get it by being pissy about which pages they display properly. Content sites want to reach people, and they don't do that by only appearing correctly in Opera. The developer lobby, such as it is, is not enough.

Besides, one of the reasons front-end developers can charge a lot of money (vs. visual designers) is because they know the ins and outs of the various browsers. If there's only one right way, then it can be done automatically, and there's no longer a need for those folks - well, not at programmer salaries, anyway.

打小就很酷 2024-07-21 03:55:07

当今网络上的大多数歧义和不一致并不是来自未封闭标签之类的问题,而是来自一个浏览器与下一个浏览器之间的 CSS 语义不一致。 即使所有网页都是奇迹般地格式良好的 XML,也没有多大帮助。

Most of the ambiguity and inconsistency on the web today isn't from things like unclosed tags - it's from CSS semantics being inconsistent from one browser to the next. Even if all web pages were miraculously well-formed XML, it wouldn't help much.

乖乖哒 2024-07-21 03:55:07

事实上,html 只是“标记”文本,而不是一种具有运算符、循环、函数和其他常见编程语言元素的语言,这使得它可以被松散地解释。

人们可以将这种松散的解释与使标记语言更易于访问和使用从而允许更多“未受过教育”的人接触到该语言相关联。

我个人的看法是,这与互联网的成功没有多大关系。 相反,沟通和共享信息的能力使互联网“成功”。

The fact that html simply "marks up" text and is not a language with operators, loops, functions and other common programming language elements is what allows it to be loosely interpreted.

One could correlate this loose interpretation as making the markup language more accessible and easily used thus allowing more "uneducated" people access to the language.

My personal opinion is that this has little to do with the success of the Internet. Instead, it's the ability to communicate and share information that make the internet "successful."

冷情 2024-07-21 03:55:07

这对互联网造成了很大的伤害。

我记得听过一个对 HTML 2.0 规范和 IIRC 工作人员的播客采访,当时围绕解析器遵守该标准的严格性进行了一场大辩论。

这场争论的获胜者采用了当时流行的“一个实施良好的系统应该在接受内容上宽松,在输出内容上严格”的方法。

AFAICT 现在很多人认为这种方法过于简单化——原则上听起来不错,但实际上在实践中很少奏效。

在我看来,即使 HTML 从一开始就非常严格,它仍然足够简单,足以让大多数人掌握。 一开始的采用可能会稍微慢一些,但从中长期来看,可以节省大量时间/金钱(数十亿美元)。

It hurt the Internet big time.

I recall listening to a podcast interview with someone who worked on the HTML 2.0 spec and IIRC there was a big debate at the time surrounding the strictness of parsers adhering to the standard.

The winners of the argument used the "a well implemented system should be liberal in what it accepts and strict in what it outputs" approach which was popular at the time.

AFAICT many people now regard this approach as overly simplistic - it sounds good in principle, but actually rarely works in practice.

IMO, even if HTML was super strict from the outset, it would still have been simple enough for most people to grasp. Uptake might have been marginally slower at the outset, but a huge amount of time/money (billions of dollars) would have been saved in the medium-long term.

远昼 2024-07-21 03:55:07

有一个原则描述了 HTML 和 Web 浏览器如何能够成功地工作和互操作:

在接受的内容上保持自由,在输出的内容上保持保守。

需要有一定的自由度介于“正确”和“可接受”的 HTML 之间。 因为 HTML 被设计为“人类+rw”,所以我们不应该对标签汤有如此多的风格感到惊讶。 无论何时只要需要人类参与,灵活性就是 HTML 的优势。

然而,这种灵活性增加了处理开销,当您需要为机器消耗创建一些东西时,这可能很难证明是合理的。 这就是 XHTML 和 XML 的原因:它剥夺了一些灵活性以换取可预测的输入。

There is a principle that describes how HTML and web browsers are able to work and interoperate with any success at all:

Be liberal in what you accept, and conservative in what you output.

There needs to be some latitude between what is "correct" and "acceptable" HTML. Because HTML was designed to be "human +rw", we shouldn't be surprised that there are so many flavours of tag soup. Flexibility is HTML's strength wherever humans need to be involved.

However, that flexibility adds processing overhead which can be hard to justify when you need to create something for machine consumption. This is the reason for XHTML and XML: it takes away some of that flexibility in exchange for predictable input.

时光倒影 2024-07-21 03:55:07

如果 HTML 更加严格,一些更简单的东西就会产生互联网成为主流所需的网络效应。

If HTML had been more strict, something easier would have generated the needed network effect for the internet to become mainstream.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文