RR (11,3,3): The broken web
There are some things I dislike, and then some I really hate about the web.
It happens that a lot of sites use non-compliant (considering both semantics and syntax) HTML, and nonsensical code at times. There are a few main types.
First, relatively common, is the use of XHTML syntax, inside HTML documents. It's a big problem, because HTML before HTML5 is supposed to act according to the SGML spec, which means that in
Next, extremely common, the use of tables to do layout. This is only acceptable if you haven't heard of CSS before, but, seriously, it doesn't make sense. Then there are sites that use 5 layers of nested tables. Seriously, unless there is a need to represent tabular data in table cells, nested tables are complete nonsense. And all the tables were used for layout.
Third, somewhat frequent, the use of JavaScript to do some things that can be done with CSS or HTML. Yes, submit buttons exist. No need to replace it with a button that fires a click event which then checks for form field validity then submits the form. Just add an onsubmit event handler to the form element. Also, hover effects can be accomplished using CSS, and should work regardless of element type. It doesn't just work on links.
Fourth, usage of transitional doctypes (such as HTML 4 Loose and XHTML 1.0 Transitional) is stupid. The only case you'd need it is if you never studied CSS, despite the plenty of tutorials available online. (Although I have to agree, some of the tutorials are outdated and only apply to really old browsers; even then they focus and making it work in major browsers rather than being standards compliant.)
And that bracketed text above brings up the fifth point: Code to standards, not to make it work in browsers. When I first modded this blog template, the navbar didn't display in Firefox 2, then the latest version. Did I revert the code? No. There really is no point to going against standards-compliance just to make it work in a browser. This has 2 possible outcomes. First, because a lot of sites use "workarounds" for flaws in a browser, the browser vendor might opt to not fix that flaw, because the "workaround" will then make those sites render "wrongly". This was considered by the IE dev team for IE8, but they decided to do something less evil. Which leads to the other option: Fix the browser, let the webmasters fix the web. Eventually the older browsers which don't correctly support the standards will get eliminated. A lot of "Web 2.0" sites already don't support IE6 and below, simply because support for these ancient (2001 and earlier) browsers is simply retarded, especially since IE6 is out of phase. Granted, IE7 still sucks somewhat at rendering, but at least it's a lot better than IE6 (but still far behind Firefox 2, released just a few days after IE7).
Then that also leads to the 6th point: Does your site really need the flashy stuff? (Technically correct term is "SWF objects", technically incorrect but extremely popular is "Flash movies".) More often than not, the functionality can be replaced by using JavaScript appropriately, especially with SVG (an alternative for vector images) or canvas (for raster images). Then there's also the video and audio tags, which can be controlled by JavaScript.
Seventh, not really an important point, but I shall say it anyway. If you use CSS to change the foreground colour, make sure you change the background colour as well. Same for the converse. This is to avoid white-on-white or black-on-black text. Never assume the default colours.
PS: Most criticism is directed at a specific site required to be used by my school, although some are quite general and do not apply there (such as the sixth point), but still, that's no excuse.
PPS: I have better things to do than rant about the web for 45 minutes. I don't think I'll be doing these rants again often. They take time.
It happens that a lot of sites use non-compliant (considering both semantics and syntax) HTML, and nonsensical code at times. There are a few main types.
First, relatively common, is the use of XHTML syntax, inside HTML documents. It's a big problem, because HTML before HTML5 is supposed to act according to the SGML spec, which means that in
<br/> the slash ends the tag, making the right "angle bracket" (aka the greater-than sign) not part of the tag, which is, well, going to do something unexpected. I don't know exactly what because I haven't read the SGML specs, or anything regarding SGML either. Then another is the inclusion of XML namespaces. They are not supposed to be in HTML documents, simply because that doesn't make sense, since HTML is not XML. (There's also the reverse problem of using HTML syntax in XHTML.)Next, extremely common, the use of tables to do layout. This is only acceptable if you haven't heard of CSS before, but, seriously, it doesn't make sense. Then there are sites that use 5 layers of nested tables. Seriously, unless there is a need to represent tabular data in table cells, nested tables are complete nonsense. And all the tables were used for layout.
Third, somewhat frequent, the use of JavaScript to do some things that can be done with CSS or HTML. Yes, submit buttons exist. No need to replace it with a button that fires a click event which then checks for form field validity then submits the form. Just add an onsubmit event handler to the form element. Also, hover effects can be accomplished using CSS, and should work regardless of element type. It doesn't just work on links.
Fourth, usage of transitional doctypes (such as HTML 4 Loose and XHTML 1.0 Transitional) is stupid. The only case you'd need it is if you never studied CSS, despite the plenty of tutorials available online. (Although I have to agree, some of the tutorials are outdated and only apply to really old browsers; even then they focus and making it work in major browsers rather than being standards compliant.)
And that bracketed text above brings up the fifth point: Code to standards, not to make it work in browsers. When I first modded this blog template, the navbar didn't display in Firefox 2, then the latest version. Did I revert the code? No. There really is no point to going against standards-compliance just to make it work in a browser. This has 2 possible outcomes. First, because a lot of sites use "workarounds" for flaws in a browser, the browser vendor might opt to not fix that flaw, because the "workaround" will then make those sites render "wrongly". This was considered by the IE dev team for IE8, but they decided to do something less evil. Which leads to the other option: Fix the browser, let the webmasters fix the web. Eventually the older browsers which don't correctly support the standards will get eliminated. A lot of "Web 2.0" sites already don't support IE6 and below, simply because support for these ancient (2001 and earlier) browsers is simply retarded, especially since IE6 is out of phase. Granted, IE7 still sucks somewhat at rendering, but at least it's a lot better than IE6 (but still far behind Firefox 2, released just a few days after IE7).
Then that also leads to the 6th point: Does your site really need the flashy stuff? (Technically correct term is "SWF objects", technically incorrect but extremely popular is "Flash movies".) More often than not, the functionality can be replaced by using JavaScript appropriately, especially with SVG (an alternative for vector images) or canvas (for raster images). Then there's also the video and audio tags, which can be controlled by JavaScript.
Seventh, not really an important point, but I shall say it anyway. If you use CSS to change the foreground colour, make sure you change the background colour as well. Same for the converse. This is to avoid white-on-white or black-on-black text. Never assume the default colours.
PS: Most criticism is directed at a specific site required to be used by my school, although some are quite general and do not apply there (such as the sixth point), but still, that's no excuse.
PPS: I have better things to do than rant about the web for 45 minutes. I don't think I'll be doing these rants again often. They take time.

0 Comments:
Post a Comment
<< Home