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 485566
To view parent comment, click here.
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

Brendan Member since:
2005-11-16

Hi,

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).


It was internal, and not something web developers had to care about, and therefore very different to CSS from a web developers perspective (despite being very similar from a web browser's perspective).

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.


I'm not sure which successful markup systems you're referring to. I hope it's not LaTeX (if you've ever tried to use LaTeX to get both HTML and PDF output that looks slightly similar you'll understand why I'd suggest using something else instead).

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).


The web site's main page has changed since I wrote those numbers (3 new articles added, not sure how many removed), and (at the moment) I get 18.7 KiB for content. The CSS has also changed a lot - it was 215 lines (23.3 KiB) and now it's only 77 lines (8.4 KiB). I'm wondering if the OSNews staff have done a few things to reduce the bandwidth.

I don't think it's fair to ignore any of the javascript. I'd argue that HTML has made it difficult for web developers to control presentation, and therefore they're forced to rely on (for e.g.) CSS and javascript and direct DOM manipulation to regain control of presentation, and because the final "HTML + CSS + JavaScript + DOM + whatever is used server-side" quickly becomes an over-complicated mess; web developers use libraries and toolkits to try to cope. All of the javascript used by this site is a symptom of the problem, and therefore shouldn't be ignored.

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...


Given the choice between "HTML + CSS + DOM + who knows what else" and "a markup language designed for presentation and no need for anything else", I'd choose option 2; because a single 20 KiB page that uses one or 2 languages is much better than a 200 KiB mess that uses many more different languages.

That is leaving out the vast efficiency savings that are available with modern CSS (this site is rather old).


..and ignoring the vast efficiency savings that HTML could have had if modern HTML was designed for presentation.

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...


So you're suggesting that CSS means things like WML don't have a reason to exist now?

The model I want is where raw content comes from where-ever (e.g. database), something like HTML is used to present that content to visual users, some sort of "Aural Markup Language" is used to present that content to aural users, something like WML is used to present that content to small devices, something else is used to present the content to search engines, etc. Basically, markup languages designed for specific purposes, rather than a horrid mess that tries to cope with everything imaginable at once.

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


I did learn the basics. I spent hours fighting with it trying to make it work (and mostly failing because it was far from intuitive). The only thing that learning the basics did was increase my desire to replace the entire "web" stack, from HTTP all the way up.

- Brendan

Reply Parent Score: 2

deathshadow Member since:
2005-07-12

I did learn the basics. I spent hours fighting with it trying to make it work (and mostly failing because it was far from intuitive). The only thing that learning the basics did was increase my desire to replace the entire "web" stack, from HTTP all the way up.

You probably were either learning from the wrong sources (VERY likely, lots of web rot out there) or failed to grasp how important semantic non-presentational markup is to using CSS properly. There's a saying I use a lot -- CSS is only as good as the HTML it's applied to. If you're still vomiting up HTML 3 style presentational markup (a disastrous mess that should never have been allowed in the first place) applying CSS is just going to result in a bloated mess. You start throwing classes and ID's on EVERYTHING instead of using one convenient parent tag and it's going to be a disaster as well...

Really though, saying the APPEARANCE on every element in the markup defeats the point of HTML -- saying what things are so the USER AGENT can best determine how to show it. As another saying goes "If you choose your HTML based on the default appearance of the tags, you're using HTML wrong!" -- and that dates back to HTML 2. We got away from that with HTML 3 during the browser wars, and HTML 4 Strict was supposed to drag us back on track. (and now HTML 5 is just 3 in drag, worse than 4 Tranny as it least it was on hormone therapy getting ready to go under the knife)

But then, the markup alone is where a LOT of people screw up their pages -- concentrating on the appearance before they even have semantic markup of the content (or a reasonable facsmile) with a logical document structure... That's the approach I've been advocating for design over the past half decade or so... Semantic markup of content FIRST -- that way you know it's accessibile to EVERYTHING with tags saying what things ARE. THEN bend that markup to your will creating the layout in CSS for each of your primary media targets -- Screen, Handheld, Print (and now screen+width for smartphones/tablets).... then and only then boot up the goof-assed paint program like Photoshop to create the graphics you'll hang on the layout. (and with CSS3 even that looks to get a swift boot in the patoot).

It's why I laugh at the people who end up with the "but I can do it in photoshop" idiocy where they had some artist draw a pretty picture, that's COMPLETELY non-viable as a website due to fixed height elements, fixed width elements, non-tileable or stretchable elements, and areas that can't even dynamically adjust to the content inside them.

Reply Parent Score: 2

galvanash Member since:
2006-01-25

So you're suggesting that CSS means things like WML don't have a reason to exist now?


Other than for the oddball feature phone that is 3+ years old? Yes, no reason at all. It is dead as a door nail going forward. No one is building WML devices anymore...

The model I want is where raw content comes from where-ever (e.g. database), something like HTML is used to present that content to visual users, some sort of "Aural Markup Language" is used to present that content to aural users, something like WML is used to present that content to small devices, something else is used to present the content to search engines, etc. Basically, markup languages designed for specific purposes, rather than a horrid mess that tries to cope with everything imaginable at once.


And you just illustrated why WML died... You really have some crazy notions, I gotta give you credit for not being shy with them. You are literally the only person I have ever seen describe markup soup as something they actually want.

Reply Parent Score: 2