Wednesday, September 15, 2010

Failing Gracefully

The internet is broken.  I blame cascading style sheets.

To explain the above (somewhat inflammatory) comment, I need to explain something common to engineers.  A key attribute in almost any well-designed system is known as "graceful degradation" or that the system "fails gracefully."  In practice, this means designing the system such that, in situations where the inputs aren't 100%, the system notices this, and adjusts its output accordingly.

For instance, many laptops (in close coordination with the processors that run them) have different levels of output: when plugged into the wall, the computer will crank out as much performance as it can.  When on battery power the CPU will slow down a bit, and the screen might dim slightly to ease the power draw from the battery.  When the battery level gets below 10%, the CPU might go into a slower, power-saving mode -- slow, but still functional to allow you to get your work done and hopefully save your work.  It's at about this time that the computer starts throwing warning messages at you, along the lines of


Then, once battery power gets to around 1% or 2%, the computer will put itself to sleep (since you're apparently incapable or untrustworthy), in a last-ditch attempt to husband the tiny amount of juice left in the battery while it patiently waits for you to plug it back in again.

This is graceful degradation: decreasing output for decreasing input.

The internet, in its modern form and for the average user, does not fail gracefully.

This was brought to my attention recently when I was suffering through a bad wireless router.  Our computers would download the first part of a web page, then hang indefinitely.  *Very* frustrating.  The below picture is a screen shot where I've cut out the middle section (it was all white anyhow; you're not missing anything):

In this case, I was looking up what "aGPS" is, or "assisted GPS."  The fact that I'm using Safari on a mac is irrelevant; this malady affects all computers and all browsers.

Now look at the bottom: it says, "Loading," and that it's completed 70 of 85 items.  That seems like a lot; 70 of something should imply some level of content.  And yet, the screen is completely blank!  There is no information to display yet.

And here's where the internet doesn't fail gracefully: you have to load almost all of the content, almost all of the time, regardless of your connection speed and regardless of the quality of your connection.  I would think, in any intelligently designed system, the content would come first -- in this case, some text explaining the details of aGPS.  But, no, with the construct of Cascading Style Sheets, you have to load tons and tons of format first -- and the content comes last.

This is a shame, because the whole idea of CSS is to separate content from presentation.  But the internet doesn't prioritize the order in which it sends it to you.

This would happen all the time with our faulty router: it would load the first sections of a web page, then hang indefinitely.  Incredibly frustrating, and I'm sure I'm not the only one who's suffered from this.  Sites designed for mobile viewing (on your cell phone or iPad, for instance) don't really get around this: they just cut down on the amount of formatting, but they still rely heavily on cascading style sheets.

End of rant.  This is a small detail that probably only affects a few people.  But for an entity that seems to take such interest in picayune things, when the website is down, it's incredibly frustrating and I'm surprised someone hasn't already done something about it.

Sometimes I use a text only browser, like Lynx or Lynxlet, just for fun.  Maybe we can overthrow the CSS overlords.

No comments:

Post a Comment