Markup

Since our last survey, there have been several important developments related to markup technologies. The W3C effectively declared XHTML2 dead, and HTML5 has gained considerable mindshare among developers. In addition to the questions related to general markup practice we asked in the first survey, we also asked a number of questions in relation to HTML5, both in this section, and in the Scripting and API section of the survey.

As we noted last year,

Given that this survey asked developers what their practices are, there’s the chance that they’ll provide answers about what they think they should be doing, rather than what they actually are doing, even though it is an anonymous survey. Verifying how closely the responses match the actual practices by developers would in any case be difficult.

We asked respondents two sets of questions — one related to language features they use, the other markup practices (for example how frequently they validate).

Language Features

What versions of HTML/​XHTML do respondents use?

Since version 1, XHTML has been considered by many web developers to be “the future of HTML”. There has also long been a group of developers who were sceptical of the value of XHTML syntax. In HTML5, while both HTML and XHTML syntax are permissible, it could be argued that HTML syntax is being given predominance by the developers of the language. But just how much is this reflected in current developer practice?

When asked which syntax they used, well over half of respondents relied either exclusively (34%) or mostly (32%) XHTML, as opposed to 42.4% and 29.7% in the previous survey.

Those who use HTML syntax exclusively grew from 5.9% to 9.8%, while the number who used mostly HTML also rose, a little, from 15.9% to 16.4%.

It would seem that HTML5 and its privileging of HTML syntax over XHTML is having some impact on developer practice year on year. But, XHTML continues to be the preferred syntax for respondents by some way.

2010
MarkupCount%
Exclusively HTML1389.84%
Exclusively XHTML47633.95%
Mostly HTML, sometimes XHTML23016.41%
Mostly XHTML, sometimes HTML45132.17%
XML50.36%
Other191.36%
2008
MarkupCount%
Exclusively HTML735.92%
Exclusively XHTML52342.38%
Mostly HTML, sometimes XHTML19615.88%
Mostly XHTML, sometimes HTML36729.74%
XML90.73%
Other100.81%

What doctypes do respondents declare?

A little later in the section we asked which doctypes developers declare in their documents. Here we definitely see a significant leap in the adoption of HTML5, up from just 1% in late 2008, to 12.6% in this survey, passing HTML 4 strict and transitional, and XHTML 1.1. Both versions of HTML 4 held almost exactly level with last year’s results. Transitional doctypes continue to be the most commonly used.

2010
DoctypeCount%
none251.78%
HTML 4.01 strict1178.35%
HTML 4.01 transitional16211.55%
HTML 4.01 frameset10.07%
XHTML 1.01 strict35325.18%
XHTML 1.01 transitional39628.25%
XHTML 1.01 frameset50.36%
XHTML 1.1563.99%
HTML 517712.62%
Other110.78%
2008
DoctypeCount%
none211.70%
HTML 4.01 strict1068.59%
HTML 4.01 transitional14211.51%
HTML 4.01 frameset30.24%
XHTML 1.01 strict38431.12%
XHTML 1.01 transitional42534.44%
XHTML 1.01 frameset10.08%
XHTML 1.1534.29%
HTML 5161.30%
Other100.81%

Do you use HTML5 markup (for example section, header, nav elements)?

To dig a little deeper into the use of HTML5, we asked whether respondents use HTML5 markup. 65% said never, but nearly 21% said sometimes, and 7.35% answered yes. Clearly, this audience is at least experimenting with HTML5, and interest in the language it is fair to say is up considerably from the last survey.

2010
AnswerCount%
Yes1037.35%
Sometimes29420.97%
Never91465.19%

We followed up by asking those who said they used HTML5 which features of HTML5 they use. 11.3% of all respondents referred to structural elements like section, header, nav and footer. 3.6% mentioned video, 2.5% canvas and 1.6% audio. In the JavaScript section we also investigate API related aspects of HTML5.

We also asked respondents the extent to which they have adopted the W3C Web Accessibility Initiative’s Accessible Rich Internet Applications (WAI-​​ARIA), extensions to HTML which make for more accessible web applications. Less than 1% said always, a further 9.3% said sometimes, but on the whole, WAI-​​ARIA has some way to go to gain widespread adoption. It’s worth noting that ARIA’s profile for this survey is not dissimilar to HTML5’s profile in the last survey.

Do you use WAI-​​ARIA (for example the role attribute) in your markup

2010
AnswerCount%
Always90.64%
sometimes1309.27%
never117083.45%

Markup Practices

How often do respondents validate their markup?

Perhaps practices have changed a little since late 2008, perhaps respondents this time were more honest, or perhaps its not statistically significant, but the amount of validating respondents claim to do of their pages fell somewhat in this survey. 32.6% said they always validate their pages (down from 36.8%), 33.3% said frequently (up from 32.5%), sometimes held more or less steady (23.11% as opposed to 22.5), while 4.5% of respondents said they never validate (up from 3.2%).

Question 10: How often do you validate your markup?

2010
FrequencyCount%
Always45732.6%
Frequently46733.31%
Sometimes32423.11%
Never634.49%
2008
FrequencyCount%
Always45436.79%
Frequently40132.50%
Sometimes27822.53%
Never413.32%

Tables for layout

A number of questions we worded a little differently from the last survey, and in this instance a change of wording seems to have produced a dramatic result. Last year when asked “do you use tables for layout”, 84.76% answered no. This year, when the option was “never on pain of death”, only 60.2% have this answer. Meanwhile, last year 10.3% answered yes, while this year, three times that number, 31% responded “Only if I really have to”. A new option “Yes, often they’re much easier for layout than CSS” gave those who actually prefer using tables a specific response to choose. Only 2.6% gave this answer, suggesting that tables as a preferred layout technique over CSS at least among our respondent are a very small group, but still many will use tables when it makes life a little easier (we suspect laying out form elements may be one area where tables are widely used, and may ask about that specifically next year).

Still the dramatic change in response from such a minor change is interesting — perhaps the light heartedness in the answers had something to do with this.

Do you use tables for layout?

2010
AnswerCount%
Never, on pain of death84460.2%
Yes, often they’re much easier for layout than CSS362.57%
Only if I really really have to43531.03%
2008
AnswerCount%
No104684.76%
Yes12710.29%

Presentational HTML

As with last year’s survey, we asked respondents which presentational HTML (if any) they used. The percentage of those using none rose to 34.3% from 30.6%, but it still means two thirds of respondents use some form of presentational HTML. 5% of respondents still use the font element, and interestingly, the least used element or atribute we asked about was u, at 4%, despite this being still part of HTML5.

Which presentational HTML elements and attributes do respondents use?

2010
FeatureCount%
None48134.31%
font715.06%
b21315.19%
i17112.2%
border16511.77%
width28820.54%
u563.99%
height24517.48%
cellspacing25918.47%
cellpadding21915.62%
center1127.99%
2008
FeatureCount%
None37830.63%
font705.67%
b21817.67%
i18715.15%
border14611.83%
width28423.01%
u796.40%
height23819.29%
cellspacing24319.69%
cellpadding20916.94%
center1229.89%

Extended Semantics

Again this year, we asked respondents about their use of microformats and RDFa. Microformats continue to be the far more widely adopted of the two, with 43% (up from 41.5%) reporting using microformats, while 16%, down from 18.7% responded “what are microformats?”

RDFa usage was up, from 3.4% to 5.6%, and the number of those expressing ignorance of RDFa fell from 44% to 30.8%, but RDFa does still have a long way to go to catch up with thelevel of use microformats have for extending the semantics of web content.

Do you use microformats in your markup?

2010
AnswerCount%
Yes48434.52%
No60242.94%
What are microformats?22415.98%
2008
AnswerCount%
Yes42934.76%
No51241.49%
What are microformats?23118.72%

Do you use RDFa in your markup?

2010
AnswerCount%
Yes795.63%
No80257.2%
What’s RDFa?43230.81%
2008
AnswerCount%
Yes423.40%
No58647.49%
What’s RDFa?54444.08%

The big story in markup is the rise of HTML5 in the last year or so. While this might elicit little surprise, given how much interest, indeed hype has been associated with HTML5, as we’ll see elsewhere in the survey, there’s not always a correlation between hype and developer adoption (for instance, NoSQL appears to be making little headway with our respondents as yet).

Next

Next, we’ll see how respondents are using CSS and other presentational technologies.

-->