Linked by snydeq on Tue 16th Aug 2011 16:46 UTC
Web 2.0 InfoWorld's Peter Wayner discusses the 11 hard truths Web developers must accept in making the most of HTML5 -- especially those who are looking to leverage HTML5 in hopes of unseating native apps. 'The truth is, despite its powerful capabilities, HTML5 isn't the solution for every problem. Its additional features are compelling and will help make Web apps formidable competitors for native apps, but security issues, limitations of local data storage, synchonization challenges, and politics should have us all scaling back our expectations for the spec.'
Thread beginning with comment 485454
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: HTML 5 == Pointless Bloat
by galvanash on Wed 17th Aug 2011 04:24 UTC in reply to "RE[2]: HTML 5 == Pointless Bloat"
galvanash
Member since:
2006-01-25

Idiotic crud like CSS and "semantic" tags (even old stuff, like the "em" tag) just make it harder for web developers to do their job well (as they can't really say how any specific browser might render it)


Hi! How are things back in 1992?

Seriously... So you want to go back to purely using tags to control presentation? Really?

I have been doing this since 1996 or so. You can not and have never been able to say how any specific browser might render things reliably. It has always been horseshoes and hand grenades until CSS became prevalent. It is still hit or miss to some extent, but much better than it ever was in the past. If you want to control presentation, that is what CSS is for - HTML is for describing document structure, linking, and embedding.

In hindsight I almost wish all browsers shipped with absolutely no presentation defaults at all and forced authors to implement complete CSS styling for their work. It would actually save me some trouble most of the time as the first step required when you want pixel perfect rendering across modern browsers is to reset all that crap anyway.

Realistically it isn't that way though because most of the time you really don't need pixel perfect rendering and the defaults generally behave similarly enough that if you keep things simple they work well. I have nothing against this approach to doing web pages - simple is often good... As long as you are not naive enough to thing that "good" means "identical" it is a perfectly valid way to do things.

One supposed advantage of semantics is that it's "important" for accessibility. This is misguided, as most accessibility stuff needs to be taken care of at the OS's level so that all applications (not just stuff displayed by a web browser) is usable;


It doesn't matter what is doing the accessibility. Please explain how the OS is supposed to do it without something telling it WTF it is looking at? You make it sound like semantic tags are a bad thing... You do realize most of those presentational tags from HTML 2.0 you seem fond of ARE semantic tags don't you? H1 doesn't mean "really big font", it means "Top Level Heading", it just also happens to render with a really big font in most browsers. There really are only a small handful of tags that were ever in HTML that can be considered purely presentational. The font tag for sure, i and b are really both - big, small, sub, sup - hell that is about it really, everything else is semantic.

The point is if you care how it looks you need to use CSS to control it - the tags purpose is to convey document structure. That is essentially what semantic means. If you want HTML without semantics... well you really don't have anything left. Hell, if you don't care about semantics just make a jpeg and use an img tag... Really, why not?

Then there's thing like search engines, which are already capable of producing extremely good results from things that lack any semantics; like PDF files, MS word files, text files, etc.


You do realize all of those things have semantics in them don't you? They may not always be explicit, but even text files have semantics (TITLE IN ALL CAPS). How do you think Google extracts information like the title form say a .doc file when the metadata is missing? It looks for the first heading in it. Same with pdfs. HTML just makes it more explicit and well defined. How is that a bad thing?

Basically, the only valid reason for any/all tags in HTML is to tell the browser how something should look.


You have a seriously misguided view of what HTML is, what it is for, and how it is actually used.

Edited 2011-08-17 04:26 UTC

Reply Parent Score: 4

Brendan Member since:
2005-11-16

Hi! How are things back in 1992?

Seriously... So you want to go back to purely using tags to control presentation? Really?


Yes, definitely. However I would also like things to have improved - more tags for direct control of presentation, and better browser compatibility.

I have been doing this since 1996 or so. You can not and have never been able to say how any specific browser might render things reliably. It has always been horseshoes and hand grenades until CSS became prevalent. It is still hit or miss to some extent, but much better than it ever was in the past. If you want to control presentation, that is what CSS is for - HTML is for describing document structure, linking, and embedding.


HTML should be for describing document structure for the purpose of presentation; not for describing document structure for no purpose at all.

In hindsight I almost wish all browsers shipped with absolutely no presentation defaults at all and forced authors to implement complete CSS styling for their work. It would actually save me some trouble most of the time as the first step required when you want pixel perfect rendering across modern browsers is to reset all that crap anyway.


Sane/standard defaults avoid the need to waste time/bandwidth providing superfluous information.

The stupidity of "pixels" as a measurement for anything (especially for web pages where there's no sane way of knowing what the size the user's screen is) is a different issue. Unfortunately, true resolution independence would require something extremely complex, like teaching browsers that percentages can contain fractions (e.g. size="12.34%").

Realistically it isn't that way though because most of the time you really don't need pixel perfect rendering and the defaults generally behave similarly enough that if you keep things simple they work well. I have nothing against this approach to doing web pages - simple is often good... As long as you are not naive enough to thing that "good" means "identical" it is a perfectly valid way to do things.


Agreed. I'm not after "every pixel is identical in all browsers". I just want the browser to do what I say without requiring an extra layer of bloat (CSS) to tell it to do what I say; in the way that HTML3 used to, but hopefully with even more control (like "{div bgcolour="#1234"}" for e.g.).


It doesn't matter what is doing the accessibility. Please explain how the OS is supposed to do it without something telling it WTF it is looking at? You make it sound like semantic tags are a bad thing... You do realize most of those presentational tags from HTML 2.0 you seem fond of ARE semantic tags don't you? H1 doesn't mean "really big font", it means "Top Level Heading", it just also happens to render with a really big font in most browsers. There really are only a small handful of tags that were ever in HTML that can be considered purely presentational. The font tag for sure, i and b are really both - big, small, sub, sup - hell that is about it really, everything else is semantic.


Have you had a look at the accessibility features in something like Windows or Gnome? Things like shifting hue for colour blind people, screen magnification, etc? The only thing not covered is blind users and screen readers (but that's an entirely separate issue).

Note: I don't use the heading tags (I prefer doing the "{big}{big}{b}" thing, so I know what it should look like). In the same way I don't use "{thead}" or "{th}". I use tables for layout control. If I want an actual table with something like "Figure 1.3" underneath it; then I create a table (with borders) inside another table (without borders) and have "Figure 1.3" in the second row of the outer table (because "{tfoot}" is displayed as just another row and not underneath the table, and "{caption}" is displayed above the table (WTF?) which isn't what I want either). I use the "title" attribute for tooltips and not for titles. For code I don't use "{code}", but prefer "{tt}" and a heap of "+nbsp;" (with "+gt;", "+amp;", etc) so that I can still do stuff like syntax highlighting.

I honestly don't think I use any of the tags intended for semantics, because none of them are displayed how I want them to be displayed. The only exception to this is HTML links (and anchors).

The point is if you care how it looks you need to use CSS to control it - the tags purpose is to convey document structure.


To attempt to control presentation you are meant to use CSS (which is a bloated mess that would never have been needed if W3C had their priorities right).

That is essentially what semantic means. If you want HTML without semantics... well you really don't have anything left. Hell, if you don't care about semantics just make a jpeg and use an img tag... Really, why not?


Bandwidth and linking.

You do realize all of those things have semantics in them don't you? They may not always be explicit, but even text files have semantics (TITLE IN ALL CAPS). How do you think Google extracts information like the title form say a .doc file when the metadata is missing? It looks for the first heading in it. Same with pdfs. HTML just makes it more explicit and well defined. How is that a bad thing?


I didn't say it was bad for search engines to use the semantic markup. I did say that search engines don't need the semantic markup or justify the existence of semantic markup.

You have a seriously misguided view of what HTML is, what it is for, and how it is actually used.


I don't care how it is, I'm talking about how it should have been.

Have a look at the source for OSnews' main page. It's just over 62 KiB and consists of a mixture of JavaScript and HTML. On top of that there's the CSS which is another 23.3 KiB, plus another little CSS for RSS (2.1 KiB). Then there's a total of 167.4 KiB of extra javascript files, where the largest is for jQuery. That's a total of 254.8 KiB of data (not including icons, pictures, etc). The content is only 19.3 KiB. How much of the remaining 235.5 KiB is there to control "look and feel"?

Now click on your browsers "refresh" button to refresh the OSNews main page. How long did it take to complete? For me it took a total of 8 seconds to drag all that data half way around the world, partly because the browser can't start fetching all the data at the same time (for e.g. it can't know which CSS file to download until after it's started decoding the HTML).

Ok. Now try to convince me that this is "efficient".


- Brendan

Reply Parent Score: 4

Lennie Member since:
2007-09-22

Have a look at the source for OSnews' main page. It's just over 62 KiB and consists of a mixture of JavaScript and HTML. On top of that there's the CSS which is another 23.3 KiB, plus another little CSS for RSS (2.1 KiB). Then there's a total of 167.4 KiB of extra javascript files, where the largest is for jQuery. That's a total of 254.8 KiB of data (not including icons, pictures, etc). The content is only 19.3 KiB. How much of the remaining 235.5 KiB is there to control "look and feel"?

Now click on your browsers "refresh" button to refresh the OSNews main page. How long did it take to complete? For me it took a total of 8 seconds to drag all that data half way around the world, partly because the browser can't start fetching all the data at the same time (for e.g. it can't know which CSS file to download until after it's started decoding the HTML).

Ok. Now try to convince me that this is "efficient".

- Brendan


I won't try and convince you about it is efficiency.

Efficiency of webpages is something I deal with on a regular basis.

However I do want to point out a few things:

Yes, CSS-model isn't all that great. Downloading an extra file at the start of the page sucks. Especially if the system that makes the HTML doesn't properly flush the data.

But a few lines of CSS could apply to many, many different elements on the page and would not even need to be downloaded when going to different pages.

If you would include style information in each and every single tag individually you would be sending a lot more text on the wire.

Ofcourse if you would like to reduce the number of requests before the page renders you could include it in the head it would possibly be even faster.

I don't know why they included jquery on the page.

I'm also not happy that it is included at the top of the page. I would rather see any javascript at the bottom of the page. Preferably not even using a onDomReady event or similair. I doubt that is needed.

I also don't like it if people don't combine their seperate script files into one.

It seems pretty much no-one understand cache-headers these days. They don't include any headers to get the files cached at the side of the browser. OSNews used to care a lot about mobile, but downloading or atleast checking every browser-session. If files have changed seem like a bad idea to me, especially on mobile.

Or why they use as many cookies as they do. I count 40 (!). I also do not know why a static file should have a Set-Cookie-header.

Or why they sent headers for those same static files which prevent it from being cached at all by most browsers.

That makes no sense to me.

I'm sure Kroc (I think he does the part of the site you see in the browser) could tell us more about it if he would read this thread, maybe he would even fix it.

But I'm pretty sure he would be bored out of his mind before he got to my comment. ;-)

Anyway Kroc if you want any help, let me know.

I'm pretty sure OSNews could save on bandwidth and make pages load quicker if they change just a few things.

My guess is Kroc is a busy man. His HTML/CSS is usually pretty great he just needs to read a book by Steve Souders to get some tips on performance and slightly change his mindset.

Reply Parent Score: 2

galvanash Member since:
2006-01-25

I don't care how it is, I'm talking about how it should have been.


Blame Tim Berners-Lee... He invented it and he was heavily opposed to supporting purely presentational markup since day one. The original browser he wrote used the equivalent of a user agent stylesheet to determine how things were displayed (it was not CSS, but it was conceptually the exact same thing).

You make it sound like stylesheets were something someone came up with one day to make your life difficult - they were ALWAYS there... You just didn't have control over them originally.

HTML, like almost all other successful markup systems that came before it, is founded on the concept of separating presentation from structure and content. This idea is based on decades hard-earned experience. If you want to make a presentational markup system be my guest, but don't try to corrupt HTML into one - it was never meant for that.

Have a look at the source for OSnews' main page. It's just over 62 KiB and consists of a mixture of JavaScript and HTML. On top of that there's the CSS which is another 23.3 KiB, plus another little CSS for RSS (2.1 KiB). Then there's a total of 167.4 KiB of extra javascript files, where the largest is for jQuery. That's a total of 254.8 KiB of data (not including icons, pictures, etc). The content is only 19.3 KiB. How much of the remaining 235.5 KiB is there to control "look and feel"?


I don't get your point (or your numbers). I loaded osnews in firebug and I see 5.3KB of css that is used by the site (the rss stylesheet is tiny and is only applicable to rss - it could have been omitted until needed). The actual page content is only 16.5KB. Everything else is javascript, images, or advertising crap and has nothing to do with you argument or mine (and certainly has nothing to do with controlling look or feel).

So the css weighs in at roughly 30% of the content size on the home page. In my experience that is about average. What you fail to take into account is that the 5.3KB styles the entire website, not just the home page. It is used on every single page of the site.

So your options are either:

1. Have a 5KB stylesheet, loaded once and cached by the browser, that can control presentation of all pages on the site for the entirety of the users visit.

2. Create some kind of crazy markup that incorporates all the styling it does, and then include that markup in the content of every page of the site, bearing in mind that the user will have to download all that markup again for every page load.

Ok. Now try to convince me that option 2 is "efficient". Or maintainable. Or even sane...

That is leaving out the vast efficiency savings that are available with modern CSS (this site is rather old). Just using CSS gradients alone you can describe in a handful of bytes an image that used to take at least a few hundred bytes (and another connection) to download. Using CSS sprites you can combine a large number of images (like icons) into a single one that only requires 1 connection to download and shares a single palette - this can speed up resource loading AND makes things much smaller at the same time. You can also, get this, create different stylesheets for different uses - alternate layouts, targeting specific devices or usages, etc., all with the same markup. The list of things that make CSS good is a mile long...

I routinely make fairly graphically intense modern layouts that are at least an order of magnitude smaller than they would have been without CSS (if that were even possible), and much easier to maintain and understand to boot.

Why don't you actual learn CSS instead of making up stupid arguments against it?

Edited 2011-08-17 18:26 UTC

Reply Parent Score: 3