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.'
Permalink for comment 485566
To read all comments associated with this story, please click here.
RE[5]: HTML 5 == Pointless Bloat
by galvanash on Wed 17th Aug 2011 18:22 UTC in reply to "RE[4]: HTML 5 == Pointless Bloat"
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