.

Getting Started with HTML5

I’m working on a project now were we’ve decided to go with as pure HTML5 as posible, and it’s a breath of fresh air. Things work more or less how they should, and Internet Explorer is even playing along, with a little help. Getting started was a bit of a trick, though, as it can be hard to find information on how HTML5 works without diving into specification documents, which is never fun, or easy, (if you don’t want to read the story, skip straight to the resources).

I hadn’t been following the development of HTML5 with more than a passing interest. I figured that when it was ready, then I would start using it. I also understood that there were different parts that may reach completion at different times, and was keeping my eye open for some sort of “completion” signal. 2009’s 24 Ways was that signal for me. There were several articles on using HTML5 features along with their CSS3 counterparts, and enough evidence that browser support is there to start my investigation.

Here’s the deal: Basic HTML5 support is pretty good in webkit-based browsers, alright, (read usable), in Gecko, and kind of lacking in Internet Explorer. However, if you can rely on Javascript being present, (which I can in my project), there’s an HTML5 Shiv Javascript by Remy Sharp that makes it so that you can style HTML5 in Internet Explorer. Add it using a conditional comment and you’re good to go.

So, we have useable cross-browser support, but where do we turn to learn about which tags are in, which are out, the correct doctype and mime-type, and all that? We could read the specification, (and we will have to read a bit, at least), but it would be nice if there was an introduction to HTML5 somewhere. It turns out that Robert Nyman has written an Introduction to HTML5. It’s detailed enough to get you started, but not so detailed that you get lost, (like the spec), and if you’re looking to be convinced of the value of HTML5, check out HTML5: Tool of Satan, or Yule of Santa?, Have a Field Day with HTML5 Forms, and Breaking out the Edges of the Browser from 24 Ways 2009.

Once you dive a little deeper you’ll find that there are elements of HTML5 that you need more in-depth information for, so it’s time to turn to the spec. However, there are 2 groups, (W3C and WHATWG), working on HTML5, and therefore 2 spec documents, (fun!). Fortunately, the two groups have the same editor, so they’re more or less working on the same thing. I find the WHATWG HTML5 document easier to read, but if you prefer the W3C version, go nuts.

Finally, the whole content-type debate that’s been going on for what seems like centuries is still a mess. In HTML5 you’re supposed to include a Document Type Definition and there should be no namespaces on the HTML element if you’re serving as text/html, and you’re supposed to serve in application/xhtml+xml if you want to use namespaces, or force XML validation, or anything like that. The problem is that Internet Explorer really doesn’t like application/xhtml+xml, (it shows the raw XML document), so if you need a namespace for some reason, (for example, you want to use Facebook Connect on the site), you can’t serve valid markup.

So, that’s it. HTML5 has arrived, or at least parts of it. If you can rely on Javascript being present, or rely on IE users not using your web app, you can go ahead and start using it. Here’s a quick recap of the resources:

Javascript: The Good Parts

Over the weekend I finished reading Douglas Crockford’s JavaScript: The Good Parts.

This book spent quite some time on my to-read list and I am really happy to have finally read it. I now feel that I really know how to use closures in Javascript, and Mr. Crockford has inspired me with his use of functions as values, and creating functions that return functions or objects, maintaining access to local variables within a closure, is genius.

I found myself leaning heavily on my previous knowledge to understand The Good Parts, making it, as it says in the preface, not a book for beginners. I can imagine that the Regular Expressions chapter might be tough without a pre-existing understanding of regular expressions, however, that’s easy to obtain at regular-expressions.info.

After reading The Good Parts I’m really excited to work on some Javascript that I’m going to be refactoring and improving over the next few weeks. I can apply the some of principles contained here to write smaller, faster, and easier to maintain Javascript, something that is always my goal.

The cover of Javascript: The Good Parts
Want to read it yourself? Get it from one of these places and I’ll receive a small kickback:

Amazon.com (USA) Amazon.ca (Canada) Amazon.co.uk (UK)

The Flat World

A couple of years ago my sister gave me a copy of a book that she had been given when she received her first degree. The book is The World Is Flat by Thomas L. Friedman. On the back it says “One mark of a great book is that it makes you see things in a new way, and Mr. Friedman certainly succeeds in that goal.” I couldn’t agree more.

When I started reading The World is Flat on my commute I didn’t know much about it. I thought, actually, that it would fit kind of in the “self-help” category and tell me how I could do more in the world. Instead it showed me how the world has changed in my lifetime, and the power that we all have today to collaborate with nearly anyone, anywhere, in ways that even I, who works online and rarely sees my coworkers and clients, hadn’t imagined. I’ve never been motivated to write here about a book I read, but this book has motivated me to do just that. I think it should be read by as many people as possible, especially people who work in business, education, or government.

The World is Flat is a solid look at globalization and what it means for the American people, and by extension us Canadians. It means, among other things, that we have to work our asses off to stay in front of the millions of people that can now compete for our jobs from India, Russia, or pretty much anywhere there is an internet connection. But it also means that as an employer I can hire the best person to do a job at the best price, providing a better service to my customers at a lower price than I would otherwise be able to provide.

I’ve already experienced our Flat World. I’m in Montréal, and I work all the time with a group in California, as well as on occaision with people in Arizona, New York, Poland, Turkey, and the Philippines. It’s amazing what we can get done together. By assembling the right team for the job we can often do a better job than a team that works under a single roof, and for less money. But after learning what I have learned in reading The World is Flat I am excited to try even bigger, better things.

One of the things that I worry about, however, is overproduction and overconsumation. One of the major arguments against globalization and outsourcing is that we don’t want to loose North American jobs. This argument assumes that there are only so many jobs to go around, and with the expansion currently happening in many of the places we outsource to, this is simply not the case. The increasingly affluent population in, for example, India, consumes things produced both there and in the west, so by moving some jobs to other countries we are actually creating a net increase in both jobs and consumption. This overconsumption can have a detrimental effect on the health of the planet, and while it is an economic truth that we are seeing, and most likely will continue to see, a net increase consumption, and therefore production and jobs, I’m not entirely sure that our planet can support having everyone in it live lifestyles like we currently do in North America. Something needs to change, and while Mr. Friedman does discuss this, I feel it needs deeper investigation. I’m assuming that Mr. Friedman’s next book, Hot, Flat, and Crowded, will deal more with these issues.

Since September, I have been commuting more, on a train, and therefore reading more. The World is Flat made me want to share what I am reading with as many people as possible, so this is the first post of many about books that I read. As I finish each book I’ll write about it here. These aren’t meant to be book reviews, I’m no literary critic, but personal reactions to what I read. There will be Amazon affiliate links in and at the bottom of the posts, but I’m not going to pump up a book that’s no good, it would just be nice to make a dollar or two on the books that are great. These posts are as much for my archives as for the world, but I would like to share some things, especially The World is Flat. There’s a fascinating revolution taking place, and I want to get even more involved than I am now.

The cover of The World is Flat
Want to read it yourself? Get it from one of these places and I’ll receive a small kickback:

Amazon.com (USA) Amazon.ca (Canada) Amazon.co.uk (UK)

Why the Keyboard is Here to Stay

There’s been a lot of fuss recently, (and not so recently), about multi-touch interfaces and alternatives to keyboard and mouse as input devices for computers, but I believe that the keyboard, at least, is here to stay.

The keyboard is the best instrument we have, and the second best instrument that I can think of, to get text quickly from my mind into a computer. It’s been around for about 181 years now, and while there are some strong arguments to change the way it works, there is no really good reason to get rid of it.

As Scott Berkun said the other day:

Most technology doesn’t change much. The wiring that powers your home, the plumbing that brings you water, the roads you go to and from work on, work in mostly the same way they always have. This is ok. Lack of upgrade is not a sign of failure.

He is right, and the keyboard belongs right in there with plumbing, elictricity, and roads. How else are we going to get ideas from our minds into a computer? (I have an idea, I will come to it shortly).

Multi-touch has been the darling of the UI world for a little while now, and we keep hearing about the possibility of multi-touch enabled full-size screens. BumpTop has released a version of their software, (which is really cool, by the way), that has multitouch support. Do you really want to spend your day at a desk or counter, with your arms extended in front of you touching a screen? Try it right now for sixty seconds. Just reach out and put your fingers in front of your screen. I’ll wait. Finished? How do your shoulders and arms feel? A little tired? Now imagine your whole workday like that. Yes, we will become accustomed to the feeling, and we’ll get more endurance in our shoulder muscles, but we’re not meant to spend eight hours a day with our arms out like zombies.

How about voice control? It works pretty well in Star Trek, but if you have ever had to speak for an extended period of time you will know that your voice can get tired and sore just as your shoulders and arms can. Even if voice recognition technology was good enough to correctly transcribe what we say every time, with the correct grammar, (and it’s not, as Fred Wilson’s Dictated Post clearly illustrates),we would still end up talking all day. Imagine what it would sound like in an office, and how would students take notes on their laptops? Because of voice fatique and noise levels, voice control is not a viable solution for entering large amounts of text, or for doing long periods of computer-based work.

Multi-touch and voice control are great for short messages and commands. Even my ancient Motorola lets me use a voice command to call my fiancée, but for entering a lot of text, or for long sessions of work, they suck.

What’s the solution? Thought control. Hook the computers up to our brains, then whatever we think will become what is written, or drawn, or whatever. Imagine the possibilities, no more typing, no more trying to draw something that you see in your mind using Illustrator, because your computer sees it too. Also, we won’t need computer screens because hey, if the computer can see what’s going on in our minds, surely it can show things to us as well. However, even if we include the Firefox, controlling a computer with my thoughts is still a dream and will remain a dream for many years to come. The solution for today is the keyboard. It lets us enter text and commands very quickly, often faster than we could write them using pen and paper. It lets us do so quietly. And it’s a worldwide standard.

Using Spaces to Work Around VMWare Fusion’s Limitations

It appears that when running Windows as a virtual machine in VMWare Fusion, (I’m using version 3.0.1), any windows programs that I am running with elevated permissions, (“run as administrator”), don’t appear in the OS X dock with Fusion in unity mode. What’s more, if I can see a portion of the window and I click it, it doesn’t come to the foreground.

My workaround for this, which worked very well, was to run Fusion in fullscreen mode in another Space. Then I was able to do my OS X testing in one space, flip to Windows to make changes very easily, (The default to move between spaces is ctrl + (arrow key), but I changed it to cmd + (arrow key) and it is much easier for me), and keep my E-mail & stuff open in a third space.

If you don’t have spaces active, in OS X 10.6 they’re in System Preferences > Exposé & Spaces > Spaces then just check the box that says “Enable Spaces” and adjust your shortcuts at the bottom of the window, if desired.