The much-vaunted HTML5 is being touted as the best thing since sliced bread, offering speed and increased functionality — is there any value in being an early adopter, or should we wait for browsers to catch up?
What it is
HTML5 is a markup language for presenting structure and content on the internet. It offers features such as canvas, video, or geolocation tags to display images, videos and geolocation for maps, etc. The idea is to define a single language that can be written in HTML or XTHML syntax and to offer APIs for complex web applications. This has been in development at the Web Hypertext Application Technology Working Group (WHATWG) in collusion with the W3C since June 2004.
Advantages and disadvantages
2. Clean Code
|Keep your code tidy|
Some elements are now depreciated, i.e. <center>. Others are restricted because some developers assume that people don't like links directing people to new windows when they click on a link, even though it's widely considered to be best practice for keeping visitors on your site.
These are the doctypes available for HTML4:
HTML 4.01 Strict<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0 Strict<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
There are seven of them. In HTML5, there's only one:
Upgrading to the HTML5 doctype won’t break your existing markup because all the tags defined in HTML 4 are still supported in HTML5. But it will allow you to use — and validate — new semantic elements like <article>, <section>, <header>, and <footer>. BUT the language is a work in progress, so any of the elements could change at any time, undoing the work of the early adopter.
3. It's already in use and working
In Dive Into HTML5, Mark Pilgrim proudly declares that most, if not all browsers, are already supporting the major structural elements offered by HTML5. Internet Explorer, not known for its leadership in adopting web standards, is already boasting of its compatibility with some of the HTML5 features. BUT not all browsers support all the features. You have to detect the ones that each of the major browsers fails to support and insert code to bludgeon them into submission, but as Ray Villalobos of Planet of the Web points out, these code solutions aren't perfect. It's WAY easier to stick to HTML4 and save yourself a massive headache. It won't fully depreciate for years to come anyway.
4. Data storage
HTML5 provides a fully defined and structured SQL-based database API that can be used for storing data locally, that is client-side. The data can be accessed to support web applications and it can even be accessed offline. It can be used to store e-mails or shopping cart items for an online shopping site. BUT you can't control the data, make copies or back it up because it's buried where the browser stores it. You have to stay on the same computer to use it, and you can't switch browsers or you'll lose it.
5. Client-side scripting
The availability of code script libraries enables anyone who is so inclined to learn about the structure of web pages and the scripts used to make them work. Indeed, this is encouraged as a way to get as many people testing and tweaking the programs as possible. As tech blogger Santiago Valle said in a post in Oshyn,
With HTML5 it should be possible for assistive technologies to expand on the features they can offer their users as they can immediately build up a more detailed understanding of the structure of a page by looking at the HTML5 elements it contains.
BUT Peter Wayner at InfoWorld reckons it's a security nightmare. He says,
All the problems caused by trolls and hackers would, it seems, be multiplied exponentially by implementing HTML5 and failing to take security into consideration. I can see hackers taking full advantage of this.
Progress is inevitable and W3C is committed to HTML5, but implementing it now means we shall have to add code patches to compensate for weaknesses in the markup and the lack of native support for some features in older browsers. Security is a big concern, and will have to be addressed before we permit people to commit sensitive data to the internet where it can be harvested by phishers and hackers.