<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Coffee on the Keyboard &#187; html5</title>
	<atom:link href="http://coffeeonthekeyboard.com/tag/html5/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeeonthekeyboard.com</link>
	<description>by James Socol</description>
	<lastBuildDate>Mon, 06 Feb 2012 23:33:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>		<item>
		<title>The Future of TodaysMeet</title>
		<link>http://coffeeonthekeyboard.com/the-future-of-todaysmeet-552/</link>
		<comments>http://coffeeonthekeyboard.com/the-future-of-todaysmeet-552/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 22:02:28 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[comet]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[todaysmeet]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=552</guid>
		<description><![CDATA[This is the second half of a two-part post. Start with part 1. TodaysMeet is an interesting challenge because it has components that are absolutely real-time and should be built like a messaging system, not a CMS, and parts that aren&#8217;t real-time at all, and can totally be built like a CMS. TodaysMeet has one [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the second half of a two-part post. Start with <a href="http://coffeeonthekeyboard.com/the-problem-with-todaysmeet-550/">part 1</a>.</em></p>
<p><a href="http://todaysmeet.com/">TodaysMeet</a> is an interesting challenge because it has components that are absolutely real-time and should be built like a messaging system, not a CMS, and parts that aren&#8217;t real-time at all, and can totally be built like a CMS.</p>
<p>TodaysMeet has one loosely-coupled component, its <a href="http://twitter.com/">Twitter</a> integration. The site knows nothing about the daemon that executes Twitter searches and populates the database. If anything, I think it&#8217;s currently <em>too</em> loosely coupled, but it&#8217;s given me some insight into how to build the new system.</p>
<p>The guiding principles of this design are:</p>
<ul>
<li><strong><abbr title="Don't Repeat Yourself.">DRY</abbr></strong>. Only one part of the app should know about the canonical data store (MySQL for now).</li>
<li><strong>Loosely coupled</strong>. A failure in one part of the service shouldn&#8217;t affect other parts.</li>
<li><strong>Real-time</strong>, event-driven. Periodic polling is bad. Periodic Twitter searches are particularly so.</li>
<li>Use the <strong>right tool</strong> for the right job.</li>
</ul>
<p>Obviously I&#8217;m a fan of <a href="http://www.djangoproject.com/">Django</a>. I could port TodaysMeet directly, using something like <a href="https://github.com/mozilla/playdoh">Playdoh</a> to bootstrap the process, and get done relatively quickly. Django gets me a lot of stuff for free: a solid data store, users (something I want to add in a limited capacity, eventually), even a framework for building the crons and daemons necessary for running the site.</p>
<p>But Django is a lousy way to serve real-time content via long polling or <a href="http://socket.io/">socket</a> connections.</p>
<p>I can easily serve real-time content via <a href="http://nodejs.org/">Node.js</a>. I can do long polling or sockets. It&#8217;s also a great way to handle Twitter integration because I can just leave a connection to their <a href="http://dev.twitter.com/pages/streaming_api">streaming API</a>, and handle new tweets as soon as they happen instead of checking periodically.</p>
<p>But even with things like <a href="http://sequelizejs.com/">Sequelize</a>, MySQL connectivity through Node still feels awkward. (I think it will get better but I&#8217;m impatient.) And serving fairly static content is just weird.</p>
<p>So, <a href="http://en.wikipedia.org/wiki/Towelie">Towelie</a>, do you want to go real-time with Node, or do you want to use Django?</p>
<p>I&#8217;ll use&#8230; both!</p>
<p>Read on for a more technical overview. And a picture!</p>
<p><span id="more-552"></span></p>
<p>The core of this system is <a href="http://redis.io/">Redis</a>, acting as a message broker and light-weight data store.</p>
<p><a href="http://coffeeonthekeyboard.com/wp-content/uploads/2011/01/TodaysMeetInfra.png"><img class="aligncenter size-full wp-image-555" title="TodaysMeetInfra" src="http://coffeeonthekeyboard.com/wp-content/uploads/2011/01/TodaysMeetInfra.png" alt="" width="580" height="379" /></a></p>
<p>The three yellow blocks are event-driven daemons. <a href="https://github.com/jsocol/rasputin">Rasputin</a> is a binding that allows Django to subscribe to events from the message broker and act on them. That means I don&#8217;t need to pass messages between Node and Django over HTTP. Rasputin also includes bindings for Python to send messages back to the message broker.</p>
<p>Django will run in FastCGI mode, and <a href="http://wiki.nginx.org/Main">Nginx</a> will sit in front and proxy traffic to Node or Django based on URL.</p>
<p>I&#8217;ll write more about Rasputin when it&#8217;s more mature, but it&#8217;s designed to build an extremely loosely coupled system. It essentially makes Django an <a href="http://en.wikipedia.org/wiki/Observer_pattern">observer</a>, and observable, in a multi-process, multi-language system. When one actor publishes a message, there&#8217;s no guarantee anyone is listening, and there may be multiple people listening.</p>
<p>This architecture will give me a ton of flexibility in the future. I can add or remove services from the message broker without affecting the others, so if I wanted to, for example, replace MySQL with <a href="http://www.mongodb.org/">MongoDB</a> or <a href="http://couchdb.apache.org/">CouchDB</a>, I could easily build a daemon to start dumping data into the data store without so much as changing a configuration in Django. If I want to replace a component, for example replacing Node with <a href="http://twistedmatrix.com/trac/">Twisted</a> for Twitter integration, it&#8217;s as easy as starting one service and stopping another. I can load test new components with production data my subscribing to the right channels.</p>
<p>It&#8217;s taken a long time, but I think this is finally a way of building TodaysMeet that does it right and keeps me interested—attention is what&#8217;s best for users in the end.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/the-future-of-todaysmeet-552/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excitement about HTML5: Forms</title>
		<link>http://coffeeonthekeyboard.com/excitement-about-html5-forms-278/</link>
		<comments>http://coffeeonthekeyboard.com/excitement-about-html5-forms-278/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 17:38:50 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[Front-end]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ua]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=278</guid>
		<description><![CDATA[I shouldn&#8217;t imply that I don&#8217;t like HTML5. I don&#8217;t like certain parts of it—the redundant new elements that add no functionality and are of little use except to A List Apart. But other parts of the spec are very exciting. Forms, in particular, are getting a much-needed facelift. Forms will be able to require [...]]]></description>
			<content:encoded><![CDATA[<p>I shouldn&#8217;t imply that <a href="http://coffeeonthekeyboard.com/reservations-about-html5-271/" title="I don&#8217;t like HTML5">I don&#8217;t like HTML5</a>. I don&#8217;t like certain parts of it—the redundant new elements that add no functionality and are of little use except to <a href="http://www.alistapart.com/">A List Apart</a>. But other parts of the spec are very exciting. <a href="http://www.w3.org/TR/html5/forms.html">Forms</a>, in particular, are getting a much-needed facelift.</p>
<p>Forms will be able to require the user-agent to do <a href="http://www.w3.org/TR/html5/forms.html#constraints">pre-submission validation</a>. Obviously we can&#8217;t rely on this for security reasons, but it will save us from writing JavaScript validation scripts and give users a better experience with our forms.</p>
<p>And the validation is fairly robust. <code>&lt;input/&gt;</code> elements gain an attribute called <code><a href="http://www.w3.org/TR/html5/forms.html#attr-input-pattern">pattern</a></code>, which accepts a simple regular expression, like <code>"[A-E][0-9]{7}"</code>.</p>
<p>But you probably won&#8217;t need the <code>pattern</code> attribute very often, since there is a whole slew of new <a href="http://www.w3.org/TR/html5/forms.html#attr-input-type"><code>type</code>s</a> that the UA will be expected to provide controls for, and validate. Crucial types, like <code>email</code> and <code>url</code>, and <em>difficult</em> types like <code>datetime-local</code> and <code>color</code>.</p>
<p><a href="http://jqueryui.com/">jQuery UI</a> is great, but it doesn&#8217;t compare to this kind of power.</p>
<p>I only realized the sorry state of our current form controls very recently, after getting an iPhone. Built-in form fields on the iPhone can trigger different input methods. A field, like ZIP code, that accepts only numbers, opens the keyboard to the numbers first. A field that wants a URL can open a keyboard with a <code>.com</code> button to save time. But web pages can&#8217;t do this. They can only say that an input accepts arbitrary <code>text</code>.</p>
<p>For mobile or touch-enabled UAs, knowing that you can open a keypad instead of a full keyboard is a great step forward. For everyone, having date and color pickers built into the UA means saving both developers&#8217; and users&#8217; time. Less time to build and less time to download, consistent experience in the UA across web sites.</p>
<p>Forms also get a new event, <a href="http://www.w3.org/TR/html5/forms.html#event-input-input"><code>input</code></a>, which is a little like the current <code>change</code> event, except you don&#8217;t need to wait for the element to lose focus for the event to fire. That&#8217;s just useful.</p>
<p>Controls get new methods, <a href="http://www.w3.org/TR/html5/forms.html#dom-input-stepup"><code>stepUp()</code></a> and <code>stepDown()</code>, to enable, for example, very fast forward/backward selection on a <code>date</code> input.</p>
<p>The last fun addition I&#8217;ll mention (go read the links, they&#8217;re all to the same page) is the <a href="http://www.w3.org/TR/html5/forms.html#resulting-autocompletion-state"><code>autocomplete</code></a> attribute. It doesn&#8217;t do what you hope it does. What it does is specify to the UA that it should not remember and suggest values for this input. It lets the UX designer decide whether to use Firefox or IE&#8217;s built-in autocomplete on a per-field basis. Useful. (Not as useful as, say, an <code>autocompleteUrl</code> attribute that could load some JSON or XML, but still useful.)</p>
<p>Building forms is going to be so, so much better once these are widely support.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/excitement-about-html5-forms-278/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reservations about HTML5</title>
		<link>http://coffeeonthekeyboard.com/reservations-about-html5-271/</link>
		<comments>http://coffeeonthekeyboard.com/reservations-about-html5-271/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 23:21:22 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[suggestions]]></category>
		<category><![CDATA[whatwg]]></category>
		<category><![CDATA[xhtml5]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=271</guid>
		<description><![CDATA[A day or so ago, Adrian Bateman, from Microsoft&#8217;s IE team, posted his team&#8217;s thoughts on the current draft of the HTML5 spec. Reading it is brutal. Bateman takes issue with basically everything added since HTML4. He goes through and individually criticizes many of the new tags, sometimes with extremely detailed, multi-paragraph critiques. I guess [...]]]></description>
			<content:encoded><![CDATA[<p>A day or so ago, <a href="http://adrianba.net/">Adrian Bateman</a>, from <a href="http://blogs.msdn.com/ie/default.aspx">Microsoft&#8217;s IE team</a>, posted his team&#8217;s <a href="http://bit.ly/1TNzYU">thoughts on the current draft</a> of the <a href="http://dev.w3.org/html5/spec/Overview.html">HTML5 spec</a>.</p>
<p>Reading it is brutal. Bateman takes issue with basically everything added since HTML4. He goes through and individually criticizes many of the new tags, sometimes with extremely detailed, multi-paragraph critiques. I guess this is what happens when you&#8217;re not sufficiently involved at the beginning.</p>
<p>Of course, there is still plenty of time to complain, since <a href="http://www.webmonkey.com/blog/HTML_5_Won_t_Be_Ready_Until_2022DOT_Yes__2022DOT">the HTML5 spec won&#8217;t reach its final stage until 2022</a>.</p>
<p>Bateman and the IE team, even while sounding like they don&#8217;t even <em>want</em> HTML5, do bring up a few things that have been bothering me about the spec.</p>
<p>Let me be very clear: I think new tags like <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code> are wonderful. Breaking the Adobe monopoly is great. There are still some issues (refusing to specify a codec meaning you can&#8217;t build support into the browser, for instance) but those types of tags are going to help push the web to a better place.</p>
<p>The parts that bother me are the new, highly touted &#8220;<a href="http://microformatique.com/?p=83">structural</a>&#8221; tags, like <code>&lt;header&gt;</code>, <code>&lt;footer&gt;</code>, <code>&lt;section&gt;</code>, and worst, <code>&lt;article&gt;</code> and <code>&lt;aside&gt;</code>.<span id="more-271"></span></p>
<p>My issue is that all of these tags are perfect semantic additions, <em>if all you want to do is put magazine articles on the web</em>. These are tags that represent a <em>current</em> prevailing paradigm in <em>text-focused</em> web design that has been strongly influenced by <em>print design and layout</em>. They all have a use on <a href="http://www.alistapart.com/">A List Apart</a>, and on most blogs, but besides <code>&lt;header&gt;</code>—or possibly <code>&lt;nav&gt;</code>—can you see any of them in <a href="http://gmail.com">Gmail </a>or <a href="http://www.google.com/calendar">Google Calendar</a>?</p>
<p><a href="http://www.ryandoherty.net/">Ryan Doherty</a> already demonstrated a <a href="http://www.ryandoherty.net/2009/03/23/426/">semantic version of Gmail</a>, and didn&#8217;t need a single HTML5 tag to do it. (But please, <em>please</em>, don&#8217;t assume I&#8217;m putting words in Ryan&#8217;s mouth about HTML5. He&#8217;s also used the <code>&lt;audio&gt;</code> tag to <a href="http://ryandoherty.net/clouserwsoundboard/">great effect</a>.)</p>
<p>Issues with <a href="http://www.zeldman.com/2009/07/13/html-5-nav-ambiguity-resolved/">the ambiguity of certain new tags</a> aside, these tags privilege, even codify, a certain paradigm in design. For lack of a better word, the &#8220;wall of text&#8221; style. To that end, I worry that (a) they do nothing to help the cause of <del datetime="2009-08-08T20:49:35+00:00">emerging</del> <ins datetime="2009-08-08T20:49:35+00:00">hell already mainstream</ins> web application development—the <a href="http://en.wikipedia.org/wiki/Rich_Internet_application">Rich Internet Application</a>— and (b) they may <em>actively discourage</em> designers from trying new, paradigm breaking ideas.</p>
<p>I imagine a conversation between a designer and the developer tasked with implementing the design. Maybe this isn&#8217;t a &#8220;great&#8221; developer, but honestly, how many of those are there? The conversation ends: &#8220;Well, there just isn&#8217;t a tag for that.&#8221; Back to the drawing board.</p>
<p>What I like about the <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code> are their flexibility. By themselves, they&#8217;re nearly meaningless, just a block-level or inline element, respectively. What makes them work is the way we&#8217;ve developed the use of the <code>id</code> and <code>class</code> attributes.</p>
<p>What HTML5&#8242;s new tags lack is <em>extensibility</em>, just like HTML4. They freeze us at a moment in time (about 5 years ago) and in design. To that end, I reiterate <a href="http://microformatique.com/">John Allsopp</a>&#8216;s <a href="http://www.alistapart.com/articles/semanticsinhtml5">call for new attributes</a>, like <a href="http://www.w3.org/TR/xhtml-role/"><code>role</code> from XHTML</a>, rather than new tags. Do we really need five new block-level elements? Or should we allow some sort of extensible mechanism to create, in effect, an infinite number of new block-level elements?</p>
<p>Since I suggested it, here&#8217;s how I imagine it working: let&#8217;s say HTML5 adopts the <code>role</code> attribute, and it&#8217;s applicable to everything. Now, instead of XHTML&#8217;s short list of values for <code>role</code>, let&#8217;s define a list of values, but allow that list to be extended. So, our common values—like <code>header</code>, <code>footer</code>, <code>navigation</code>, <code>menu</code>, <code>section</code>, <code>article</code>, <code>frame</code>, <code>search</code>, <code>banner</code>, posssibly <code>data</code> and <code>interactive</code>, I&#8217;m sure we could come up with far more even now—have some defined meaning, but they are not the only possible values.</p>
<p>The tricky part is: how do we go about defining a <em>new</em> role? The simple, naïve solution is allowing people to use anything, and then use CSS selectors and JavaScript to make it work. While this opens up the extensibility to the greatest number of people, it also makes it fairly meaningless, and doesn&#8217;t really expand on the <code>id</code>/<code>class</code> system we have now.</p>
<p>The other end of the spectrum is requiring all roles to have a definition that is somehow meaningful to the user-agent. The XML way to do this would be roughly to allow the role attribute to exist in any namespace and still be interpreted, providing a definition for the UA somewhere on the web. Something like this:</p>
<pre>&lt;html ... u:xmlns="http://my.dtd/url"&gt;
...
&lt;div u:role="mycustomrole" role="interactive"&gt;</pre>
<p>This, of course, limits the number of people who can create, and host, definitions for roles. It is also incompatible with the HTML-style variant of HTML5 (as opposed to XHTML5, the XML-style variant). So let&#8217;s throw this out now.</p>
<p>The other method I can see off the top of my head is a hybrid, and puts much of the onus on the UA to be smart, and on the community to share.</p>
<p>There will need to be a lot of discussion among browser vendors on what &#8220;meaningful to the UA&#8221; means, and what kind of definitions are necessary from that, but let&#8217;s assume that they&#8217;ve all come to some sort of consensus—or, since I&#8217;ve always thought the consensus model was flawed, that some common format has emerged. There is a file format that can be placed on the web.</p>
<p>This is a hybrid scheme: if all I want is to label some elements with a new role, I can put anything in there. But if I want something meaningful to the UA, with a definition file, I can add it as a <code>&lt;link&gt;</code> element in the header.</p>
<pre>&lt;link rel="roles" type="application/role+xml" href="http://mysite.com/myroles"/&gt;</pre>
<p class="aside">MIME-types and formats are left as exercises to the reader.</p>
<p>Now, here&#8217;s where the sharing comes in. Let&#8217;s say my friend or follower wants to use a similar role, and thinks mine is close enough. He can then put the same <code>&lt;link/&gt;</code> tag. Hopefully, a smart UA, would have cached the definition file, do a conditional <code>GET</code> request, get a <code>304 Not Modified</code> from my server. If my definition file gets too popular for my server to handle, I could perhaps move it over to Google Code and have my server issue a <code>301 Moved Permanently</code>, which would hopefully convince UAs to stop pinging me.</p>
<p>There is some question about conflicting role definitions. What makes a &#8220;unique key,&#8221; is it a combination of a role and a URL? Can I define multiple roles per URL, or only one? If there are multiple roles per URL, can I, as a developer, mix and match? Which definition would take precedence? These are not trivial questions, and would have to go up for debate in <a href="http://www.whatwg.org/">WHATWG</a>.</p>
<p>This is just one idea for an extensible method of building on HTML that doesn&#8217;t lock us into a single design paradigm. What I don&#8217;t like about the current HTML5 spec is that a lot of is is neither extensible nor forward-thinking. I don&#8217;t know how many of you plan to keep making the same old blogs and webzines for the next 13 years, but I, for one, would like to move forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/reservations-about-html5-271/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

