Apr '09

Separating church and state – 3 pillars of web content

I had the pleasure of presenting a session on Dreamweaver CS4 to some of my colleagues today, and in the process ended up on my “web standards” soapbox. That’s not unusual, as this is a subject that I feel very passionate about, and thankfully my colleagues embraced the message wholeheartedly. Following the presentation though, one question arose around the idea of removing JavaScript from the page.

One of the coolest of new features in Dreamweaver CS4 allows you to take all of the “local” JavaScript code and externalize it with the click of the mouse – complete with unobtrusive attachment of events.

The question was basically “what’s the point” – is it because JavaScript is “bad” and you’re trying to be sneaky with it, or simply to clean up the HTML code itself. I got about halfway into my email response to the question when I realized that this might be worth posting here.

The issue with JavaScript as part of the HTML page is not that it is “illegal”, afterall <script> is a valid HTML element. It has more to do with the “best practice” of separation. In real life we talk about the need for a separation of church and state because they each have their own “realm of authority” – or at least we hope they do. But in the web content world there are really three things that need to be separated: markup, presentation and behavior.

In the long forgotten stone-age of the internet, markup was routinely mixed with presentation much as the alchemist mixed their secret potions in the hope of getting gold. As designers we wanted big, bold, red headlines and the font tag was wielded with complete disregard for the semantic “meaning” of the text to which it was applied. But thankfully within a few years CSS was born. With its advent, it was suddenly possible to return to a more simplistic and semantic markup – afterall this is what Tim Berners-Lee and company had in mind when the original HTML specs were conceived. The idea of markup was to describe an element’s purpose or meaning without regard for how it would be presented. And with CSS, we could use an h1 or h2 to emphasize the importance of an element, but style it however we wanted without it losing its “meaning” in relation to other elements. Not only did this lessen the amount of markup that we had to deal with, by externalizing  the CSS we had achieved two other important goals. First, we could modify a single CSS rule and effect all (or some) of the page elements spread across multiple pages in one fell swoop. Second, we began the journey down the progressive enhancement road.

If you’re like me (old), then you might remember those early days of the web as the browsers began their slow embrace of CSS. But then again, maybe you don’t remember those days – or you didn’t “notice” it, because you didn’t have a browser that supported CSS. And that’s the important part. If you didn’t have the latest and greatest browser, you still got content (if proper seperation of markup and presentation techniques were used). It’s all about properly marking up the content to begin with. Then, the presentation “layer” can work its magic in numerous ways. In fact, as my good friend Dave Shea’s site, CSS Zen Garden, so wonderfully illustrates, the very same semantic HTML markup can be presented in an unlimited number of ways. (Side note: if you’ve never visited Dave’s shrine to CSS creativity, run, don’t walk over there!)

Today, it’s fairly safe to say that the concept of separating markup and presentation is a “standard” and being implemented “for the most part” around the web world. But with today’s more “rich, interactive” web (read: Ajax) we find ourselves once again polluting our markup. And it’s for the very same reasons that we began separating markup and presentation that we should separate markup and behavior. We can reap the same rewards as well. By attaching JavaScript to elements unobtrusively, we eliminate a large part of unnecessary markup. Secondly, by centralizing the code into an external JavaScript file, we can make site-wide changes more easily. And finally, if we’ve adhered to the “leave no one behind” mantra of progressive enhancement, the page doesn’t “need” the JavaScript in order to deliver its content to the user agent. Instead, the page (and experience) is simply enhanced by its presence.

Thanks to my colleague for prompting me to write this – I hope it makes sense – and either way, I would love to hear your thoughts and comments on the subject.

Leave a comment »

Dec '08

An Open Letter To The Airline Industry

Dear Airline Executives,

As a frequent flyer, who has averaged over 200000 flown miles every year since 1998, I have a vested interest in your survival as an industry. I completely understand your need for revenue – however a few recent developments have caused me to question not only the wisdom of your decisions, but also whether or not the people making the decisions have actually flown in the last seven years.

I completely understand that things like water and soft drinks aren’t free for you, but I also know that you get some sweet deals in terms of pricing on these items in return for announcing that “your airline is proud to serve soda X”. I also know that I just paid a hefty price for this ticket. So, it’s a bit ridiculous to ask me to pay $2 for a bottle of water that cost you $.35. Buying onboard food – fine, if I want other food I can bring it from home. Keep charging the $5 for beer and wine too – but don’t rape me for something that was free a few months ago back when fuel prices were, hmm, exactly where they are again now! And especially when that particular item can’t be brought through security anymore.

But even more troubling is the new baggage insanity fee. Again, I’m all for making money – but in a smart and equitable way. Your recent requirement to pay $15-25 for a checked bag has done nothing but cause passengers to attempt to stuff their entire apartment into a roll-aboard and backpack (neither of which can fit into the overhead bin without using a crowbar and personal lubricant). The result is that bins are completely full before even half of the passengers have boarded – a process which is also slowed because of the time needed to wedge all of the oversized duffelbags into the minimal space available. And then your flight crew gets to waste even more time checking the rest of the carry-ons in the gangway – for free!!! I’ve even heard passengers giving each other tips about this very thing!

Let’s get real – there are two far more intelligent solutions to this problem. Feel free to chose either one…

First, charge a carry-on fee instead of a checked bag fee. Charge the same $15-25 for any bag larger than a standard computer backpack or briefcase size. Upon paying, issue a bag tag that is attached to the bag in order to bring it onboard. It’s far less time-consuming for a gate agent or flight attendant to glance at the rollaboards being brought on than to fill out 20 or 30 luggage tags for bags that can’t find an overhead bin space.

Not only would this free up bin space, thereby alleviating the major bottleneck in the boarding process, it also ensures that the majority of bags go through more rigorous inspection than that afforded at most checkpoints – helping to keep us all safer.

Now if you don’t like that idea, how about just tacking on the stupid $15 to the price of every ticket as a fuel surcharge? That is the reason that you’ve said you needed to add the baggage fee, isn’t it? So let’s be fair and make everyone shoulder the burden of the higher fuel costs. We’re all getting on the plane – why does my checked bag cost more in the cargo hold than the one in the overhead bin? And don’t tell me it’s a matter of weight – you already have weight restrictions – and you are able to distribute the weight in the cargo hold much more effectively than you can in the cabin. And a fuel surcharge could actually be decreased or even recended as fuel prices decrease (as if you’d ever actually do that…).

The bottom line is that we all know the economy sucks – but I also know that every plane I get on is packed to the gills. We all want you to survive and even to turn a profit, but nickel and dimeing us in a way that makes the entire traveling experience even more of a headache is the quickest way to lose any goodwill that you might still have following 9/11. And, yes I know, as a frequent flyer I am not subject to the bag fees – but I do still have to get on the plane in a timely manner. And when I can’t manage to be one of the first ones on the plane I still need to find room for my bag. Think about it – or better yet make your executive fly coach (in a middle seat) on six flights this week. I bet we’d see a lot of changes come next week. ;-)


P.S. To my readers, I’d love to hear your thoughts on my ideas – or any of your own airline stories. Comment away!


Sep '08

A simple question about politics…

As I’ve been following the political “season” here in the US, an interesting question crossed my mind. I’ve been watching Obama/Biden and McCain/Palin run around the country for the last few days. Of course, I’ve (actually) been watching Obama and McCain do it for much longer. But my question is, why don’t they have to give up their “regular” job in order to run for President/Vice President?

I mean, think about it… could this happen in your job? Could you go tell your boss that you’re going to go look (and campaign) for another job? Or more importantly, could you tell him/her that what you were doing was in the best interest of their company, but if you didn’t get the new job, then you’d be back to doing your “same ‘ol, same ‘ol” the next day? Oh… and you’d also like to loan the keys to the motorpool and use the limos/planes/boats/etc to ferry yourself and your entourage around during the interview process.

As the governor of Alaska, shouldn’t Sarah Palin have turned over the keys to the kingdom to someone else as she runs around the country? You can’t tell me that she (in addition to being a mother of five kids, including a baby with Downs Syndrome), can process all the information she needs to in order to make decisions for her state, while bouncing from campaign stop to campaign stop… Unless, of course, there’s not much to being governor of Alaska – which would open up a whole different set of questions.

Don’t read anything biased in there either – the same goes for Obama and McCain. Are either truly exercising to the fullest the mandate that brought them to the Senate – to serve the people of their state.

If you’re giving 5-10 speeches a day in 4 or 5 cities in states whose capitals you can’t even name, you can’t be paying much attention to what is going on on the Senate floor…

Shouldn’t we be demanding that our “potential” elected officials play by the same rules that we have to? If you want another job, fine – look for it on your own time. But if I’m paying your salary (and as an Arizona resident, Mr. McCain, I AM paying your salary), then you need to resign from your office. Go campaign. But if you lose, I don’t see how it is fair that you come waltzing back into the Senate (or Governor’s office, Ms Palin) as if nothing ever happened.

Just doing a bit of thinking out loud… Thoughts? Cheers!