<?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>In usability we trust</title>
	<atom:link href="http://www.svennerberg.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.svennerberg.com</link>
	<description>Web Applications Designed for Humans</description>
	<lastBuildDate>Fri, 17 May 2013 14:49:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Lean UX by Jeff Gothelf</title>
		<link>http://www.svennerberg.com/2013/05/lean-ux-by-jeff-gothelf/</link>
		<comments>http://www.svennerberg.com/2013/05/lean-ux-by-jeff-gothelf/#comments</comments>
		<pubDate>Fri, 17 May 2013 14:49:18 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4434</guid>
		<description><![CDATA[Lean UX is a well written and concrete book on how to apply Lean principles to UX. It describes a process where UX can be an integrated part of Agile Development and where developers, designers, testers and business people can &#8230; <a href="http://www.svennerberg.com/2013/05/lean-ux-by-jeff-gothelf/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://media.svennerberg.com/2013/05/leanux.jpg"><img src="http://media.svennerberg.com/2013/05/lean-ux.png" alt="Lean UX - Applying Lean Principles to Improve User Experience" class="alignright" /></a>Lean UX is a well written and concrete book on how to apply Lean principles to UX. It describes a process where UX can be an integrated part of Agile Development and where developers, designers, testers and business people can all learn how to play well together.</p>
<p><span id="more-4434"></span></p>
<p>Combining Agile development philosophy and UX work hasn&#8217;t always been a match made in heaven. Many are the UX designers who&#8217;s been frustrated trying to work in an Agile environment, and there&#8217;s a few reasons for this.</p>
<h2>Old Habits</h2>
<p>Many of the practices we have, have been developed for Waterfall methodologies with clear silos and clear milestones. These processes has required a massive design documentation that have later been handed over to development to spend then next few months (or years) implementing. </p>
<p>Those practices doesn&#8217;t work anymore and they haven’t worked that well before either. As Agile has gone mainstream we as designers need to adapt to the Agile practices and rethink how we do our work. </p>
<p>But how do we do that?</p>
<p>One way is by reading Jeff Gothems book Lean UX, which explains how to incorporate a different, more lean, mindset to the UX process. He proposes a workflow with more focus on trying out hypotheses in the real world and less focus on creating deliverables. </p>
<p>Lean UX describes a way of doing UX work in an Agile fashion. It does so in a very clear and easy to digest fashion. Jeff draws from his long experience in leading agile UX work when he describes the pitfalls and opportunities. </p>
<h2>So what is Lean UX?</h2>
<p>Lean is all about reducing waste and it&#8217;s the same with Lean UX. The book outlines a few core principles to do this:</p>
<ol>
<li>Less focus on producing design documentation, The value lies in delivering the product.</li>
<li>A focus on collaboration between Designers, Developers, QA and Business People. By breaking down the silos we get a much more effective design process and ultimately a better designed product.
</li>
<li>The realisation that what we think are good solutions are just hypothesis that need to be tested in the real world. The key is to do this continously and effectively.</li>
<li>Design for outcomes instead of features. By focusing on the outcome the team is free to find the best solution to the problem instead  of being locked down to a certain feature that might not be the optimal solution.</li>
</ol>
<h2>My verdict</h2>
<p>Lean UX is an easy to digest, practical book on how to incorporate a more effective way of developing software. It provides both valuable insights and practical techniques. I highly recommend it for anyone involved in software development and by that I don&#8217;t mean just designers. I mean anyone involved.</p>
<h2>Book information</h2>
<dl class="book-info">
<dt>Title:</dt>
<dd><a href="http://www.amazon.com/gp/product/1449311652/ref=as_li_ss_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1449311652&#038;linkCode=as2&#038;tag=inusabiwetrus-20">Lean UX: Applying Lean Principles to Improve User Experience</a><img src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&#038;l=as2&#038;o=1&#038;a=1449311652" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</dd>
<dt>By:</dt>
<dd>Jeff Gothelf and Josh Seiden</dd>
<dt>Publisher:</dt>
<dd>O&#8217;Reilly Media (March 8, 2013)</dd>
<dt>Pages:</dt>
<dd>152</dd>
<dt>ISBN:</dt>
<dd> 1449311652</dd>
<dt>ISBN-13</dt>
<dd>978-1449311650</dd>
</dl>
<p><a href="http://www.amazon.com/gp/product/1449311652/ref=as_li_ss_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1449311652&#038;linkCode=as2&#038;tag=inusabiwetrus-20" title="Lean UX: Applying Lean Principles to Improve User Experience">Buy on Amazon.com</a></p>
<p class="note">
<strong>Note:</strong> I wrote this review for <a href="http://oreilly.com/bloggers/">O’Reilly’s Blogger Review Program</a>. Their deal is pretty good: You get a free e-book to read and once you post a review you get another. Try it yourself if you&#8217;re interested in reviewing books.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2013/05/lean-ux-by-jeff-gothelf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Building Single Applications and Start Building Eco-systems</title>
		<link>http://www.svennerberg.com/2013/05/stop-building-single-applications-start-building-eco-systems/</link>
		<comments>http://www.svennerberg.com/2013/05/stop-building-single-applications-start-building-eco-systems/#comments</comments>
		<pubDate>Wed, 01 May 2013 19:00:06 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Multi-Device]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4399</guid>
		<description><![CDATA[Building and designing software used to be a whole lot easier. Historically we&#8217;ve only had to deal with one platform, the desktop computer. At this day and age where most of us have multiple devices and are always connected to &#8230; <a href="http://www.svennerberg.com/2013/05/stop-building-single-applications-start-building-eco-systems/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Building and designing software used to be a whole lot easier. Historically we&#8217;ve only had to deal with one platform, the desktop computer. At this day and age where most of us have multiple devices and are always connected to the Internet this no longer holds true. Building software have become more complex &#8211; way more complex!</p>
<p><span id="more-4399"></span></p>
<figure class="image">
<img src="http://media.svennerberg.com/2013/04/devices-1024x258.png" alt="devices"  class="alignnone" /></p>
<figcaption>We are no longer limited to the confides of our desktop computers for digital experiences</figcaption>
</figure>
<p>We are no longer limited to the confides of our desktop computers for digital experiences. Digital is all around us in the form of Computers, Smart phones, Tablets and increasingly Smart TV&#8217;s. There&#8217;s even a whole slew of new devices waiting around the corner in the form of the Internet of things. That is everyday things that are connected to the Internet like <a href="http://www.withings.com/en/bodyanalyzer">scales</a>, <a href="https://jawbone.com/up">fitness</a> <a href="http://www.fitbit.com/flex">tools</a> and <a href="http://designedaddictions.tumblr.com/">intelligent toasters</a>. </p>
<h2>Changing User Expectations</h2>
<p>With access to all these devices, people are no longer satisfied with being restricted to just one. They want to do everything on the device that&#8217;s makes most sense for their current context. </p>
<blockquote><p>The best computer is the one you have with you when you want something done <cite>Jakob Nielsen</cite></p></blockquote>
<p>Conventional wisdom says that mobile users are rushed and on the go. That&#8217;s a myth. People use their mobile phones in all kinds of contexts. Yes some of them are when they are rushed and on the go. But they also use them when they have some time to kill, or when they relax in the sofa at home after work. People even perform tasks on their mobile devices that&#8217;s not typically &#8220;mobile&#8221; tasks. <a href="http://www.lukew.com/ff/entry.asp?1500">See 40% of people use their phone in the bathroom and other interesting facts</a>.</p>
<h2>Building multi-device eco-systems</h2>
<p>What this means is that we can no longer just think one application on one platform when we build software to solve a problem. We need to consider the bigger picture. How to solve that problem in a wider context. The future of computing lies in building eco-systems of applications for different devices that solves a particular problem. </p>
<p>But having to provide software on multiple devices. How do we design, build and maintain these without getting overburdened by the complexity and diversity? </p>
<h2>Strong APIs</h2>
<p>I&#8217;ve been thinking long and hard about this and the answer I&#8217;ve come up with is this: <strong>Build a strong and easy to use API with an eco-system of simple clients using it</strong>. </p>
<p>The trick here is to put as much of the complexity as possible in the API and make it as easy as possible for the clients to use it. This way the API is the piece you invest most in and that will live for a longer period of time. It will provide a foundation on which you can build relatively simple clients around. </p>
<p>The core of my thinking is that you need to <b>make it as easy and painless as possible to build the client applications</b>. New technologies comes and goes, who knows what the next wave of connected devices will be? <a href="http://www.imsmart.com/">Smart watches</a>, <a href="http://www.google.com/glass/start/">smart glasses</a> or something else? Whatever it is we need to make sure that we can be on that platform with relative ease, without having to start from scratch.</p>
<figure class="image">
<img src="http://media.svennerberg.com/2013/05/smart-devices.jpg" alt="" class="alignnone" /></p>
<figcaption>What will the next wave of smart devices be? Will it be <a href="http://www.google.com/glass/start/">Smart glasses</a>, <a href="http://www.imsmart.com/">Smart watches</a> or something else?</figcaption>
</figure>
<h2>Go REST</h2>
<p>I&#8217;ve been talking broadly about API&#8217;s here but what I advocate is to build a <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">REST API</a>. </p>
<p>REST is not a technology, it&#8217;s an approach. It relies entirely on  HTTP for communication so it&#8217;s virtually technology agnostic. This is good. It doesn&#8217;t require you to use a specific technology to build clients. No matter what the technology, they will likely be able to communicate via HTTP. </p>
<p>Keeping it technology agnostic is a key aspect. Given that your API will live for a longer period of time, you can&#8217;t predict what new tech will be introduced, and you can&#8217;t predict which type of clients you will build a couple of years from now.   </p>
<h2>Use a simple Data Format</h2>
<p>Just as you should invest in a solid API. You should invest in a robust data format. The format should be simple enough to not add a lot of overhead but capable enough to transfer fairly complex data models. </p>
<p>I&#8217;ve found JSON to be a good candidate for this. It&#8217;s simpler than XML (or SOAP [shudder]) but can communicate lists and nested objects. An additional benefit is that since it&#8217;s really a JavaScript object, it&#8217;s perfect for web applications. </p>
<h2>Summary</h2>
<p>To sum it up. </p>
<ul>
<li>We need to start thinking about building eco-systems of clients on different platforms rather than just thinking one application. </li>
<li>To keep the cost down we need to invest in a solid API and a reliable data format. JSON being my choice of flavor.</li>
<li>To keep the API technology agnostic, REST is a good approach. Since it relies on HTTP for communication virtually any programming language can talk to it.</li>
<li>Putting the complexity in the API lets us focus on simple clients that are relatively easy to build and maintain.</li>
</ul>
<p>I hope that I&#8217;ve got you thinking about how to approach building software for this new diverse and ever-connected world. </p>
<p>What&#8217;s your thoughts about this? I love to hear them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2013/05/stop-building-single-applications-start-building-eco-systems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Future Proof Your Methods With Options Objects</title>
		<link>http://www.svennerberg.com/2013/03/future-proof-your-methods-with-options-objects/</link>
		<comments>http://www.svennerberg.com/2013/03/future-proof-your-methods-with-options-objects/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 14:17:20 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4283</guid>
		<description><![CDATA[Having methods that takes a lot of arguments can be a real pain. You not only need to remember which arguments to pass but also in which order to supply them. Things gets even worse when you need to add &#8230; <a href="http://www.svennerberg.com/2013/03/future-proof-your-methods-with-options-objects/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Having methods that takes a lot of arguments can be a real pain. You not only need to remember which arguments to pass but also in which order to supply them. Things gets even worse when you need to add more arguments to an existing method. This article will show you a better way of doing this by using only one argument.</p>
<p><span id="more-4283"></span></p>
<h2>The problem with bloated methods</h2>
<p>The problem with bloated methods are twofold.</p>
<ul>
<li><strong>They are hard to use</strong> since they require you to remember all arguments and the order they need to be supplied</li>
<li><strong>They are a pain to change</strong>. Adding an argument to an existing method can require you to find every instance where it&#8217;s used and update those calls with the additional argument.</li>
</ul>
<p>Take this method for example.</p>
<pre><code class="language-javascript">var bio = function(id, name, description) {
  // Code
}</code></pre>
<p>Ok, maybe it&#8217;s not that bloated. I actually think that using up to 3 arguments is OK, but add more than that and it&#8217;s getting messy. But for the sake of explanation let&#8217;s say it&#8217;s bloated and you want to remedy that.</p>
<h3>A word about functions and methods</h3>
<p>I&#8217;m talking about methods here but functions and methods are essentially the same thing. The only thing that differs is that a method is a function that&#8217;s part of an object. So in this example I assumes that the function being used is part of an object, hence the name method.</p>
<figure class="image">
  <img src="http://media.svennerberg.com/2013/03/function.png" alt="" class="alignnone" /></p>
<figcaption>Anatomy of a function</figcaption>
</figure>
<h2>Objectify</h2>
<p>Ok, so how do we get around this issue. The answer is simple &#8211; Use one options object instead of several arguments. It solves all of the problems listed above. Check this out:</p>
<ul>
<li>you don&#8217;t have to remember in which order to supply the arguments</li>
<li>no need to supply all arguments on all calls</li>
<li>easy to provide default values</li>
<li>easy to expand the number of arguments without breaking functionality.</li>
</ul>
<p>Ok so how&#8217;s this done then? Let&#8217;s take a look at the code for constructing the method.</p>
<pre><code class="language-javascript">var bio = function(options) {
  var id = options.id || -1,
    name = options.name || 'Empty',
    description = options.description || 'Empty';
}</code></pre>
<p>The first thing you&#8217;ll notice is that instead of taking multiple arguments the method only takes one called options. But then you might be wondering what&#8217;s going on inside the function?</p>
<p>Inside the function is a check that make sure that the object has certain properties and saves those into local variables. If a property is missing, a default value is provided.</p>
<h3>Calling the objectified method</h3>
<p>Ok, so now you know how to create the method, but what about using it? Let&#8217;s look at some code.</p>
<pre><code class="language-javascript">// Creating an options object
var options = {
  id: 1,
  name: 'Luke Skywalker',
  description: 'Young talented man'
}

// Calling the method
bio(options);</code></pre>
<p>In the code above an options object is first created and populated with the values that you want to pass to the method.</p>
<p>The options object is then used as the single argument when calling the method.</p>
<p class="note"><strong>Note:</strong> The options object is created as an object literal which is a convenient way of creating objects on the fly.</p>
<h3>Extending the object</h3>
<p>Now, what if you need to add another argument? </p>
<p>No problem, just change your method to embrace the new argument.</p>
<p>You could do it in one of two ways.</p>
<ul>
<li>By providing default values</li>
<li>By checking if the property exists and react accordingly.</li>
</ul>
<p>The first way is how it&#8217;s implemented in the example so you just need to follow that same pattern.</p>
<p>The other way is sort of the same thing but a little different. Instead of providing a default value you can simply check if the property exists or not when you need to use it.</p>
<p>Let&#8217;s try that with a new argument: <code>profession</code>.</p>
<pre><code class="language-javascript">var bio = function(options) {
  var id = options.id || -1,
      name = options.name || 'Empty',
      description = options.description || 'Empty';

  if (options.profession) {
    alert(name + ' is a ' + profession);
  } else {
    // Some sort of fallback
  }
}</code></pre>
<p>Now even if you call the method without supplying the profession property the code won&#8217;t break. Since we&#8217;re checking for its existence the method will handle it gracefully. This means that you don&#8217;t have to worry about breaking existing functionality.</p>
<h3>Pro tip</h3>
<p>You could make the call to the method more terse by creating the options object on the fly when calling the method, like this:</p>
<pre><code class="language-javascript">bio({
  id: 1,
  name: 'Luke Skywalker',
  description: 'Young talented man'
});
</code></pre>
<p>That&#8217;s how I usually do it, unless of course I need to use the options object for other things as well. Then it&#8217;s better to store it in a variable so you don&#8217;t have to create it all over again.</p>
<h2>Conclusion</h2>
<p>Passing arguments in an object instead of as individual arguments is a great way of improving your methods. It keeps your methods <strong>terse</strong>, <strong>extendable</strong> and <strong>easy to use</strong>. My recommendation is:</p>
<p class="recommendation">Whenever you find yourself with a method that requires more than 2 or 3 arguments, pass them in an options object.</p>
<p>Happy coding!</p>
<p class="note"><strong>Note:</strong> This article has previously been published on <a href="http://codecraftingblueprints.com/">Code Crafting Blueprints</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2013/03/future-proof-your-methods-with-options-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Power of Combinators</title>
		<link>http://www.svennerberg.com/2013/01/the-power-of-combinators/</link>
		<comments>http://www.svennerberg.com/2013/01/the-power-of-combinators/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 18:59:54 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4255</guid>
		<description><![CDATA[When working with CSS it&#8217;s easy to get stuck with just the basic selectors. Yes, you can get by using only those but you will write better and more efficient code if you know some of the more advanced ones. &#8230; <a href="http://www.svennerberg.com/2013/01/the-power-of-combinators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2013/01/css.png" alt="css" class="alignright" />When working with CSS it&#8217;s easy to get stuck with just the basic selectors. Yes, you can get by using only those but you will write better and more efficient code if you know some of the more advanced ones. In this article I will show you the power of CSS Combinators &#8211; A toolkit that lets you combine the basic selectors to create more powerful CSS selectors.</p>
<p><span id="more-4255"></span></p>
<h2>A base HTML</h2>
<p>For the sake of explanation I&#8217;m going to use a simple HTML structure to illustrate how each selector works. It&#8217;s fairly simple and only contains a few basic elements:</p>
<pre><code class="language-markup">&lt;div id="wrapper"&gt;
  &lt;h1&gt;Big headline&lt;/h1&gt;
  &lt;p&gt;Paragraph 1&lt;/p&gt;
  &lt;p&gt;Paragraph 2&lt;/p&gt;
  &lt;div&gt;
    &lt;p&gt;Paragraph 1 inside div&lt;/p&gt;
    &lt;p&gt;Paragraph 2 inside div&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>It&#8217;s a simple structure but it will serve well for our purpose.</p>
<h3>The DOM</h3>
<p>I often find it useful to look at the HTML as a tree structure when trying to understand how different CSS selectors work. In fact, HTML forms a tree structure in the browser called the DOM &#8211; which is short for the <a href="http://www.w3.org/TR/DOM-Level-2-Core/introduction.html">Document Object Model</a>.</p>
<p>The HTML structure above could be visualized like this:</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree.png" alt="" /></p>
<figcaption>A basic DOM tree</figcaption>
</figure>
<p>As you can see some elements are below other elements and some elements sits side by side.<</p>
<p>It’s actually like a family tree and the relations between the elements are in fact called things like parent, child, sibling and descendant.</p>
<h2>A recap of the most basic CSS selectors</h2>
<p>To cover our bases I&#8217;m going to do a quick recap of the four most basic selectors. If you&#8217;re already familiar with these, feel free to skip ahead to the <a href="#combinators">section about the combinators</a>.</p>
<ul>
<li>The Universal Selector</li>
<li>The Element Type Selectors</li>
<li>The Class Selectors</li>
<li>The ID Selectors</li>
</ul>
<h3>The Universal Selector</h3>
<p>The Universal Selector is an asterisk (*) and applies to all elements in the DOM. It&#8217;s useful when you want to target several different element types.</p>
<pre><code class="language-css">* {
  margin: 0;
}</code></pre>
<p>This selector would affect all of the  elements in the DOM-tree:</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-universal-selector.png" alt="" /></p>
<figcaption>The DOM-tree with the Universal Selector applied</figcaption>
</figure>
<p>An obvious use case for this selector is to create a simple CSS Reset. You can have this selector at the top of the CSS and set all the properites of all HTML elements to default values.</p>
<h3>The Element Selector</h3>
<pre><code class="language-css">p {
  margin: 0 0 1em;
}</code></pre>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-element-selector.png" alt="" /></p>
<figcaption>Affected elements with the Element Selector applied</figcaption>
</figure>
<h3>The Class Selector</h3>
<pre><code class="language-css">.first {
    color: #ff0080;
}</code></pre>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-class-selector.png" alt="" /></p>
<figcaption>Affected elements with the Class Selector applied</figcaption>
</figure>
<h3>The ID Selector</h3>
<p>Since there can be only one specific ID in a HTML document, the ID Selector always target a single element. It uses hash (#) and could look like this.</p>
<pre><code class="language-css">#wrapper {
  width: 980px;
  margin: 0 auto;
}</code></pre>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-id-selector.png" alt="" /></p>
<figcaption>Affected elements with the ID Selector applied</figcaption>
</figure>
<p>So far no surprises. You&#8217;re probably already familiar with these selectors and with that brief recap out of the way lets move on to more intesting things, namely the CSS Combinators.</p>
<h2 id="combinators">The Combinators</h2>
<p>The combinators are used in conjunction with the basic selectors. As the name suggest they enable you to combine other selectors in different ways so that you don&#8217;t have to have a class or ID on every single element that you want to target.</p>
<p>So why is this good then? Well it serves you well to keep the HTML and CSS as separated as possible. The least amount of extra attributes you have in the HTML the better. It will not only reduce the page size but also make maintenance easier.</p>
<p>To learn more about the benefits of keeping the HTML and CSS as separate as possible, read the article <a href="/separation-of-concerns">Separation of Concerns</a> http://codecraftingblueprints.com/post/15732181414/separation-of-concerns which explores the benefits in greater deatail.</p>
<p>Now, lets move on to the combinators.</p>
<h2>CSS Combinators</h2>
<p>There are four different combinators in CSS and they each bring their own unique benefit:</p>
<ul>
<li>The Descendant Selector</li>
<li>The Child Selector</li>
<li>The Adjacent Sibling Selector</li>
<li>The General Sibling Selector</li>
</ul>
<h3>The Descendant Selector</h3>
<p>The Descendant Selector is just two or more selectors after each other, separated by whitespace. If for example you only want to target the <code>&lt;p&gt;</code> elements inside of the <code>&lt;div class="facts"&gt;</code> you could write:</p>
<pre><code class="language-css">.facts p {
  color: #ff0080;
}</code></pre>
<p>With this code only <code>&lt;p&gt;</code> elements that lives below the element with the <code>class="facts"</code> are targeted.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-descendant-selector.png" alt="" /></p>
<figcaption>Affected elements with the Descendant Selector applied</figcaption>
</figure>
<h3>The Child Selector</h3>
<p>The Child Selector is a bit more specific than the previous one. It looks almost the same but you add a greater than character (>) between the two selectors. Doing this you make sure that only the elements that sits on the level immediately below the first selector are targeted.</p>
<pre><code class="language-css">#wrapper > p {
  color: #ff0080;
}</code></pre>
<p>Now only the <code>&lt;p&gt;</code> elements immediately below <code>&lt;div id="wrapper"&gt;</code> are affected.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-child-selector.png" alt="" /></p>
<figcaption>Affected elements with the Adjacent Child Selector applied</figcaption>
</figure>
<p>This is great for dealing with deeply nested structures where you want the styling to only target one level.</p>
<p>A common use case is when styling drop-down menus. These are often constructed with nested lists (<code>&lt;ul&gt;</code>) where you want the lists to have different styling depending on which level they appear.</p>
<h3>The Adjacent Sibling Selector</h3>
<p>The Adjecent Sibling Selector targets only elements that&#8217;s immediately after an element <strong>on the same level</strong> in the DOM-tree. It&#8217;s used by inserting a plus (+) between the first and the second selector.</p>
<pre><code class="language-css">h1 + p {
  color: #ff0080;
}</code></pre>
<p>Now only the <code>&lt;p&gt;</code> that&#8217;s directly after the <code>&lt;h1&gt;</code> is affected.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-adjacent-sibling-selector.png" alt="" /></p>
<figcaption>Affected element with the Adjacent Sibling Selector applied</figcaption>
</figure>
<p>A common use case for the Adjacent Sibling Selector is when you want the first paragraph in an article to have bigger text than the rest of the paragraphs. You could of course add a class such as <code>.first</code> to it but it&#8217;s nicer to not have to add extra attributes in the HTML. Instead you could write something like this:</p>
<pre><code class="language-css">p {
  font-size: 16px;
}
h1 + p {
  font-size: 24px;
  font-weight: bold;
}</code></pre>
<h3>The General Sibling Selector</h3>
<p>The General Sibling Selector targets elements that are siblings, but unlike the Adjacent Sibling Selector, the targeted element doesn&#8217;t have to appear immediately after the first element. It&#8217;s constructed using a tilde (~) between the two selectors.</p>
<pre><code class="language-css">h1 ~ p {
  color: #ff0080;
}</code></pre>
<p>Now both <code>&lt;p&gt;</code> elements are affected since they&#8217;re all on the same level as the <code>&lt;h1&gt;</code>.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/dom-tree-general-sibling-selector.png" alt="" /></p>
<figcaption>Affected elements with the General Sibling Selector applied</figcaption>
</figure>
<p>Note that the affected elements need to appear after the target element. So if we have the HTML below, only the two <code>&lt;p&gt;</code> elements that appear after the <code>&lt;h1&gt;</code> will be affected.</p>
<pre><code class="language-markup">&lt;p&gt;Paragraph 0&lt;/p&gt;&lt;!-- This paragraph is not affected --&gt;
&lt;h1&gt;Big headline&lt;/h1&gt;
&lt;p&gt;Paragraph 1&lt;/p&gt;
&lt;p&gt;Paragraph 2&lt;/p&gt;</code></pre>
<h2>Conclusion</h2>
<p>CSS Combinators are great for reducing the amount of extra classes and ID&#8217;s in your HTML and they have pretty good browser support too, at least if you target IE7 and above.</p>
<p>All of the combinators except the General Sibling Selector, are part of the CSS 2.1 specification which means that they&#8217;ve been around for quite some time. The General Sibling Selector is part of the CSS 3 specification but it still has really good browser support.</p>
<p>I hope that you will find CSS Combinators useful in your future CSS coding!</p>
<p>Can you think of more use cases for the combinators? Let us know in the comments!</p>
<p class="note"><strong>Note:</strong> This article is previously published on <a href="http://codecraftingblueprints.com/">Code Crafting Blueprints</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2013/01/the-power-of-combinators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Click Areas for a Brave New Multi-Device World</title>
		<link>http://www.svennerberg.com/2013/01/click-areas-for-a-brave-new-multi-device-world/</link>
		<comments>http://www.svennerberg.com/2013/01/click-areas-for-a-brave-new-multi-device-world/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 12:52:45 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Multi-Device]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4217</guid>
		<description><![CDATA[Have you ever been browsing a web site on your smart phone or tablet and found that on some sites, the links are so tiny and so tightly packed, that it&#8217;s near impossible to click the right one? I have &#8230; <a href="http://www.svennerberg.com/2013/01/click-areas-for-a-brave-new-multi-device-world/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2013/01/icon_MultiDevice_96x75.png" alt="" class="alignright" />Have you ever been browsing a web site on your smart phone or tablet and found that on some sites, the links are so tiny and so tightly packed, that it&#8217;s near impossible to click the right one?</p>
<p><span id="more-4217"></span></p>
<p>I have definitely been there and it&#8217;s equally frustrating each time. As the use of smart phones and tablets increases, so does the importance of having big enough target areas to interact with. But it&#8217;s not only important for mobile browsing. The truth is that it benefits desktop users as well.</p>
<h2>Fitts&#8217;s Law</h2>
<p><a href="http://en.wikipedia.org/wiki/Fitts's_law" title="About Fitts's law on Wikipedia">Fitts&#8217;s Law</a> is a classic rule of thumb in Interaction Design. The law can be expressed in a fairly complex mathematical way but in a nutshell it states that <strong>the larger and closer a target is, the easier and faster it is to click it</strong>.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/fitts-law-formula.png" alt="" class="alignnone" /><br />
</figure>
<p>It&#8217;s not exactly Rocket Science, but still it highlights the importance of having, not only big enough targets, but also to position them intelligently.</p>
<p>If you want to know more about Fitts&#8217;s Law there&#8217;s an excellent explanation over at <a href="http://particletree.com/features/visualizing-fittss-law/" title="Visulizing Fitts's Law">Particle Tree</a>.</p>
<h2>Designing for Touch</h2>
<p>For touch devices, such as smart phones and tablets, a big enough touch target is even more important than on desktop. While a mouse pointer is a precision instrument with a click area of just 1 x 1 pixel, a human finger is more of a sledge hammer. The avarage size of the pad of a human index finger is 1.6 to 2 cm which translates to about 45-57 pixels on a screen.</p>
<p>You&#8217;ve probably experienced the frustration yourself when trying to click small links that are tightly packed on a smart phone. It can be really hard to hit the right target and that&#8217;s not the experience you want people to have with your web site.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/hand.jpg" alt="" class="alignnone" /></p>
<figcaption>Image credit: <a href="http://www.flickr.com/people/75227967@N00/">sochacki.info</a></figcaption>
</figure>
<h3>Recommended touch target sizes</h3>
<p>Apple iOS Human Interface Guidelines state that a touch target should be at least 44 x 44 points large. (The reason they&#8217;re using points instead of pixels is that points can be used for both standard and retina displays).</p>
<p>Microsoft&#8217;s Windows Phone UI Design and Interaction Guide suggest that the size of the touch target should be 34 pixels with an absolute minimum of 26 pixel. And Nokia&#8217;s Developer Guidelines state that the touch target should be at least 1 x 1 cm.</p>
<p>I actually I think that Nokia has the best guidelines since it states its minimum dimensions in cm. I mean 44 pixels can be very different on different screens and devices. Just think about the iPad and the iPad Mini. They both have the same amount of pixels but a click area of 44&#215;44 pixels will be a lot smaller on the iPad Mini.</p>
<h3>What you don&#8217;t have in size you can make up in space</h3>
<p>Another interesting aspect of this is that if you absolutely do need to have relatively small touch targets you can partly compensate that by increasing the space between the targets. By doing that you limit the chance of missed targets.</p>
<p>The rule is: <strong>The smaller the target, the bigger the gap</strong>.</p>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/buttons.png" alt="" class="alignnone" /></p>
<figcaption>If you absolutely need small click targets you can save the day by increasing the space between them</figcaption>
</figure>
<h2>In Practice</h2>
<p>Enough already, I think you get why it&#8217;s important to have big enough click/touch targets. The question is, how is it done in practice?</p>
<p>The first thing to recognize is that <strong>the clickable area could be well outside the visible area of the object</strong>.</p>
<h3>Regular links</h3>
<p>For links in a list, the easiest way to increase the clickable area, is to increase the padding. Instead of having a padding on the list-item you should have it on the link itself. In this example I simply add a 10 pixel padding to a link. Watch how that dramatically increases its clickable area (The faint red background indicates the clickable area).</p>
<pre><code class="language-css">li a {
  padding: 10px;
}</code></pre>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/padded-links.png" alt="" class="alignnone" /><br />
</figure>
<h3>Checkboxes and Radiobuttons</h3>
<p>For checkboxes and radiobuttons, which are often really small, the trick is to put them inside a label and add a generous padding to it. By connecting the checkbox and the label via the <code>id</code> and the <code>for</code> attributes, the entire area of the label is clickable and toggles the checkbox.</p>
<h4>HTML</h4>
<pre><code class="language-markup">&lt;label for="foo"&gt;
  &lt;input type="checkbox" name="foo" id="foo" value="bar" /&gt;
  A padded checkbox
&lt;/label&gt;</code></pre>
<h4>CSS</h4>
<pre><code class="language-css">label {
  display: block
  padding: 10px;
}</code></pre>
<figure class="image">
    <img src="http://media.svennerberg.com/2013/01/padded-checkbox.png" alt=""  class="alignnone" /><br />
</figure>
<p>Without this special treatment the click area is just the visible part of the checkbox while in the enhanced version the entire label is clickable. In this case this little tweak resulted in an over 50 times larger click area.</p>
<h2>Summary</h2>
<p>In this new brave world of multi-device experiences it&#8217;s more important than ever to cater for touch as well as mouse input. An easy way to do this is to provide big enough click targets. It&#8217;ll benefit not just user of touch devices but also desktop users.</p>
<p>This article shows a few simple techniques to do this. Of course there&#8217;s also other elements that these could be applied to but I leave it up to you to do that.</p>
<h2>References</h2>
<h3>Online</h3>
<ul>
<li><a href="http://uxdesign.smashingmagazine.com/2012/02/21/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/">Finger-Friendly Design: Ideal Mobile Touchscreen Target Sizes</a></li>
<li><a href="http://www.lukew.com/ff/entry.asp?1085">Touch Target Sizes</a></li>
<li><a href="http://www.smashingmagazine.com/2010/02/13/the-definitive-guide-to-styling-web-links/">The Definitive Guide To Styling Web Links</a></li>
</ul>
<p class="note"><strong>Note:</strong> This article is a rewrite of the article <a href="http://codecraftingblueprints.com/make-click-areas-comfortably-large/">Make Click Areas Comfortably Large</a> that I&#8217;ve previously published on <a href="http://codecraftingblueprints.com/">Code Crafting Blueprints</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2013/01/click-areas-for-a-brave-new-multi-device-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design for Clickability</title>
		<link>http://www.svennerberg.com/2012/12/design-for-clickability/</link>
		<comments>http://www.svennerberg.com/2012/12/design-for-clickability/#comments</comments>
		<pubDate>Tue, 18 Dec 2012 11:26:34 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Touch]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4177</guid>
		<description><![CDATA[Making things clickable is done for a single purpose, to get people to click on them. Yet, a lot of times, designers fail to make links or buttons look clickable. In fact, while this might seem like a no-brainer, a &#8230; <a href="http://www.svennerberg.com/2012/12/design-for-clickability/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2012/12/hand-cursor-160.png" alt="" class="alignright" />Making things clickable is done for a single purpose, to get people to click on them. Yet, a lot of times, designers fail to make links or buttons look clickable. In fact, while this might seem like a no-brainer, a lot of sites get it wrong. </p>
<p><span id="more-4177"></span></p>
<p>Imagine that you have an affiliate site for the travel industry. You write beautiful articles which vividly describes exotic places where people could spend their holidays. Sprinkled in the text you have affiliate links to traveling agencies, which in case you didn&#8217;t know, have pretty decent kick-backs on referred customers that leads to a sale.<br />
</Now, the sole purpose of that article is to make people click those links. After all, that&#8217;s how you make money of the site. So your first concern should be sure that people notices them. If the contrast between the links and the body text is to small, it doesn&#8217;t matter how eloquently you describe the destination. If they can&#8217;t see &#8216;em, they won&#8217;t click &#8216;em.</p>
<p>This might sound like common sense but you would be surprised to know how many sites that get this wrong. Often I think, for aesthetic reasons.</p>
<h2>What to do about it</h2>
<p>You don&#8217;t have to take it as far as usability guru Jakob Nielsen, who infamously claimed that links should be blue and underlined (which they are on his site <a href="http://useit.com">useit.com</a> by the way). I don&#8217;t want to push this issue that far (even though the links on this site are blue and underlined), but do make sure your links stand out from the rest of the text.</p>
<p>Your safest bet is probably to have them underlined. It carries a really strong <strong>affordance</strong> for clickability (check the Fast Facts Section for more on affordance). But you could also have them in a different color, a different background color and/or styled in some other way. Just make sure that they stand out from the rest of the text.</p>
<p class="note"><strong>Note:</strong> Since underlined text is such a strong affordance for links on the web, you should make sure that everything that&#8217;s underlined is clickable. I.e. don&#8217;t underline text just to emphasize it.</p>
<h3>Account for color blindness</h3>
<p>Don&#8217;t forget that about 8% of the male population are color blind. Having something more than just the color to distinguish links is therefor a good idea.</p>
<h2>Not just text links</h2>
<p>The same thinking goes for other things that are clickable such as buttons, checkboxes, select lists, images etc. Make sure that these too actually look clickable.</p>
<p>For buttons that can mean to make them look like physical buttons with a 3D effect. This makes them stand out from the page and look more like physical objects.</p>
<figure class="image">
<img src="http://media.svennerberg.com/2012/12/buttons.png" alt="" /></p>
<figcaption>The button on the left could just as well be a banner or a header, while the button on the right is begging to be clicked.</figcaption>
</figure>
<h2>Provide clues</h2>
<p>Also make sure to provide other clues when the user moves the cursor over the object. The cursor itself could for example change to a pointing hand which carries a strong affordance of clickability. This happens by default over links in browsers but you could use a little CSS to create this effect on other clickable elements as well. </p>
<p>Another good idea is to make something happen with the clickable object itself when it&#8217;s being hovered. One common clue is to change the background color. This is easily achieved with the <code>:hover</code> pseudoclass in the CSS.</p>
<pre><code class="language-css">.clickable-item:hover { 
    cursor: pointer; 
    background-color: #ff9; 
}</code></pre>
<h3>Accomodate for keyboard</h3>
<p>Some people prefer to use the keyboard instead of a mouse for one reason or the other. Don&#8217;t forget to take this into account when providing clues. Links and form elements are easily reachable by keyboard by just tapping the tab-key. For the user to know which element currently has focus, most browsers create a dotted outline around the element. </p>
<p>That&#8217;s a pretty good affordance, but you could make it even more clear. An easy thing that I often do is to make it have the same style as on <code>:hover</code>. This is easily accomplished with CSS by using the <code>:focus</code> pseudoselector. </p>
<pre><code class="language-css">.clickable-item:hover,
.clickable-item:focus { 
    cursor: pointer; 
    background-color: #ff9; 
}</code></pre>
<p class="note"><strong>Pro Tip:</strong> If you don&#8217;t like the dotted outline, you can get rid of it by setting <code>outline</code> to <code>none</code> in the CSS.</p>
<h2>Don&#8217;t forget to design for touch</h2>
<p>On touch devices there are no such things as a hover. It&#8217;s therefor extra important to make clickable objects look clickable. You will also want to make the click area bigger to accommodate for the fat-finger syndrome, but that&#8217;s a topic for another article.</p>
<h2>Fast facts</h2>
<h3>Affordance</h3>
<p>The term Affordance was popularized by Donald Norman in his seminal book <strong>The Psychology of Everyday Things</strong>. He later changed the term to <strong>Percieved Affordance</strong> since too many misunderstood what he meant by it. (Actually his latest term for this is <strong>Signifiers</strong> but that term hasn&#8217;t gained much traction yet)</p>
<p>The Percieved Affordance is the properties of an object we understand by just looking at it. For example a door knob communicates with its shape that it can be grabbed and turned. In a similar way we can, by just looking at a pair of scissors, see that the shape of the two &#8220;holes&#8221; looks like somewhere you can put your thumb and your hand.</p>
<p>The door knob affords grabbing and turning and the pair of scissors affords sticking your hands in the holes. In the same way a underlined link and a raised button affords clicking (or touching).</p>
<h2>References</h2>
<h3>Online</h3>
<ul>
<li><a href="http://www.useit.com/alertbox/20040510.html">Guidelines for Visulizing Links</a></li>
<li><a href="http://www.jnd.org/dn.mss/affordances_and.html">Don Norman on Affordance</a></li>
</ul>
<p class="note"><strong>Note:</strong> This article is a rewrite of the article <a href="http://codecraftingblueprints.com/make-clickable-things-look-clickable/">Make Clickable Things Look Clickable</a> that I&#8217;ve previously published on <a href="http://codecraftingblueprints.com/">Code Crafting Blueprints</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2012/12/design-for-clickability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lean Tribe Gathering 12</title>
		<link>http://www.svennerberg.com/2012/12/lean-tribe-gathering-12/</link>
		<comments>http://www.svennerberg.com/2012/12/lean-tribe-gathering-12/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 14:31:25 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4151</guid>
		<description><![CDATA[I was giving a talk on Agile UX at Lean Tribe Gathering 12 the other day. It was a nice event which included several great talks that inspired lots of interesting discussions. In my talk, named UX &#9829; Agile, I &#8230; <a href="http://www.svennerberg.com/2012/12/lean-tribe-gathering-12/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2012/12/front-160b.png" alt="front-160b" class="alignright size-full wp-image-4166" />I was giving a talk on Agile UX at <a href="http://leantribe.org/ltg-12/">Lean Tribe Gathering 12</a> the other day. It was a nice event which included several great talks that inspired lots of interesting discussions. In my talk, named <strong>UX &hearts; Agile</strong>, I shared some of my experiences trying to incorporate UX work into an Agile environment. </p>
<p><span id="more-4151"></span></p>
<h2>Scrum</h2>
<p>I have mostly worked with Scrum, which I think is a great methodology for developing software. It brings a whole lot of good practices to the development process of which I think the most important is to bring the customer and the ones actually implementing the code closer to each other. Scrum really encourages better communication throughout the whole board.</p>
<h2>UX brings value to the process</h2>
<p>Allthough Agile is great a delivering software it lacks one important ingredients in creating successful product and services, the user. That&#8217;s an area where UX Design can bring a lot of value to the process. Great User Experiences doesn&#8217;t happen by accident. They happens because of focused efforts and that means bringing User Centered practices into the mix.</p>
<p>Agile and UX can definitely play nice together but there are no firm rules or definite best-practices on how to do it.</p>
<h2>My talk</h2>
<p>The talk was recorded and is available on YouTube. The presentation is available on SlideShare.</p>
<h3>The Video</h3>
<div class="media-container">
<iframe width="597" height="336" src="http://www.youtube.com/embed/3I6d8-ScjPo" frameborder="0" allowfullscreen></iframe>
</div>
<h3>The Presentation</h3>
<div class="media-container">
<iframe src="http://www.slideshare.net/slideshow/embed_code/15602048" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>
</div>
<div style="margin-bottom:5px"> <strong> <a href="http://www.slideshare.net/Svennerberg/agile-ux-15602048" title="Agile &hearts; UX" target="_blank">Agile &hearts; UX</a> </strong> from <strong><a href="http://www.slideshare.net/Svennerberg" target="_blank">Gabriel Svennerberg</a></strong> </div>
<h3>About Lean Tribe</h3>
<p>Lean Tribe Gathering 12 was organized by <a href="http://leantribe.org/">Lean Tribe</a> which is an organization that encourages discussions about Lean and Agile.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2012/12/lean-tribe-gathering-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS in the Head</title>
		<link>http://www.svennerberg.com/2012/12/css-in-the-head/</link>
		<comments>http://www.svennerberg.com/2012/12/css-in-the-head/#comments</comments>
		<pubDate>Wed, 05 Dec 2012 16:04:13 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Code Crafting Blueprints]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4134</guid>
		<description><![CDATA[When optimizing a page you&#8217;re obviously thinking about where to add different assets on it. Stuff that is needed up front is placed at the top and stuff that is needed later can be placed further down. After all, we &#8230; <a href="http://www.svennerberg.com/2012/12/css-in-the-head/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When optimizing a page you&#8217;re obviously thinking about where to add different assets on it. Stuff that is needed up front is placed at the top and stuff that is needed later can be placed further down. After all, we want the page to show something as fast as possible!</p>
<p><span id="more-4134"></span></p>
<h2>Performance That Matters</h2>
<p>The <strong>percieved performance</strong> in this case is the most important factor. We therefore want the page to load progressively, meaning: The page renders from top to bottom as content is being downloaded.</p>
<p>Lets say you&#8217;re building an image gallery to show off your fabolous collection of Rainbow Unicorns. When the user clicks a unicorn a lightbox will open and display a bigger image of it.</p>
<p>Now, the CSS for the lightbox isn&#8217;t needed for rendering the page. It&#8217;s actually not needed until the user clicks an image. Therefore we could include it at the bottom of the page to let other content load first right. </p>
<p>- You know so that the page will render faster? </p>
<p><strong>Wrong!</strong> Contrary to common sense it will actually delay the rendering of the page in a lot of web browsers.</p>
<h2>Counterintuitive Behavior</h2>
<p>But why does it delay the rendering? Keeping the browser from downloading it before other content ought to make the rendering faster. This is really counter intuitive at first glance, but listen to this:</p>
<p><strong>The browser doesn&#8217;t want to risk having to re-render the page, it therefore waits until all CSS is loaded before rendering anything!</strong></p>
<h2>The Rule</h2>
<p>Fortunately there&#8217;s a really simple solution to this. Just follow this simple rule: <strong>Include all CSS in the &lt;head&gt; of the page</strong>.</p>
<h2>References</h2>
<h3>Books</h3>
<p><a href="http://www.amazon.com/High-Performance-Web-Sites-Essential/dp/0596529309">High Performance Web Sites &#8211; Essential Knowledge for Frontend Engineers by Steve Souders</a></p>
<h3>Online</h3>
<p><a href="http://developer.yahoo.com/performance/rules.html#css_top">Best Practices for Speeding Up Your Web Site</a></p>
<p class="note"><strong>Note:</strong> This article has previously been published on <a href="http://codecraftingblueprints.com">Code Crafting Blueprints</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2012/12/css-in-the-head/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Separation of Concerns</title>
		<link>http://www.svennerberg.com/2012/11/separation-of-concerns/</link>
		<comments>http://www.svennerberg.com/2012/11/separation-of-concerns/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 20:23:03 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Code Crafting Blueprints]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4118</guid>
		<description><![CDATA[Have you ever found yourself in a situation where you have a site where the HTML, the CSS and the JavaScript are all tangled together and it becomes a nightmare to make even the tiniest site-wide change? What you’ve experienced &#8230; <a href="http://www.svennerberg.com/2012/11/separation-of-concerns/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Have you ever found yourself in a situation where you have a site where the HTML, the CSS and the JavaScript are all tangled together and it becomes a nightmare to make even the tiniest site-wide change?</p>
<p><span id="more-4118"></span></p>
<p>What you’ve experienced is what is commonly referred to as <strong>Spaghetti code</strong>. To avoid falling into this trap you should follow one simple rule:</p>
<p><strong>Always separate HTML, CSS and JavaScript into different files.</strong></p>
<figure>
<img alt="" src="http://media.svennerberg.com/2012/11/3-heads.jpg" /><br />
</figure>
<p>Remember that <strong>HTML is for content</strong> (and structure), <strong>CSS is for design</strong> and <strong>JavaScript is for behavior</strong>. By separating them into different layers you gain several things. It becomes:</p>
<ul>
<li>Easier to maintain</li>
<li>Increased performance</li>
<li>Better accessibility</li>
<li>A good foundation for SEO</li>
</ul>
<h3>Maintainability</h3>
<p>First of all, your code becomes more maintainable. If there’s something wrong with the design, it’s probably in the CSS. If on the hand your super cool drag and drop interface stops working, something is probably wrong in the JavaScript files. In other words, it’s easier to find errors.</p>
<p>Imagine wanting to change the entire design of your site to a ninja unicorn theme (shudder). Having your HTML, CSS and JavaScript in a big mess you basically need to rewrite the whole site. But if you been a good coder and kept them separated, all you need to do is to change the CSS. Simple, right?</p>
<h3>Performance</h3>
<p>In most cases the site loads faster if you have the layers separated. And we all know how important speed is!</p>
<p>JavaScript and CSS files are static assets that can be effectively cached by the browser. What it means is that the browser doesn’t have to download them more than once. You save both bandwidth and rendering time.</p>
<h3>Accessibility</h3>
<p>By separating the different layers you also benefit the accessibility of the site. It’s in fact the foundation of Progressive Enhancement (and graceful degradation). This means that even if the user interact with your site using a less capable device (for example: disabled JavaScript, screen reader, old browser, you name it) it can still access the content because the device can simply ignore the parts it doesn’t support and render what it can.</p>
<p>HTML is the solid foundation of the web. By making sure that you keep the content there (semantically marked up of course) and that neither the CSS, nor the JavaScript is in its way, you can be sure that every browser on this planet can access your content.</p>
<h3>SEO</h3>
<p>Web crawlers, the evil robots of Search Engines that constantly crawles the web on their endless hunt for content to index, is another reason you want to separate the layers. A web crawler is basically a blind user. It doesn’t care about your fancy styles or your crazy JavaScript animations. All it cares about is your content &#8211; your HTML.</p>
<p>So you better make sure that your content is semantically marked up with valid HTML and that the CSS and JavaScript is out of its way. Having done this, you’re on your merry way towards SEO nirvana.</p>
<h2>A Bad Example (Warning Anti Pattern!)</h2>
<p>In this example, the separation of concerns is violated. Both content, style and behavior are meshed together in an awful soup.</p>
<h3>HTML</h3>
<pre><code class="language-markup">
&lt;a href="/some/url/" onclick="someFunction(); return false;" style="font-size: 12px; color: #f00;"&gt;A bad link&lt;/a&gt;</code></pre>
<h2>Good Example</h2>
<p>Good Example</p>
<p>In this good example the same thing is done with a clear separation between content, style and behavior.</p>
<h3>HTML</h3>
<pre><code class="language-markup">
&lt;a href="/some/url/" id="some_link"&gt;A good link&lt;/a&gt;</code></pre>
<h3>CSS</h3>
<pre><code class="language-css">#some_link { font-size: 12px; color: #f00; }</code></pre>
<h3>JavaScript</h3>
<pre><code class="language-javascript">document.getElementById('some_link').addEventListener('click', someFunction, false);</code></pre>
<h2>Conclusion</h2>
<p>I hope that this article have convinced you that keeping a clear separation is the way to go. So save yourself a lot of grief and separate these three levels as much as possible or you might as well end up in Spagetti Code Hell.</p>
<h2>References</h2>
<h3>Online</h3>
<p><a href="http://dev.opera.com/articles/view/4-the-web-standards-model-html-css-a/">The Web Standards model &#8211; HTML, CSS and JavaScript</a></p>
<p><a href="http://en.wikipedia.org/wiki/Separation_of_concerns">Separation of concerns on Wikipedia</a></p>
<h3>Books</h3>
<p><a href="http://www.amazon.com/DOM-Scripting-Design-JavaScript-Document/dp/1590595335">DOM Scripting by Jeremy Keith, FriendsofEd 2005</a></p>
<p><a href="http://www.amazon.com/Bulletproof-Web-Design-flexibility-protecting/dp/0321346939">Bulletproof Web Design by Dan Cederholm, New Riders 2006</a></p>
<h2>Bonus Fact</h2>
<p>The concept of Separation of Concerns is not limited to HTML, CSS and JavaScript. It applies just as much to general software development where you want to keep different things separated. For example the data, the business logic and the User Interface.</p>
<p><a href="http://en.wikipedia.org/wiki/Separation_of_concerns">Separation of concerns on Wikipedia</a></p>
<p class="note"><strong>Note:</strong> This article has previously been published on <a href="http://codecraftingblueprints.com">Code Crafting Blueprints</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2012/11/separation-of-concerns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slide:ology by Nancy Duarte</title>
		<link>http://www.svennerberg.com/2012/08/slideology-by-nancy-duarte/</link>
		<comments>http://www.svennerberg.com/2012/08/slideology-by-nancy-duarte/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 15:22:12 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=4075</guid>
		<description><![CDATA[As one who performs presentations on a regular basis it&#8217;s interesting to read books on presentation techniques. Slideology is one such book and it&#8217;s been widely praised, so I was very keen on reading it to see what the fuzz &#8230; <a href="http://www.svennerberg.com/2012/08/slideology-by-nancy-duarte/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://media.svennerberg.com/2012/08/slide-ology_cover.jpg"><img src="http://media.svennerberg.com/2012/08/slide-ology_cover.png" alt="" class="alignright" /></a>As one who performs presentations on a regular basis it&#8217;s interesting to read books on presentation techniques. Slideology is one such book and it&#8217;s been widely praised, so I was very keen on reading it to see what the fuzz was about.</p>
<p><span id="more-4075"></span></p>
<h2>About the author</h2>
<p>The author of the book, Nancy Duarte, runs a company called <a href="http://www.duarte.com/">Duarte</a> that&#8217;s in the business of creating compelling presentations for their clients. They&#8217;re famous for creating Al Gore&#8217;s presentations for An Inconvenient Truth which was something that definitely showed the power of great use of presentation software.</p>
<h2>Highly acclaimed</h2>
<p>Since this book is widely praised in a lot of reviews I had pretty high expectations when I started reading it. Maybe that&#8217;s the reason I&#8217;m not so impressed with it. I found it pretty light on substance and I&#8217;m not sure it has added a lot of value to my slide creating skills.</p>
<p>The book touches on basic design principles and presentation skills. I&#8217;m sure if you&#8217;re a design noob that there&#8217;s a lot of nuggets to be found there, but if you have some design skills, it&#8217;s all very basic.</p>
<h2>The format</h2>
<p>The book is very &#8220;designed&#8221;, something I quite enjoy and I&#8217;m sure works very well in the physical book. The problem I had was that I read the e-book version in pdf format and the square format of the book with lots of design elements made it hard to read. I had to constantly zoom in on parts of pages to be able to read the text which made the reading experience less than ideal. </p>
<h2>Summary</h2>
<p>All in all I think it&#8217;s an OK book, which obviously a lot of work went in to creating. If you&#8217;re a non-designer you will probably find useful information that will make your slides better. But if you&#8217;re like me and have some experience in design and creating slides, you will find it very basic. That said you might still enjoy the design of the book and all the lovely examples in it. But in that case I recommend you get the physical book, because the e-book version is really not adapted for the format.</p>
<h3>Book information</h3>
<dl class="book-info">
<dt>Title:</dt>
<dd><a href="http://www.amazon.com/gp/product/0596522347/ref=as_li_ss_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596522347&#038;linkCode=as2&#038;tag=inusabiwetrus-20">slide:ology: The Art and Science of Creating Great Presentations</a><img src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&#038;l=as2&#038;o=1&#038;a=0596522347" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></dd>
<dt>By:</dt>
<dd>Nancy Duarte</dd>
<dt>Publisher:</dt>
<dd>O&#8217;Reilly Media; 1 edition (August 12, 2008)</dd>
<dt>Pages:</dt>
<dd>296</dd>
<dt>ISBN:</dt>
<dd>0596522347</dd>
<dt>ISBN-13</dt>
<dd>978-0596522346</dd>
</dl>
<p><a href="http://www.amazon.com/gp/product/0596522347/ref=as_li_ss_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596522347&#038;linkCode=as2&#038;tag=inusabiwetrus-20" title="Buy Slide:ology by Nancy Duarte on Amazon.com">Buy on Amazon.com</a></p>
<p class="note">
<strong>Note:</strong> I wrote this review for <a href="http://oreilly.com/bloggers/">O’Reilly’s Blogger Review Program</a>. Their deal is pretty good: You get a free e-book to read and once you post a review you get another. Try it yourself if you&#8217;re interested in reviewing books.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2012/08/slideology-by-nancy-duarte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
