Apps

Five theories why developers write garbage HTML

Justin James reports that garbage HTML appears to be alive and well. He offers his theories on why some developers still crank out junk and discusses whether he thinks the problem is hopeless.

A little more than two years ago, I pleaded to my fellow developers to stop writing garbage HTML! I think that problem has gone from bad to worse.

A few weeks ago, I asked Programming and Development readers, "How good is your HTML?" and roughly 25% of you claim that it meets all of the standards and such. I know a lot of the readers of this blog fairly well, so I believe those numbers; but I also know that makes my readers a very small minority. Garbage HTML is, unfortunately, alive and well.

Here is some really sad news: less than 7% of the Alexa Top 500 validate! It's just a problem with those pages, right? Wrong. According to the researchers, "This is a slightly higher percentage rate than the much larger overall MAMA population, but the quantity and difference are still too small to declare any trends." In other words, that sorry 6.57% valid rate is actually better than the Internet on the whole.

For a moment, let's assume that Web standards are not the "be all and end all" of Web development. Judging from the more than 50% of readers who said their HTML is "good enough for it to display the way I want it to on all or most major browsers," I think it can be said that 100% standards compliance may be a goal, but it is not the most important one. For the majority of developers, the standards are a means to an ends, and that end is looking good. All that being what it is, I don't think a Web page that is slightly off of spec is garbage HTML. It may not be perfect, but that doesn't make it garbage.

Garbage HTML has a special something to it, a unique blend of being not just invalid, but disgustingly so by going beyond minor misunderstandings or typos and far into the realm of negligence -- improperly nested tags, tags that are never properly ended, incorrect attribute usage, and so on. Why do developers crank out this junk? Here are my theories:

  • Ignorance: A good number of developers don't know better, whether because they did not seek to learn good HTML, or where they learned it from did a lousy job of teaching HTML. The folks who "learned" HTML by copy/pasting other people's junk code fall into this bucket.
  • Poor tools: Many developers count on a tool to produce their HTML, whether it's some sort of HTML WYSIWYG system, or maybe a framework/library that is cranking out bad code. There are reasons why some of these tools can't generate code. For example, until recently, those on-screen, Web-based HTML editors had a much easier time rendering the font tag than a CSS class or even an inline style. The end result? HTML widgets that were generating the font tag for HTML nearly 10 years after font had become deprecated. Another problem is that there is not a 1:1 mapping of stylistic effects and the way to make the effects happen. Without editors that are strictly contextual driven, there is no good way for the tool to know that [Ctrl]I should result in the em tag as opposed to a CSS style that makes something italic.
  • HTML is too semantic: HTML is transitioned to being as purely semantic as possible without completely breaking backwards compatibility. In general, this is a good thing. But for a developer who is trying to finish their work and go home, it is a nightmare. Which tag does the developer use? What if the developer wants the effect that a tag produces, without the meaning of the tag? It's enough to drive anyone insane. So what happens? Developers stop caring about what the HTML "means" and just do enough to make the page render the way the client wants it to look. In the shuffle, the HTML ends up being a mess.
  • Developers who never updated their HTML skill sets: This is a huge problem. I know developers who this very week probably used the font tag or maybe a frameset. Maybe they learned HTML in 1997, or the book they bought on the bargain bin in 2002 was from 1997. Who knows? But their HTML is stuck in the HTML 3 years, and they haven't updated it since.
  • Server-side technologies: In my opinion, using print statements (or the equivalent) to produce large amounts of HTML is asking for trouble. The page can't be "visualized" as HTML without first mentally executing software. That is a sure way to not be able to get the code right.

Is the situation hopeless?

I think some parts of this problem are not likely to be corrected. Most developers who care about doing things right are using tools that combine just enough visualization to make life a bit easier, without completely taking over the process. Some developers may be running their code through validators or keeping current on what is correct and what isn't. But at the end of the day, there is no way to force a developer to start caring about these things unless you are their boss. After all, browsers will display even the worst HTML code, as long as it somewhat makes sense.

I'd be willing to bet that the percentage of developers writing garbage HTML has remained steady over the years. The 80/20 rule probably applies here (as it seems to do in so many other areas). In my experience, only about 20% of developers really understand how to accomplish something as well as why they should do it that way and what the consequences are. That's the same 20% or so who are probably writing decent HTML.

I am sure that the Web would be better off if more developers put forth the effort to write better HTML.

J.Ja

Disclosure of Justin's industry affiliations: Justin James has a working arrangement with Microsoft to write an article for MSDN Magazine. He also has a contract with Spiceworks to write product buying guides. --------------------------------------------------------------------------------------------------------------- Get weekly development tips in your inbox Keep your developer skills sharp by signing up for TechRepublic's free Web Developer newsletter, delivered each Tuesday. Automatically subscribe today!

About

Justin James is the Lead Architect for Conigent.

85 comments
cmhatte
cmhatte

I've met a few people who went to school for Web Development. I have the feeling that some instructors are not keeping up with the changes in standards. Students are learning table-based design, not self-closing img, br, or input elements. It's frustrating to see instructor not teaching it right, and students spending all this money to learn it wrong.

Deadly Ernest
Deadly Ernest

answer. As I've said many times, too many web sites are built be people who are graphics artists and not coders. They use tools like Front Page, Dream Weaver, MS Word, and the like to develop pretty looking pages and then let the tool create the horrendous code. They don't even know what a tag is, let alone what it does.

Polyglot
Polyglot

with Firefox and look at the Error Console. Yet this is a basic test any developer can use.

JosB
JosB

As everywhere, if it works it's good enough. If a website presents without too many problems in the main browsers of the target audience it's good enough. Developing websites isn't core business for a lot of companies presenting websites on the internet. So why put a lot of effort in it when it's good enough in 95% of the cases? They won't lose millions over it, don't go out of business because of some bad HTML.

jack
jack

I'm retired now, after 35 yrs. in IT. Started writing programs in 1967. Back then there was a very specific set syntax rules to follow. Compilers just weren't that smart. In school we were graded as much for how the program was structured as whether or not the program worked. This "discipline" paid many dividends, especially for the maintenance programmers who came later to enhance or change the program. Well structured code is more important today because of its complexity. I get sick looking at code that is not well thought out or documented. Writing even good code today is a lost art. I'm an 80/20 man also. I truly believe 80% of today's developers/coders don't belong in this business. They see it as "good money" an that's it. The other 20% have pride in their work and truly love this profession, as I did. They say if you love what you do for a living you won't "work" for a living. I haven't worked a day in my professional life and consider myself extremely fortunate to have been a part of this industry. I could write a book about this but I'm having too much fun learning something new every day. Jack Foley, Tucson (jackintucson)

akeane
akeane

Your reply was the last one in the list and this is the most important one. There is more to writing code to produce a website than the code itself. Things need to be logically structured and commented and use meaningful names... mainly for maintaining it. I would love to see some of the people who write junk code (and not just html...the overall code) try to change it 6 mos to a year later. I can bet they will just put more junk in to 'make it work'. I recently worked on a project to make some static pages for SEO purposes. Well the 'junk' I had to work with was a 'sin' with a capital 'S'. I was ashamed for them. It wasn't just the code but it also didn't work correctly. I'm not perfect but at least someone else can read my code and maintain it. I also believe that CSS is the answer. It 'removes' a lot of extras from the HTML itself and if one uses meaningful names for classes and id's then heck it is readable! But if you make it readable than anyone could write it and programming would become less 'hard' and people won't think you are a genius and heck there is job security to think about. RIGHT! Let's make it the best you can and how about caring about what you produce! There are some excellent websites that explain good HTML and CSS coding... check out CSS_play or Zen Garden or Dynamic Drive (most of them)... if you can recognize garbage then don't use it in your work. Sorry this is soooo long but I have worked on two projects recently written by other people and both were not even worth using on the bottom of a bird cage. Long live caring programmers! Atlas Shrugged!

dcbohn
dcbohn

As a developer, I have script debugging turned on in my browsers. What gets me is the amount of errors that pop up on a daily basis at major sites. Most people do not see this because they don't have script debugging enabled. I grant you that it is just as often caused by the ads, but this is the first generation of coding that I have seen that is fine with code that produces errors.

Justin James
Justin James

I am also truly stunned by it. I know I would be fired it the code I wrote threw off errors on 60% of PCs. But somehow, the perception all too often is, "oh, it works in browser XYZ, so that's good enough for me". I am also baffled by what features these could be that aren't working, yet the site seems fine... maybe the features should be removed entirely? J.Ja

Osiyo53
Osiyo53

The technicalities of whether or not a particular web sites absolutely conform to "standards" does not bother me nearly so much as it might seem to bother you. What bothers me more is just "junk" websites that are poorly laid out. Hard to navigate so as to find the specific information one is looking for. Intrusive, time wasters, and hard to read due to all the pop-ups and hover hints, special effects, and so on and so forth. All find and well if its a personal web site. Let the author display all the bells and whistles and his artistic and creative talents he wishes. Bad news for professional web sites. I frequently go into the web sites of some very large and well known businesses as part of my work. For instance, I might be looking up the technical data of something I'm considering buying for a project I'm working on. The key point being .... I'm WORKING. I sure as heck don't give a rip about all those snazzy special effects that too many seem to deploy on their web sites. Ohhh, it looks nice, etc. But, GAD ... I'm working and in a hurry. I'm not there to be dazzled by special effects. I don't want to wait while yah insist upon downloading onto my computer a streaming video to show me how wonderful you are. I'm especially not interested in having to downloading the latest version of whatever (CODEC, video player, etc). You're likely just to pi** me off. And what's with all the damned hover hints, expanding panels with ads that expand if yah just happen to move your mouse pointer across it, etc. How the heck can I read those things I want to read, efficiently and quickly if all that junk keeps getting in the way? And many of those web site designers would benefit from the following. Pick a few people off the street at random. Sit em in front of a computer screen with the main page of the company site. And ask em to find the kind of specific, detailed technical data that a REAL customer might want to quickly look up on said site. Let somebody from the "outside", not connected or affiliated with the web developer, see if they can locate and retrieve such info readily and easily. I've seen sites of major businesses where I had to spend 15 minutes just to locate the section of their site I wanted to get to, Yep, I'm sure that the web site developer, and the employees of that company know how to navigate the site well. But I'm telling you that outsiders have a hard time of it. On such poorly laid out and thought out web sites, if I have the option ... I take my business elsewhere. Haven't the time for nonsense. For such sites that I can not avoid, because I need to do business with them, I most definitely give em feedback telling them what I think. Some have even responded by making changes. Note ... in general don't send such feedback to the web master. They tend not to listen or heed, maybe too proud of their razzle-dazzle accomplishment? But for me, I'm more interested in content and MEAT than I am in how artistic the web site creator is. Unless I'm browsing in my leisure time. In which case a little razzle-dazzle and special effects, fancy animations and videos, etc might be called for. Just some thoughts.

SeaBerry
SeaBerry

In fact, HTML is a hypertext markup language (with emphasis on "markup" here). In contrast to programming languages with their "algorithms + data" formula HTML and CSS are designed to mark up texts (content) and to describe the document presentation. Such a difference means also difference in developers' skill sets and aptitude. That is why some people separate programmers and developers / coders. And, IMHO, that is why psd-to-html/css, design-to-xhtml, and so forth services emerge everywhere today. They are narrowly specialized in W3C-valid html/xhtml/css coding. Maybe the time is ripe for best-of-breed, not for "jack-of-all-trades"? Sean www.htmlcut.com

Justin James
Justin James

I think that HTML specialists are needed too. Unfortunately, HTML is trivialised as a skill, and many people just assume that since tools produce it as output, that means they don't need to think about it. :( J.Ja

david_horsman
david_horsman

In my view there exists a conflict between browsers that attempt to be fault tollerant (and render their best guess at what was intended by the HTML) and a more strict and formal validation of the mark up. This problem is further compounded by the limits of the specification of each feature used in the browsers, many of which are open to inturpretation Regards, Dave Horsman

PJfromOttawa
PJfromOttawa

Oh, sorry. I got off at the wrong intersection. Which way to the "Video games are the root of all evil" argument?

crp
crp

Hello, I strive to get all of my pages to validate with the W3C validator, which is very easily accessible via the drop down tool bar menus from my Firefox add on called Web Developer. It has configured validators for html, css, feeds, links, Section 508 [accessibility], and WAI. I also spend quite a bit of time looking things up on the W3C Schools web site. I figure since they are the entity responsible for writing the standards for html, etc that they are a very good place to learn how to do my own coding. Running the W3C html validator on your blog page just now returned a phenomenal 370 Errors, and 213 warnings. Here is a link to those results if you'd like to take a look at them. http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fblogs.techrepublic.com.com%2Fprogramming-and-development%2F%3Fp%3D896%26tag%3Dnl.e055 Likewise, running the W3C css vaidator on it returned the following message - "Sorry! We found the following errors (22)" and once again, here is the link to those results. http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fblogs.techrepublic.com.com%2Fprogramming-and-development%2F%3Fp%3D896%26tag%3Dnl.e055 I won't bother you with your results for the other vaidators. Web Developer add on also has an error console which points out errors, and can be set to pop up on errors, warnings, and messages. The errors are for the most part for javascript, and you only had one of those in error console. "Error: Permission denied to call method Location.toString" There were many warnings on the other hand. Warning: Expected end of value for property but found '0px'. Error in parsing value for property 'border'. Declaration dropped. Source File: http://i.techrepublic.com.comcss/base.css Line: 223 I am able to use the QWeb Developer menu Information, Document Size to get a listinng of the url for every element that makes up this page, and in examining your base.css file I see that sometimes the border property is given the value 0px, and sometimes "none" Here is a javascript error caught by error console. Warning: test for equality (==) mistyped as assignment (=)? Source File: http://blogs.techrepublic.com.com/include/js/cnet-common.js Line: 14, Column: 219 Source Code: }return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null; This next one I believe is cause by bracket mismatching. Warning: anonymous function does not always return a value Source File: http://blogs.techrepublic.com.com/include/js/cnet-common.js Line: 13, Column: 85 Source Code: XY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.p There were six of the function doesn't always return a value type, and then an error caused by one of the adcode modules you have on your page, about assigning a value to an undeclared variable, which I find quite often in Google's Adsense scripts, even on my own sites, which embarrasses me to no end. The very code they give you to paste into your pages has several undeclared variables being assigned values, and that's before it even calls the main scripts from their servers. I do all of my html, css, and JavaScript coding nowadays, in the text editor found in Ubuntu Linux which color codes each of them according to tag or command type, and also has auto complete for brackets. I find this gives me much better control than a wysiwyg editor ever did, which would often change things I had edited myself in raw code mode, often breaking what I was trying to do. I am constantly amazed at the frequency with which my error console jumps up as I surf the web. Nearly every page I load has many, many errors in them. Another thing I notice a lot is the prevalence of mis-spelled words, when it's so easy to turn on a spell checker, why? There were several misspelled words in this blog page as well. I'm not the world's greatest speller, or typist for that matter, but I always use my spell checker. I often wind up reloading my pages to my web site many times, as I go through the upload, then proof read, then correct and upload again cycle, until I finally get them just right. However I do not do this for a living, so there is no sense of urgency for me to get things out in production mode, I can take my time about it. One last thing, your page weighs in at a hefty Total 452 KB (457 KB uncompressed) according to the Web Developer Document Size menu entry, which is a bit big for loading quickly. So, I guess the "garbage html" is a little more wide spread than you thought it was, eh??? Have a good day. Later, Ray Parrish

Justin James
Justin James

Ray - Good comments. I am in total agreement regarding the quality of the HTML on this page. However, I have 100% nothing to do with it. I do not even turn my blog as written into the HTML that goes into the system, someone else handles that end. I have mentioned this quite a number of times to the people responsible, and I can't do any more than that. Regarding perceived spelling errors, please point them out. When I sent this article in, the only two spelling "errors" were "validators" (which is not a real word, apparently) and "Alexa" which is a company name. Additionally, the only true grammatical error detected by Word in my draft was in a sentence which was removed in later edits. In fact, copy/pasting the blog contents into Word reveals two spelling errors... "Alexa" and "validators". And speaking of "mistakes"... "I also spend quite a bit of time looking things up on the W3C Schools web site. I figure since they are the entity responsible for writing the standards for html, etc that they are a very good place to learn how to do my own coding." W3C Schools has *nothing* to do with the W3C that creates/maintains the HTML (and other) specs. It is a Web site owned by "Refsnes data". It says so at the bottom of every page. J.Ja

crp
crp

Hello again, I'm sorry, I re-read the original article, and this time through, I cannot see any spelling mistakes at all. I don't know how I came to that conclusion before. As to my mistake, the W3C.org site claims as follows at the top of their front page. [Well, I just read their document use guidelines, and I cannot quote them exactly as I originally intended due to their rules about usage of that content, so I'll paraphrase.] The (W3C) develops specifications... On their "About W3C" page they state that they have developed 110 standards called "W3C Recommendations", which leads me to now believe that they do not have authority exercised from some appointment by law as I had previously believed. Instead they appear to be an international group founded to attempt the standardization of web languages and protocols, but has no real authority to do so, even 'though they are led by Tim Berners-Lee, the inventor of the world wide web. The statements on the W3C site led me to believe that the W3C writes the specifications for HTML, which they do appear to do. Since the W3C Schools uses the same name, I have been assuming that they were part of the same organization. It had never occurred to me to doubt the connection between W3C.org, and w3schools.com and I thank you for pointing this out to me. I also have just noticed that their domain does not contain the "c", but only has "w3" which I had never noticed before either. There is one page that comes up in search results for "W3C Schools" on Google that actually has the title "W3C Schools", and links to them with a link also called "W3C Schools", but the url, and name of the actual site upon arrival once again is sans the "c". I guess that shows how much I pay attention to detail, eh? From now on I will strive to read closer before making claims like that. I do still believe that W3 Schools is an excellent place to learn web coding, and they do seem to follow the standards published by the W3C. OK, I'm now noticing that the W3C does not use the "c" in their domain name either, they are actually at www.w3.org. It's funny how the mind supplies expected detail for you when you do not pay real close attention. I've made several references to them being at www.w3c.org above, and in fact they are not, more mistakes on my part. 8-) I've also just discovered that W3 Schools has a tutorial on the W3C, and links to the actual standards at the W3C, so they are a good jumping off point for reading the standards. Well, I've rambled on long enough, I have to go correct one of my web pages with this new information. Your blog pages do render quite well, and work as expected in spite of the many non-compliant codings contained within it, so who's to say how important adherence to the standards is anyway? Have a nice day. Later, Ray Parrish

david_horsman
david_horsman

I have noticed W3 Schools in the past and also found them an excellent resource. You are probably being a bit harsh regarding your own diligence. Picking that name was clearly no accident and there are several variations involving misspelling, XXXnym's, XXXphones (like homonyms and homophones). Your eye and everyone else's naturally adds the C and this is further reinforced by the "c" within two letters of the "3". They also could have used W3.sCool and been very Cool at the same time (as long as they give me creative credit). I feel the buddy system in even better for proofing and editing than it is for computer programming. Two sets of eyes will catch twice the number of errors in half the time. Just the other day I was looking for software products that use the name WinDoze, the idea being a name for a program that works when the system is idle. Wow, I gave up on that idea. Best regards, Dave Horsman

dogknees
dogknees

Compare it to a "proper" programming language. Where are the formal definitions? The BNF definition? Where are the real context-based editors that include scripting and all the rest? So, when I'm entering javascript I get picklists for all the elements on the document that are appropriate to the context.

techrep
techrep

Some w3c brain waves are very stupid. Want you example? <nobr> This tag was removed from html 4.01 but is very important to keep elementary typographic rules. Next example is typographic wrong ----------- |This is a| |bird. | ----------- By typographic rules this should be ----------- |This is | |a bird. | ----------- If you use text-align:justify then only way to do it right is to use some like: <p>This is <nobr>a bird</nobr></p> Another w3c pearl is that <p><noscript>some text</noscript></p> is valid code but <table><tr><td><noscript>some text</noscript></td></tr></table> is invalid. Why? <p> and <td> are both block elements.

Justin James
Justin James

I can imagine why nobr was removed; it is a presentation-only tag, and HTML has been moving away from that. Additionally, CSS has a replacement, in the form of "text-wrap: none". I don't know how that reacts with text-align: justify, though. Can't say what the deal is with td vs. p in the noscript case. Part of the problem is that HTML 4 is really poorly defined; putting a noscript without a script is a good example of an error condition that probably isn't handled in the spec at all. J.Ja

techrep
techrep

CSS text-wrap: none is not a solution. This disable all text wrapping but nobr is used in different cases. (p)this is example for (nobr)2nd row(/nobr) of text(/p) This forum not allow other parenthesis. Typhographics rules says that "2nd" and "row" must be placed on the same row regardless to text wrapping.

Justin James
Justin James

Hmm. Can't you just use text-wrap: none in a span element to replicate the behavior of nobr? I know that it adds a bit of extra typing, but I'd imagine that it works. This is an interesting case though. It also highlights the fact that many of the technical realities of the Web are radically changing our written grammar. Remember hyphenation? Ten, twenty years ago, my word processor would hyphenate things for me. Now, no one does it anymore. Same thing for situations like you describe, about text wrapping. So few people care about it anymore. People no longer use proper em dashes or ellipses, and just use hyphens and triple periods instead. It is indeed an interesting shift! J.Ja

kitico
kitico

Justin, if you don't personally have to maintain the garbage HTML, then why are you so fired-up about this issue?

Justin James
Justin James

You are right that I don't have to maintain it, which alleviates a lot of the burden. But as someone who uses the Internet an awful lot, it affects me. I go to a lot of sites, and things just don't work right, and you look at the code and it is complete junk. Additionally, there are a number of projects I have worked on in the past which involved consuming HTML, and let me tell you, it is miserable to do that when the HTML is really ugly. Indeed, it is in everyone's best interests... cleanly written, properly marked up HTML is better for search engines, which means good things for users trying to find information, and the people presenting it. At the end of the day, there is relaly no good reason to not put forth some effort on better HTML, everyone benefits, no one gets hurt, and it is no more effort to write it (other than learning it to begin with) than it is to write junk (and, as you point out, maintenance is much easier!). J.Ja

Beauregard T. Shagnasty
Beauregard T. Shagnasty

Justin, I'll agree with just about everything you stated in your article. This includes the percentages. Several years ago, a doctoral candidate wrote his Ph.D. thesis on this very subject. In a nutshell, he wrote an auto-scanning application that checked the W3C validity of something like 12 million web sites. The result was I believe just under 7% valid. His results were talked about quite a bit in Usenet web authoring groups. (I can't find a link at the moment.)

chris
chris

"how" unvalid were those sites? 1 warning? 1 alt missing? just saying 7% valid is misleading as to "how bad" things are.

stephenlposey
stephenlposey

Excellent point. My cynical side suspects that "doctoral candidate" had commerical aspirations for his "auto-scanning application". Stephen Posey stephenlposey@earthlink.net

Justin James
Justin James

On the HTML 5 mailing list, someone pointed out that a large part of the problem is that a huge number of pages have an invalid DOCTYPE. If your page doesn't have a valid DOCTYPE, there is no way you will get a "valid" page, regardless of what the HTML looks like. :( J.Ja

Beauregard T. Shagnasty
Beauregard T. Shagnasty

Chris, if I could find a link, I'd ask you to read it. As expected, it was as long as a typical doctoral thesis. I do not remember the parameters for pass/fail. Neither does the article Justin quoted, "less than 7% of the Alexa Top 500 validate!" The linked page does not give pass/fail parameters. I doubt if a "warning" would mean failure. No, Stephen, it did not read as if the doctor had commercial aspirations.

BOUND4DOOM
BOUND4DOOM

Now I try to write excellent html. I prefer doing it all by hand in a text editor but there are some things I get errors on validating that I really just do not give a crap about. Missing Alt from images is my number one error I get and you know what I don't care. I am not going back and every graphic for the look and feel of a site and put in a alt tag for. So I there are other super stupid things that validators throw errors on and they really serve no purpose in the design of the site. Validators try to make sure we still support every browser back to linx. Which in reality you don't have the budget for or if they are using linx they definitely aren't you target audience.

Beauregard T. Shagnasty
Beauregard T. Shagnasty

"serve no purpose in the design of the site." I see this as you don't care about blind people, who rely on alt attributes (not tags) to be able to "see" your images in their screen readers. For decorative images, use alt="". This also applies to people (those with slow connections) who turn off image loading. Alt attributes are not a matter of supporting old browsers, but your handicapped visitors. In fact, since most old browsers can't pass the Acid test, validation means little to them.

Justin James
Justin James

Right on. On the HTML 5 mailing list, alt is extremely contentious. Some say that it should be optional for decorative cases, others say that the empty string should be used, and still more want an empty "noalt" attribute for those cases. The general frustration for many, is that by allow no alt attribute in some cases opens the door a bit wider to no alt when it really should be there. Personally, I feel that people who carre about this will put proper alt where needed, and people who don't care won't put it in, regardless of what the spec says. J.Ja

jskean
jskean

You must have some pretty tiny pictures if an alt string doesn't load faster than its associated image in a no-graphics browser. No one can force you to care about the blind, but please give the issue some more thought. Also, you should stop using "your" for "you're". And quit wearing that baseball cap backwards!

BOUND4DOOM
BOUND4DOOM

If you have a graphic intensive site, and you have to put alt="" all over the place now your adding in a bunch of extra bytes you really do not need. All those little things that do not need to be there but some one says oh just leave it blank all add up. To throw it back to the argument people turn off images because they are on a slow connection, well your not helping bring the page up any faster with tons of extra alt tags that are empty on layout and decorative images.

chris
chris

for users who don't actually see with their eyes. give a crap about those people? Same holds true for title tags and it is the primary reason NOT to build with tables unless its a dataset

N!tr0
N!tr0

I don't have an issue with server-side code. I prefer it. It may take a little more work to get it right but it's well worth the effort. Whether you use server-side includes, print statements, or pulling code from a database. Take time to get it right and then it will save a lot of time down the road.

chris
chris

just chop out anything that is repeated and away you go. for the uninitiated it's something like this ...html code up here and stuff.... [php include header.inc.php] ..maybe some code... [php include main-menu.inc.php] ...more html code here [php include left-sidebar.inc.php] ...you content code.... [php include footer.inc.php] Then when you want to make a change, you change one file, once.

chris
chris

Could you list or point us to resources that explain why we should bother, other than "you just should"? NOTE: I DO try to be compliant and work hard to code "properly", I just think it would be a good addition to this discussion.

Tony Hopkinson
Tony Hopkinson

It's along run because of how long and how much crap is about. One of the reasons you don't see strict compliance browsers about is because 99% of web pages would be inaccessible. Why will it save resources? If you wanted to parse HTML, how much more does it cost in development, testing, maintenance and enhancement time. To deal with say something as simple as a missing close tag? At the moment making every web page in teh world valid in one go, would cost a wee bit more, that's absolutely no reason not to at least sort out pages your are devloping as you go along though. If nothing eles they load faster, more to the point predicting how different browsers will render them is far simpler. Just proper closure would make a huge difference.

Justin James
Justin James

* Accessibility - many aspects of the HTML standard (and not enough, according to many accessibility experts) are geared towards helping disabled users use the Web. * Faster rendering - valid HTML is easier for the browser to parse. * More accurate rendering - this is, unfortunately, not always true. Also keep in mind, many rendering discrepensies are at the CSS, not the HTML level. Just a few, I am sure other folks can name some more! J.Ja

roger.reading
roger.reading

In the point "Developers who never updated their HTML skill sets:" you mention framesets, so what's so bad in using frameset to create independant page spaces for navigation, main window, etc.? What would you recommend using in stead? Roger R.

hercules.gunter
hercules.gunter

The printing issue has been mentioned - the only browser which does a decent job seems to be IE. The biggest issue would seem to be the difficulties of handling framesets with non-visual browsers - presumably the same issues faced when printing them. Not being visually impaired, I have difficulty grasping the issues. Few Web pages take "accessibility" issues into account, and this is one of those issues. For alternatives to using framesets, examine the source of this very page. It's big, it's complex, and it has no frames.

Justin James
Justin James

I agree with the fact that framesets make a lot of scenarios better, particularly reducing the overhead of a lot of pages. Unfortunately, they are a usability nightmare. Bookmarking, printing, etc. That's why iframe exists. It retains much of the utility of framesets, without having the same problems (when used sanely, of course). I supposed someone can replicate framesets using a bunch of iframes, if they really wanted to... J.Ja

Justin James
Justin James

* Server side includes * A templating engine or CMS * The iframe element J.Ja

chris
chris

who wants to be forced to a SITE's main page instead of bookmarking directly to the content you want? And what about printing content? You gotta jump through hoops depending upon the browser. The only use I could think of might...might be a photo gallery. Just use navigation.

N!tr0
N!tr0

I find that server-side includes work much better.

Raymond_Sonoff
Raymond_Sonoff

A "proof-by-example" that adhering to Web Standards/Recommendations is a "win-win" way to go can be found throughout Sonoff Consulting Services, Inc.'s (Scsi's) Productivity and Knowledge Transfer (P&KT) Web sites at URL addresses http://sonoffconsulting.com/ and http://sonoffconsulting.mobi/. What do I mean by the above statement? First, use of "plain vanilla" HTML that validates contributes significantly to higher Search Engine Optimization (SEO) results and Web usability factors. Second, writing your HTML so that it also addresses Web Accessibility Initiative (WAI) and Web Content Accessibility Guidelines (WCAG) contributes to increasing Web accessibility. I encourage anyone who wants to learn more of the details that support the above statements to pore over the Web pages for the above-cited domains and "put them through the testing wringer" to become convinced that such efforts truly do have a long-term payoff in both customer-centric focus and Web development/support areas. Good luck and have fun! Raymond Sonoff, President Sonoff Consulting Services, Inc. 271 Saxony Drive Crestview Hills, KY 41017-2294 Tel.: (859) 261-5908 e-mail: info@sonoffconsulting.com

lars.nielsen
lars.nielsen

Sometimes it's next to impossible for a developer to control the HTML. I suspect the vast majority of the pages that were tested in the Alexa test were generated by a CMS or by server-side rendering technology like ASP.NET. So maybe we should be asking why do those CMS's write garbage HTML? It's not just because of bad templates - the systems themselves inject HTML into the rendered output as well. Why does the ASP.NET framework write garbage HTML, with its reams and reams of unecessary embedded tables?

Justin James
Justin James

It's very true, many of the tools generate junk. I really hate ASP.Net's controls that crank out a zillion tables all over the place, for example. And, many CMS systems have hardcoded HTML in them that people have no control over. It's unfortunate. That's why I really like the MODx CMS, by the way... ultimate control over the HTML, even in the various plugins and such (they almost universally allow you to use templates with the plugins). J.Ja

Osiyo53
Osiyo53

A lot of HTML rendering and site management tools inject junk into HTML pages. Many of the WYSIWYG editors, when you make later changes and modifications to a page inject those changes imperfectly and muddle up the code. Not much you're gonna do about that. In many cases the web page author(s) are gonna use such tools, imperfect or not, for the sake of speed ... or because they do not know that much about hand coding. Typically, if its an important (to me) web site, after using auto code generating tools I'll go back and utilize the old fashioned text mode code editing to clean things up. Other times, I just leave it. If it works it works, close enough ... good enough. This second case scenario happens routinely at work. Where we create and manage web sites for a number of customers. Some pay well, for the best they can get. Others, want changes made on the cheap ... and quickly. You want it cheap? You get cheap. I'm not spending one minute more on such web site than I absolutely have to to produce a result acceptable to the customer. For our larger, and better paying accounts, we go through considerable more effort. Sometimes giving them even more, and better than they ask. Because we LIKE their business and don't wish for them to be taking it elsewhere. So sometimes, that "junk" website ... as you defined such in your original post ... is junk on purpose. Pay cheap ... get a cheap product. Turning out a better product takes more time, if that's what yah want you've got to pay for it.

Editor's Picks