📜 ⬆️ ⬇️

The place of web standards, as I see it

In the community of web developers, disputes about the need to comply with web standards have not abated for a long time. The essence of the standards themselves is an attempt to directly form the rules and criteria for the correctness of the code and structure of websites. At the moment of its development, web development is one of the most free forms of development, as modern browsers display the code of sites written with errors without any problems. On this basis, a quite reasonable opinion appears that there are no visible reasons for targeting standards that browsers do not need, and those who are able to correctly display incorrectly done resources, and the end user does not see and does not suspect the existence of a difference. There is also a rather controversial opinion about the ignoring of structural elements by search engines. But in fact, the question is somewhat broader.



Standards


')
The most authoritative structures that shape the “weather” in the world of web standards are two organizations: the World Wide Web Consortium (W3C) and the Web Standardization Working Group (WaSP)
The W3C consortium was formed in 1994, since then releasing more than 80 technical specifications and recommendations. Technologies identified by the Consortium include HTML (HyperText Markup Language), HyperText Markup Language, Extensible HyperText Markup Language (XHTML), CSS (Cascading Style Sheets), Document Object Model (DOM).
WaSP is an organization created by an independent web development team to support web content and software developers in the context of better implementing W3C recommendations.

Most web developers are accustomed to understand by the concept of web standards a specific specification on how to execute code. But in addition to the so-called "validity" of the code, standards imply a deeper, more logical compilation of content. In other words, the document may be completely "valid", but it does not at all correspond to the standard. In accordance with the standard, all logical elements should be used for their intended purpose. This will allow the document to more freely interact with external services and analyzers. In other words, a document formed on a semantic basis is the proper structuring of a document, in which each HTML structural element is chosen not on the basis of how it looks in the browser, but on the basis of its semantic purpose.
Semantic layout implies following the concept of separation of structure and presentation. Recommended by the HTML 4.01 Specification, the concept calls for using hypertext markup language only to describe the structure of the document, and another W3C approved standard - Cascading Style Sheets (CSS) is proposed for the visual presentation of this structure. It is also necessary to pay attention to the fact that, according to the concept of separation of structure and presentation, all decorative elements must be described separately from the content of the document.

Thus - the use of complex block structure for the implementation of design elements
<div id="rounded-box">
<b class="r3"></b><b class="r1"></b><b class="r1"></b>
<div class="inner-box">
<p>.</p>
</div>
<b class="r1"></b><b class="r1"></b><b class="r3"></b>
</div>



instead of using tables for the same
<table id="rounded-box">
<tr>
<td class="r3"></td><td class="r1"></td><td class="r1"></td>
</tr>
<tr>
<td></td><td>
<p>.</p>
</td><td></td>
</tr>
<tr>
<td class="r1"></td><td class="r1"></td><td class="r3"></td>
</tr>
</table>



doesn't make the code more valid and generally doesn't make sense

A valid version of this piece of code should look like this:
<div id="idname">
<p>.</p>
</div>



Parsers



The principles and recommendations of web standardization make it easier to process documents with parser programs, such as browsers, search robots, etc.
Correct code generation allows parsers to reduce processing time due to the absence of the need to bring the code to the correct form. And it is worth paying attention to the fact that parsers that do not have code correction mechanisms will not process an incorrect document. An example of such parsers can be any XML handler, such as transformation when applying XSL styles.
The previously described principle of separation of structure and presentation allows you to weed out all unnecessary content that will lead to an increase in the speed of processing the document. And the elements used in accordance with its specification will make the indexing of documents more qualitative.

Even from a person’s point of view, redundant code with a bunch of misused empty elements <b> seems absurd (of course, if you consider html code as an xml structure, as parsers do)

<div id="rounded-box">
<b class="r3"></b><b class="r1"></b><b class="r1"></b>
<div class="inner-box">
<p>.</p>
</div>
<b class="r1"></b><b class="r1"></b><b class="r3"></b>
</div>



Various devices



The principle of separation of structure and presentation makes it possible to customize the correct presentation of documents on different devices, regardless of structure. Such devices include mobile devices, digital projectors, televisions, and other devices.
SS allow to set separate style rules not only for visual, but also for printing devices. Using CSS, you can easily hide unnecessary elements during printing (various menus, news feeds, presentation blocks, advertisements, etc.) and print only the main content of the document.

And that means creating separate pages for print, mobile devices, etc. not properly!

Accessibility for people with disabilities



You need to understand that the quality of the code directly affects the availability of information to people with disabilities. Among specific devices for people with disabilities, braille displays and screen readers are worth noting. The quality of the presentation of information using such media devices directly depends on the structure of the document and they may misinterpret the content if the developer has neglected the standards. As the results of the research search system Opera Mama show for December 2008, the number of sites suitable for comfortable use by disabled people is extremely small, 0.7% optimized for screen readers and less than 1.8% for Braille displays.

W3C encourages developers to make it possible for people with disabilities to stay on the Internet as simple and convenient as possible.

And here again we will return to the structure of the html document, its elements should go in the same sequence in which their rendered representations go. The fact is that the information is read by screen reader programs in the order in which it goes in the code.

The attribute of alt images should bear the same meaning as the image itself, because basically its contents are taken in the place of images by people with vision problems.

Saving resources



The use of standards can lead to significant savings in both labor and technical resources. Compliance with standards is highly desirable, even if everything works in current versions of major browsers, this may change in future releases. Using standards is an insurance that your product will work regardless of browser development in the future.

Due to the separation of structure and presentation, the page consists of several separate documents that contribute to the elimination of redundancy and, as a result, leads to a decrease in the weight of the page. In addition, all external files are cached by browsers, and correctly composed code does not need to be fixed. All this leads to an increase in page loading speed and a decrease in server load. Also the maintenance of sites based on the principle of separation is much easier.

It makes no sense to make separate web pages for specific versions for different devices, which leads to a decrease in labor costs for development and maintenance. CSS allows you to fully control the visual presentation of web pages - hide and display structural elements, change their location, size and appearance.

Conclusion



I undertook to write about this not in order to persuade the use of standards, I just want to show how I see it all and can be dispelled by someone else's delusions. I deliberately keep silent about the problems encountered in attempting to meet the standards, they are quite obvious and it seems to me that they will be reduced by weight given in the comments.

Source: https://habr.com/ru/post/76323/


All Articles