开发者

Why should I care about using HTML5 in a Rails 3 app?

First, I'm really not intentionally trying to sound naive in asking that question.

But really though. I'm starting a new Rails project that I expect to maintain for many years to come, and I want to make decisions now that "future-proof" the project as best I can.

So what potential value do I stand to gain from HTML5 in general? I suppose the Rails 3 bit is less important to that question, but the second part of my question is just that. What constitutes "using" HTML5? And how do you go about doing it in Rails 3?

From what I understand, Rails3 does support the data- attributes. Is that in of itself good enough?

What about html5boilerplate? I've only spent a small amount of time looking into html5boilerplate, but it seems like a lot of stuff going on in there. And what exactly is in there anyways? I see that there's a Rails3html5 project on github, but there's no documentation to开发者_如何学C help me understand the "Why?".

So to summarize, I'm looking for someone familiar with HTML5 enough to explain why someone would want/need to worry about HTML5 at this point in its lifecycle. "Because it's new and shinny!" isn't a good answer.

Explaining how/why html5boilerplate would/should tie into a Rails3 project would also be nice.


You should use HTML 5 not because it's new and shiny, but it is the future. If you don't plan for the future, your going to have to migrate sooner or later. It's not like HTML5 is in alpha version right now, it is being implemented heavily by browsers now. By making your site HTML5 compliant now, not only will you be ahead of the curve, but you won't have to catch up months/years from now.

And I won't throw the new/shiny reason at you, however the specs offer very useful features such as Offline Storage, Native video and Audio, Geolocation, Better form elements etc etc. So not only will you be ahead of the curve, but you will be providing awesome new features for your users.

Just for reference, here is a comparison chart on compatibility with HTML5 features in browsers today. http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML5%29


HTML5 introduces new, more efficient ways, to do things that have become standard in many web applications.

If you are creating a web application today and using compliant HTML (<5) it will be fully compatible with an HTML5 based browser.

The decision around taking advantage of any HTML5 specific features needs to be made based on many factors, like audience you are trying to reach and development capabilities.

For many larger companies/initiatives web developers still have to answer for functionality within browsers like IE6.0. Designing a site dependent on HTML5 features isolates it to a very small audience at this time.

Also, you should be very aware that HTML5 may be the future, but it is still a Working Draft at the W3C and is open to a lot of interpretation on the part of implementors (FF, IE, WebKit, ...). Care must be taken in deciding which parts of the HTML5 spec you are developing against as the Standard isn't even set yet.


While the benefits of using the HTML5 doctype might not be crystal clear right now, the good news is, it won't create any harm to older sites/app structures that don't use any of the features of HTML5.

Simply stated, you could just make use of the doctype for now and implement HTML5 "features" at a later time, when the specs are at a point in stability with which you are comfortable.

By doing this, you have made your app "future proof" like you initially stated without wreaking any havoc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜