As you probably know there is a new kid in the Web town and it is called HTML5. The web mafia claims that HTML5 will free us from nasty plugins like Flash, Silverlight and Java and even from the desktop applications because it is so cool and has so many features and no developer will be able to resist it… oh… and it works on the iPad! These days every second tech blog is writing about HTML5, there are HTML5 talks on every tech conference and respectable tech-related website with countless readers like this one cannot miss the opportunity to comment on the matter.
So here is what I learned from all these articles I read and all these conference sessions I attended.
Standard
As it seems HTML5 is not a standard today and not even a candidate. It is a draft. W3C recommends against using it today. Actually if you are using it today you are making work on the standard harder because they cannot change features without breaking what you wrote. It is expected to become candidate recommendation in 2012 and a recommendation in 2022. Good luck with that. Oh and by the way they had this debate and decided that instead of failing hard when there is invalid markup they should standardize errors and error handling behavior so everyone can keep writing invalid HTML. Cool! I am so happy that I will still be able to write invalid HTML in 2022.
Multimedia
HTML5 has this wonderful video tag that will allow websites to embed video without the need for a plugin. It is so cool that all the 96% of web users who have Flash installed will momentarily uninstall it. Some of the 4% web users who do not have Flash will be able to watch videos on their iOS devices. On the other hand there are more than 10% users of IE6 today. So if we learn from history ten years old browsers will always be like 10% of the browsers so in ten years there will be more browsers that do not support HTML5 videos than devices without Flash. The moral of the story is if you want to get to the largest audience for the next ten years use Flash. Oh and by the way JavaFX and Silverlight will still be better options in terms of deployment for at least several more years.
But wait there are even more good news. HTML5 does not standardize on a single video format. Right now there are three options but I guess Ogg will drop out in favor of WebM soon so I will only discuss the other two. First there is the H264 codec which is good, has hardware support and is widely used but is proprietary. While it is free for users content providers have to pay if they encode commercial content with it. Firefox and some other useless browsers will not implement it because it is not open, free or whatever they call their religious bullshit. On the other hand WebM was soon made open and free by Google. However there are patent threats with WebM and big players like Apple and Microsoft are not likely to support it out of the box because they can get sued so you will have to install it separately… like Flash. Basically you have to add two different files in the video tag as a fallback mechanism for browsers that do not support one of the formats and you should add Flash as a fallback option for older browsers. According to HTML5 supporters that is somehow much better than using just Flash because adding additional markup and testing all the combinations is so cool. What is more encoding video is one of the most computationally expensive operations and this is why people use it as a benchmark when testing the newest processors. Of course we want to double that work! I guess Intel are big supporters of HTML5 video because they will sell many more processors if it becomes popular.
Do not turn off your computer yet because we are far from over. HTML5 video has very basic and mostly incompatible streaming capabilities. There is also the issue with jumping to a specific moment in the video without loading everything before that moment. Some commercial content providers want to protect the content of the video via DRM which cannot be done with the new tag. It is also much harder to embed in other websites and it is harder to overlay ads on top of it. You do not believe me? You will probably believe
YouTube.
Obviously the video tag is totally useless. Same goes for the audio tag.
Canvas
The canvas tag in HTML5 allows developers to paint lines and dots and rectangles and even paths on the screen. This is such an innovation. Nobody has ever been able to paint stuff on a screen. HTML5 is a revolution in how we develop software! Soon everyone will be developing games in HTML5. Someone ported Wolfenstein 3D with canvas and JS and it was slower on the modern Mac laptop I saw it running on than on the 286 I once played it on in 1993. This is such a great progress. I have been dreaming for so long to play 18 years old games with lag.
Closely related to the canvas element is WebGL. WebGL is not specification developed by W3C but by the Khronos Group – the organization that develops OpenGL. As such it is debatable if it is part of HTML5. WebGL allows you to paint hardware accelerated 3D stuff in the canvas element with a subset of OpenGL. Some guys working for Google managed to port
Quake 2 in JS and HTML5 using WebGL. Sometimes it runs with "up to 60 fps". I was so impressed that I made some calculations. Quake 2 was released in December 1997 so the port comes about twelve years later. According to
Moore's law computers get two times faster every two years. This means that for twelve years they got about 64 times faster. I am so impressed that the web is so advanced these days that people can create games that are 64 times slower! I am so excited. Oh by the way there is another version of the law that says computers get two times faster every eighteen months. If we use it our new HTML5 games will be even 256 times slower! I am just shaking with excitement about our HTML5 accelerated future. Game developers should be excited too. Instead of using Flash, Silverlight and Java that are basically the same in every browser they can feel the joy that web developers feel today and support so many different browsers!
To be honest Canvas is not entirely useless like the multimedia elements. It can be used for charts and other business data once it gets widespread deployment.
Form Input Elements
In the book "1984" there is this thing called the
Two Minutes Hate where people gather to hate Emmanuel Goldstein. I am sure all browser makers have similar sessions where they hate web developers. I imagine pictures of web developers are projected on a screen and the browser team hates them with passion.
As it turns out HTML5 has some pretty cool features like the new form input elements. You can have an input of type date and the browser will draw a calendar for the user to select a date. The calendar may be native to the OS or to the device. There are types for validating input with regex, email, telephone number, color picker, etc. It provides cool and natural interface for the user without the need for complex JavaScript attached to the input. What is more these elements fail gracefully because if they are not supported the user will see a simple textbox where he can write text representation of the expected input. Developers can then validate the input on the server and everything will still work as intended. The experience for the user with the obsolete browser will be worse but the form will still be 100% usable. These features can change the way I work. Things I do every day will become so much easier. These features are useful for almost every web app. This is how the web should evolve!
However you already know there is a catch, right? The catch is that right now no major* desktop browser supports these features and as far as I know they are not in the beta versions that are going to be released. To sum it up they put tremendous effort in creating useless multimedia players, a complex drawing API, they even made these garbage features hardware accelerated but they did not include the thing that is actually useful, fails gracefully and is about a hundred times easier to implement. They invented it just to annoy us. I told you these guys hate us. They hate us personally, by name and they do it with a passion! I hate them too!
Update:
As it turns out the latest version of Chrome has some rudimentary support for the new input types.
* Unless you consider Opera a major browser. Opera is the best browser that nobody uses and as such it exists for the sole purpose to annoy developers.
Related articles:
The Broken Web The Broken Web 2 The Broken Web 3