<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	
	<title>On Making Web Things</title>
	<link href="http://imakewebthings.com/atom.xml" rel="self" />
	<link href="http://imakewebthings.com" />
	<updated>2023-10-03T22:22:59+00:00</updated>
	<id>http://imakewebthings.com</id>
	<author>
		<name>Caleb Troughton</name>
		<email>caleb@imakewebthings.com</email>
	</author>

	
		<entry>
			<title>Tiny Question</title>
			<link href="http://imakewebthings.com/blog/tiny-question" />
			<updated>2014-01-16T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/tiny-question</id>
			<content type="html">&lt;p&gt;It’s mid-afternoon on day 2 of the conference. Post-lunch sluggishness is wearing off and you’re excited for the next session. You settle in, and for the next half hour watch the speaker completely nail it. Great topic, unique insights, and expertly presented. A well-deserved swell of applause.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;It looks like we have five minutes for questions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hands shoot up in the audience. The speaker scans the room and chooses one. You give no thought to how this hand was chosen. One of the conference volunteers runs a handheld microphone over to the questioner. This eats up some time considering the size of the room, but you’re used to it. The conference last month used a standing microphone where inquiring minds hurried to queue. You also gave no thought to how that setup determined which questions were chosen.&lt;/p&gt;

&lt;p&gt;The first question starts with some light self-promotion of the questioner’s new startup. It isn’t enough to force the conference volunteers to pull the mic away, but it is enough to make you roll your eyes. A question is eventually asked. The presenter answers. One down.&lt;/p&gt;

&lt;p&gt;Hands up, volunteers run around, and question two begins. Except it’s actually four questions, not that the questioner says this upfront. Once the first question is answered the questioner volleys with follow-up, then another answer and follow-up. This cycle continues until the presenter graciously asks the questioner to approach them later in private so that the room can move on to more questions. You sigh and wonder if the questioner is aware of their time monopolization.&lt;/p&gt;

&lt;p&gt;The third question isn’t a question. It’s a long, meandering, incohesive statement only tangentially related to the topic. It’s obvious that the questioner is only looking for a reaction from the presenter. Being a professional, the presenter gives their opinion despite the shaky intentions and form of the question.&lt;/p&gt;

&lt;p&gt;Time is up. More applause. On to the next session.&lt;/p&gt;

&lt;h2 id=&quot;we-can-do-better&quot;&gt;We Can Do Better&lt;/h2&gt;

&lt;p&gt;Odds are if you’ve been to a conference you’ve been to &lt;em&gt;that&lt;/em&gt; conference, sat in &lt;em&gt;that&lt;/em&gt; session. This is the status quo for conference Q&amp;amp;A sessions and it is broken. Among my complaints:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Question Quality&lt;/strong&gt;: Nobody has any idea how good a question will be until it leaves the questioner’s mouth. By the time this happens the crowd and presenter have already promised to give the question time and attention, regardless of quality. This strikes me as backwards.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Questioner Selection&lt;/strong&gt;: In our prototypical example above, the best-case scenario when the crowd raises hands is &lt;em&gt;random questioner selection&lt;/em&gt;. Worse yet, the speaker may select based on people they already know or by a bias, conscious or unconscious. If you use a first-come first-serve line, you’re chosing questions by who has the fastest feet and least fear of speaking in front of a crowd.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Time Management&lt;/strong&gt;: There are probably no checks on how long it takes to ask a question. A long question may distill well into a five-second question, but what comes out at a microphone is typically a first draft. Are we surprised that first drafts are awkward, unclear, overly long, and stray off topic?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Identity&lt;/strong&gt;: Who the questioner is and what information you would like to know about them depends on which person you are in the room. If you are a fellow attendee, you probably don’t need to know much. The question is the important part. For the presenter, the question is obviously still important but you may also be interested in connecting with the questioner later, perhaps to answer the question in more detail and provide additional resources. “Hi, my name is Questioner, I work at Company, and my question is,” does a terrible job of providing a useful identity for both parties. For the rest of the crowd it is wasted time. The presenter isn’t given a great way to connect with you again outside of a Hail Mary Google search.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Unasked Questions&lt;/strong&gt;: Not just the raised hands that never get chosen. There are tens or hundreds of questions, great questions, locked away in the heads of those unwilling to raise their hands. Maybe they’re nervous. Maybe they think their question is stupid. We’ll never know.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;attempting-to-do-better&quot;&gt;Attempting to Do Better&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://tinyquestion.com&quot;&gt;Tiny Question&lt;/a&gt; is a dead simple tool designed to improve the conference Q&amp;amp;A experience. Here’s how it works.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The presenter logs in to Tiny Question (via Twitter) and creates a new question session.&lt;/li&gt;
  &lt;li&gt;The presenter shares the URL of this question session with the audience. This is usually done by putting the URL somewhere in the opening slides and telling the audience that there will be Q&amp;amp;A after the presentation, but that questions will be read from this session and not from the microphones.&lt;/li&gt;
  &lt;li&gt;Audience members who open the URL will also be asked to log in via Twitter. Once they do, they’ll be able to ask questions on the page. As others ask questions, those too will be displayed.&lt;/li&gt;
  &lt;li&gt;Audience members can upvote questions. Questions stay sorted in vote order so higher upvoted questions float to the top.&lt;/li&gt;
  &lt;li&gt;After the presentation is over, the presenter opens the question session page, sees the questions sorted by upvotes, then reads and answers them as time permits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s look at my complaints once again.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Question Quality&lt;/strong&gt;: Questions are now seen beforehand and voted on by the crowd. High quality popular questions float to the top.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Question Selection&lt;/strong&gt;: The idea of the presenter selecting a questioner is almost completely discarded. Selection is moved to the collective audience. The presenter does have final say on what’s answered, as they could just skip over a highly upvoted question, but the crowd will be aware of what questions were skipped, which is interesting information as well.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Time Management&lt;/strong&gt;: Typing the question gives questioners the ability to pause, think, and self-edit questions. Presenters can also use their expertise to summarize and rephrase the question when reading it aloud.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Identity&lt;/strong&gt;: Questions are presented next to the Twitter thumbnail of the questioner, which links to their Twitter profile. Other audience members are no longer forced to hear the short bio of every questioner. Presenters are given an identity that they can contact after the presentation for followup.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Unasked Questions&lt;/strong&gt;: The pool of questioners is no longer limited to the outgoing and luckily chosen. There is a tradeoff though. The pool is limited to those with a Twitter profile and a connected device capable of loading a webpage. This limitation makes an argument for holding mixed sessions, where questions are fielded both on Tiny Question and live. It depends on the audience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like everything else on the web, this is an ongoing experiment. I hope this method can help solve some of the problems laid out above. We’ll see if it does.&lt;/p&gt;

&lt;p&gt;Tiny Question is free for anyone to use. The source is available on &lt;a href=&quot;https://github.com/imakewebthings/tinyquestion&quot;&gt;GitHub&lt;/a&gt; should you want to create your own version of the service. Pull requests are welcome.&lt;/p&gt;

&lt;h2 id=&quot;ask-me-questions&quot;&gt;Ask Me Questions&lt;/h2&gt;

&lt;p&gt;Do you have a question about Tiny Question? &lt;del&gt;Ask it here (on Tiny Question) and I will update this post with answers.&lt;/del&gt; Questions are closed. One more thing to note about Tiny Question: All question sessions are deleted 48 hours after creation. The tool is not meant as a permanent place for questions to live, but as an aid to a live event.&lt;/p&gt;
</content>
		</entry>
	
		<entry>
			<title>Just-In-Time Versioning</title>
			<link href="http://imakewebthings.com/blog/just-in-time-versioning" />
			<updated>2013-11-20T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/just-in-time-versioning</id>
			<content type="html">&lt;p&gt;When &lt;a href=&quot;http://imakewebthings.com/deck.js/&quot;&gt;deck.js&lt;/a&gt; was published I didn’t give it a version number. The first time I did this it was an accident, or at least innocent oversight, as I was making public a project without a long-term plan. This unversioned system has lasted to this day. In place of proper versions were two branches, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stable&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;master&lt;/code&gt;. Changes were made to master. When they were vetted and felt right, they were merged into stable.&lt;/p&gt;

&lt;h2 id=&quot;it-worked-for-two-years&quot;&gt;It Worked for Two Years&lt;/h2&gt;

&lt;p&gt;Never in the history of the project have I received a complaint about the lack of semantic versioning. I’m inclined to chalk it up to people having the problem and not complaining, but considering that my inbox is full of complaints about every other conceivable matter I’m left to conclude that it &lt;em&gt;just isn’t that important to the average user&lt;/em&gt;. That is… for a project like this.&lt;/p&gt;

&lt;p&gt;When an average user consumes deck.js they download it, edit slides, tweak a theme or two, give their presentation, and then they are &lt;strong&gt;done&lt;/strong&gt;. There’s no updating modules, no merging changes, no outdated plugins. Versioning never comes into play for these users. And for the power users or extension authors that rely on the core project, the fact of the matter is the API has not significantly changed in two years. In the world of semver, we’d probably be on the same minor release as day one.&lt;/p&gt;

&lt;p&gt;But there comes a time where the API needs to become unstable, and that time is now.&lt;/p&gt;

&lt;h2 id=&quot;10-1x-and-20&quot;&gt;1.0, 1.x, and 2.0&lt;/h2&gt;

&lt;p&gt;Deck.js version &lt;a href=&quot;https://github.com/imakewebthings/deck.js/archive/1.0.0.zip&quot;&gt;1.0.0&lt;/a&gt; is now available. 1.0 is nothing more than the current API that has existed for months (with a recent push of bug fixes.)&lt;/p&gt;

&lt;p&gt;The important thing about a 1.0 release isn’t the 1.0 code. It’s that you have a code base against which to make minor and major changes. 2.0 means nothing without the 1.0 to compare it against. And I’m excited to work towards a 2.0. If you would like to follow along with the deck.js changes going forward from 1.0, take a look at &lt;a href=&quot;https://github.com/imakewebthings/deck.js/issues/140&quot;&gt;this GitHub ticket&lt;/a&gt;.&lt;/p&gt;

</content>
		</entry>
	
		<entry>
			<title>This Is Not a Launch</title>
			<link href="http://imakewebthings.com/blog/this-is-not-a-launch" />
			<updated>2013-05-12T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/this-is-not-a-launch</id>
			<content type="html">&lt;p&gt;&lt;img src=&quot;https://s3.amazonaws.com/imakewebthings-blog/launch.jpg&quot; alt=&quot;A sketch of a rocket, under it written: Ceci n'est pas un lancement&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Two months ago I had a conversation with a potential new client over Skype. They said, “I’ve been reading through your blog posts. You mention how most people can &lt;a href=&quot;/blog/deck-js-post-mortem-quick-hits/&quot;&gt;code in the open&lt;/a&gt; and nobody will care, but then you &lt;a href=&quot;/blog/more-upfront-less-available/&quot;&gt;allude to a mysterious new thing&lt;/a&gt; you’re working on without giving details. What’s up with that?”&lt;/p&gt;

&lt;p&gt;If that sounds combative, it was not. A friendly call-out. And the best question I’ve been asked in a while. These two statements absolutely contradict each other and I intend to resolve that dissonance with this post.&lt;/p&gt;

&lt;h2 id=&quot;defining-v1&quot;&gt;Defining v1&lt;/h2&gt;

&lt;p&gt;Label it however you want — &lt;a href=&quot;http://en.wikipedia.org/wiki/Minimum_viable_product&quot;&gt;MVP&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Lean_software_development&quot;&gt;Lean&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Agile_software_development&quot;&gt;Agile&lt;/a&gt; — but let’s make an assumption. You want to get a minimal core product out to the public, gather feedback, and start iterating as quickly as possible. This reduces wasteful upfront work and gets you listening to your customers instead. I buy into this.&lt;/p&gt;

&lt;p&gt;The question becomes: What features should be included day one? We could come up with a wide array of ways to evaluate the necessity of features.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Say yes/no to each feature.&lt;/li&gt;
  &lt;li&gt;Select an arbitrary number of features and cull.&lt;/li&gt;
  &lt;li&gt;Prioritize and build as many features as possible before a certain date.&lt;/li&gt;
  &lt;li&gt;Do whatever The Boss says.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But I don’t want to argue for these or any other way to evaluate features. If we accept that the waste and risk reduction of a minimal first release is good, and that fewer features minimizes that waste, the math says debating features is pointless. We should ship with zero features.&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Well that’s obviously stupid. So let’s try it…&lt;/p&gt;

&lt;h2 id=&quot;announcing-deckclouds-launch-first-feature&quot;&gt;Announcing DeckCloud’s &lt;del&gt;Launch&lt;/del&gt; &lt;ins&gt;First Feature&lt;/ins&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://deckcloud.com&quot;&gt;DeckCloud&lt;/a&gt; is a product with one feature: &lt;a href=&quot;http://blog.deckcloud.com/free-and-pro-accounts/&quot;&gt;Free and Pro accounts&lt;/a&gt;. There’s nothing else to do. You can create an account, and you can upgrade that account to a Pro account for $9/mo. The $9 subscription gives you zero extra functionality on top of the zero existing functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Great. Who cares?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Exactly. You shouldn’t care. Nobody should care about this product. Now that &lt;em&gt;that’s&lt;/em&gt; out of the way, now that I’ve subverted the importance of the “launch”, I can start working on features and releasing them. Maybe, in time, those iterations will add up to something worthy of another human’s money.&lt;/p&gt;

&lt;h2 id=&quot;all-the-caveats&quot;&gt;All the Caveats&lt;/h2&gt;

&lt;p&gt;I’m not recommending everyone (or really, anyone) do this with their own apps. People have great reasons for building out a more mature app before the inititial release. But I don’t have investors paying close attention to the size and growth rate of my user base. I’m not seeking a writeup in Forbes, a front-page Hacker News link, or a viral Twitter run. I don’t need paying users right now. If these things describe you and your app, thank you for reading so long after it was obvious that this article was not aimed your way.&lt;/p&gt;

&lt;h2 id=&quot;the-answer-to-the-original-question&quot;&gt;The Answer to the Original Question&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;How do you create a new product and do it in the open&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; in a way that nobody will care?&lt;/em&gt; Like this, by releasing a useless v1 and developing every feature “post-launch”. From here forward I’ll be announcing new features on the &lt;a href=&quot;http://blog.deckcloud.com&quot;&gt;DeckCloud Blog&lt;/a&gt; as soon as they’re ready and not a second before. If you’re interested in keeping up with the project, subscribe or sign up for the newsletter on the DeckCloud &lt;a href=&quot;https://deckcloud.com&quot;&gt;homepage&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Ok, so zero features may be where the math leads but it’s logistically difficult. What does an app with zero features look like? A URL that resolves to a blank page? That &lt;strong&gt;is&lt;/strong&gt; what DeckCloud has been for months… &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;The DeckCloud app code will remain closed-source, but I intend to open-source as many pieces as possible. One such open-source component already exists: &lt;a href=&quot;http://imakewebthings.com/jquery-confirms&quot;&gt;jquery-confirms&lt;/a&gt; &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</content>
		</entry>
	
		<entry>
			<title>Leave the Glasses On</title>
			<link href="http://imakewebthings.com/blog/leave-the-glasses-on" />
			<updated>2012-08-21T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/leave-the-glasses-on</id>
			<content type="html">&lt;p&gt;115 years ago a UC Berkeley Psychology professor named George Stratton decided to &lt;a href=&quot;http://www.cns.nyu.edu/~nava/courses/psych_and_brain/pdfs/Stratton_1896.pdf&quot;&gt;plaster a small tube to his face&lt;/a&gt; for a total of 21½ hours over three days. The lenses in this tube inverted his vision, turning the world upside down. Stratton theorized that with enough time the human brain could adapt to such a drastic change and function normally.&lt;/p&gt;

&lt;p&gt;As expected, Stratton found his new spatial field difficult to navigate (emphasis mine):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;All images at first appeared to be inverted; the room and all in it seemed upside down. The hands when stretched out from below into the visual field seemed to enter from above. Yet although these images were clear and definite, they did not at first seem to be real things, like the things we see in normal vision, but they seemed to be misplaced, false, or illusory images between the observer and the objects or things themselves. &lt;strong&gt;For the memory-images brought over from normal vision still continued to be the standard and criterion of reality.&lt;/strong&gt; The present perceptions were for some time translated involuntarily into the language of normal vision; the present visual perceptions were used simply as signs to determine how and where the object would appear if it could be seen with restored normal vision. &lt;strong&gt;Things were thus seen in one way and thought of in a far different way.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;The Computer Science program at Cal Poly requires students to pass CSC 430: Programming Languages I. You might think by the title that this class teaches you various programming languages. It does not. You study the &lt;strong&gt;anatomy&lt;/strong&gt; of languages but use just one: &lt;a href=&quot;http://www.smlnj.org/&quot;&gt;Standard ML&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At the time, most coursework up to this point was written in Java or C. Standard ML is a relatively obscure functional programming language closely related to OCaml. This shift from object-oriented and imperative languages to a more functional one takes you out of your comfort zone. In C you might write a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sum&lt;/code&gt; function for an array of integers like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[],&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In ML you might write it:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ocaml&quot; data-lang=&quot;ocaml&quot;&gt;&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xs&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Initial reactions range from frustration, to panic, to depression. You don’t know how to do the simplest things. This is one of the stated goals of the class, to throw students into the deep end of a different programming paradigm. After a couple years of navigating the &lt;a href=&quot;http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html&quot;&gt;noun kingdom&lt;/a&gt; and finally getting comfortable, you’re forced to start over.&lt;/p&gt;

&lt;p&gt;With our knowledge and egos demolished we were tasked with a single ongoing quarter-long project: Write an interpreter. The language to interpret is D Flat, a fake stripped down subset of C#. Still, it’s a sizeable task in a new field of study using an alien language. It can be daunting.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Stratton’s preliminary attempt at his experiment left him more convinced than ever that the brain could adapt. It just needed more time. So he &lt;a href=&quot;http://www.cns.nyu.edu/~nava/courses/psych_and_brain/pdfs/Stratton_1897.pdf&quot;&gt;strapped himself in&lt;/a&gt; for longer, wearing his device for ~12 hours a day for eight days. After the third day he noticed some changes.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;It was becoming easier to follow a line in the field of sight and, continuing the line into this larger system of things, to know what it would lead to. The rooms beyond the one I was in, together with the scene out of doors, could be &lt;strong&gt;represented in harmonious relation&lt;/strong&gt; with what I was actually looking at. Such representations, however, were more or less a &lt;strong&gt;matter of voluntary effort&lt;/strong&gt;…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On the fourth day:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;By the fourth day the new experience had become even less trying. There was no sign of bodily discomfort, and for the first time during the experiment, &lt;strong&gt;when nine o’clock in the evening came I preferred to keep the glasses on&lt;/strong&gt;, rather than sit blindfolded — which had hitherto been chosen as a welcome relief.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On day five:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;When the doors were open I could walk through the entire house by visual guidance alone, without holding out my hands in front of me to warn in case of a misinterpretation of the sight-perception. For the first time, I dared to turn and sit down on a chair &lt;strong&gt;without beforehand assuring myself&lt;/strong&gt; with my hands that I had placed myself aright. My movements were of course still cautious and awkward.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Day six:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Movements of the head or of the body, which shifted the field of view, seemed now to be in entire keeping with the visual changes thus produced; the motion seemed to be toward that side on which objects entered the visual field, and not toward the opposite side, as the pre-experimental representation of the movement would have required. And when, with closed eyes, I rocked in my chair, the &lt;strong&gt;merely represented changes in the visual field persisted&lt;/strong&gt; with the same rhythmic variation of direction which they would have shown had I opened my eyes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Stratton didn’t just improved his hand-eye coordination. He began internalizing this new reality.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Like so many of of my CSC peers, I had to take 430 twice&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. The second time around was still a battle, but enough of the language’s principles had seeped into my consciousness that I made it through. And while there were plenty of moments filled with pure frustration, those occasional dopamine-laden epiphanies made everything worth it.&lt;/p&gt;

&lt;p&gt;Early in that same quarter our professor, Dr. Keen, shared with us his excitement over a language he’d been playing with during the summer. It had first-class functions, dynamic typing, and a &lt;strong&gt;huge&lt;/strong&gt; install base. His enthusiasm was met with a typical mix of chuckles, eye rolls, and silent indifference as he went on to explain all the unexpectedly nice things he’d discovered about this language that was so often written off in academia: JavaScript.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Anyone coming to a new language, let alone a new family of languages, is going to face an upside down world. It’s natural. For example, newcomers to JavaScript and Node.js might butt up against:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Prototypal inheritance.&lt;/li&gt;
  &lt;li&gt;Functional variable scope and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;this&lt;/code&gt; keyword.&lt;/li&gt;
  &lt;li&gt;Asynchronicity.&lt;/li&gt;
  &lt;li&gt;Callback pyramids.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When we hit these snags we tend to do one of three things. Allow me to stretch this metaphor a bit further.&lt;/p&gt;

&lt;h2 id=&quot;take-the-glasses-off&quot;&gt;Take the Glasses Off&lt;/h2&gt;

&lt;p&gt;You give up. You stop learning the new thing and go back to a stable reality. If that sounds condescending, know that I think this is &lt;strong&gt;the best&lt;/strong&gt; option in many situations. If you need to get something done quick, that’s hardly the time to explore a new technology. Stick with what you know. Be pragmatic.&lt;/p&gt;

&lt;p&gt;But plenty of people get to this stage, meet resistance, take the glasses off, and declare their new subject broken. &lt;em&gt;Node Sucks&lt;/em&gt;. &lt;em&gt;Ruby Sucks&lt;/em&gt;. &lt;em&gt;NoSQL Sucks&lt;/em&gt;. Articles of this ilk are scattered throughout space and time, and all but a rare few are written by people that have given up at &lt;a href=&quot;http://en.wikipedia.org/wiki/Four_stages_of_competence#The_four_stages&quot;&gt;unconscious incompetence&lt;/a&gt; out of impatience rather than pragmatism. Try not to be this person.&lt;/p&gt;

&lt;h2 id=&quot;add-a-second-pair-of-glasses&quot;&gt;Add a Second Pair of Glasses&lt;/h2&gt;

&lt;p&gt;That would certainly turn everything back upright. In Stratton’s case, it would look ridiculous, but how does it look in our JavaScript scenario? Maybe you don’t understand all these asynchronous callbacks in Node, so you start using &lt;a href=&quot;https://github.com/laverdet/node-fibers/&quot;&gt;fibers&lt;/a&gt;. Prototypal inheritance is confusing, so you pick up &lt;a href=&quot;https://github.com/jcoglan/js.class&quot;&gt;JS.Class&lt;/a&gt; or &lt;a href=&quot;http://coffeescript.org/&quot;&gt;CoffeeScript&lt;/a&gt;, something with a classical inheritance syntax. Are you nesting six anonymous callbacks and hate that all your code is so far to the right? &lt;a href=&quot;https://github.com/caolan/async/&quot;&gt;Async&lt;/a&gt; and &lt;a href=&quot;https://github.com/creationix/step/&quot;&gt;step&lt;/a&gt; have your back.&lt;/p&gt;

&lt;p&gt;To be clear, I am &lt;strong&gt;not&lt;/strong&gt; saying that these projects are bad and should be avoided. I think CoffeeScript can be great, and I use async constantly, but we need to recognize &lt;strong&gt;why&lt;/strong&gt; we’re using them. CoffeeScript is a great way to write clear, terse code and reduce the boilerplate that goes into the common patterns it abstracts away with new syntax. But using it to avoid learning how JavaScript works is a mistake. If you ever find yourself in a situation without your second pair of glasses (like say, the majority of Node modules) then you’re right back where you started, lost.&lt;/p&gt;

&lt;p&gt;Be conscious of why you’re adding new technologies to your toolbox. Avoid doing it to cover up a fundamental knowledge gap.&lt;/p&gt;

&lt;h2 id=&quot;leave-the-glasses-on&quot;&gt;Leave the Glasses On&lt;/h2&gt;

&lt;p&gt;Yes, this is the hardest path, but it’s ultimately the most rewarding. If you’re serious about &lt;a href=&quot;http://unicornfree.com/2012/why-blacksmiths-are-better-at-startups-than-you/&quot;&gt;mastering your craft&lt;/a&gt;, this is the only option. Push through and trust that your brain will adapt.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;In my defense, I didn’t &lt;em&gt;exactly&lt;/em&gt; fail the first time through. I had to bow out of all classes that quarter due to a serious illness. But in all honesty, I bet I would have failed anyway. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</content>
		</entry>
	
		<entry>
			<title>More Upfront, Less Available</title>
			<link href="http://imakewebthings.com/blog/more-upfront-less-available" />
			<updated>2012-06-25T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/more-upfront-less-available</id>
			<content type="html">&lt;p&gt;&lt;em&gt;&lt;strong&gt;Update:&lt;/strong&gt; Since the original posting, the numbers I specify have changed and will continue to change. Current rates and availability will always be up-to-date on my about page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I’ve updated my &lt;a href=&quot;/&quot;&gt;about page&lt;/a&gt; to included some no-nonsense information on availability and pricing. It’s a direct and transparent approach that I’ve been interested in adopting since hearing &lt;a href=&quot;http://samsoff.es&quot;&gt;Sam Soffes&lt;/a&gt; discuss it&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; on &lt;a href=&quot;http://theindustry.cc/2012/05/01/8-adobe-html5rocks-dialoggs-invites-and-making-cheddar/&quot;&gt;The Industry Radio Show&lt;/a&gt;. I’m excited to make this change. Here’s what’s new:&lt;/p&gt;

&lt;h2 id=&quot;upfront-rate&quot;&gt;Upfront Rate&lt;/h2&gt;

&lt;p&gt;$125/hr. $250/hr for PHP work&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. That’s it. Neither me nor my clients have to worry about playing the negotiation game. Instead we can focus on what services I can provide within their budget.&lt;/p&gt;

&lt;h2 id=&quot;minimum-commitment&quot;&gt;Minimum Commitment&lt;/h2&gt;

&lt;p&gt;20 hours minimum. This is rarely a problem, but projects big and small have overhead. I prefer to bill for coding tasks only. Four billable hours behind eight hours of project management and research quickly works against me.&lt;/p&gt;

&lt;h2 id=&quot;maximum-weekly-hours&quot;&gt;Maximum weekly hours&lt;/h2&gt;

&lt;p&gt;This is the biggest change. 20 hours of work per week maximum. I’ve been working full 40+ hour weeks since October of last year. It’s time for me to pull back and start down a new path. This will give me time to focus on a product I’m developing, as well as finish some longstanding projects: Move Back to the United States™ and Get Married™.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Sam’s hire page is no longer up since he’s working on his own app, &lt;a href=&quot;https://cheddarapp.com/&quot;&gt;Cheddar&lt;/a&gt;, full time. But you can still check out &lt;a href=&quot;https://github.com/samsoffes/hire.samsoff.es&quot;&gt;the GitHub repo&lt;/a&gt;. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;This is meant to dissuade work in a technology I loathe. I picked this up from somebody on a podcast, but I can’t remember which one or who said it. If anyone knows what I’m talking about please let me know. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</content>
		</entry>
	
		<entry>
			<title>Automating Tedium</title>
			<link href="http://imakewebthings.com/blog/automating-tedium" />
			<updated>2012-04-09T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/automating-tedium</id>
			<content type="html">&lt;p&gt;On a &lt;a href=&quot;http://shoptalkshow.com/episodes/011-with-jina-bolton/&quot;&gt;recent episode&lt;/a&gt; of &lt;a href=&quot;http://shoptalkshow.com&quot;&gt;ShopTalk Show&lt;/a&gt; Chris Coyier voiced his personal preference for using a suite of UI applications over running a bunch of shell commands in the terminal.&lt;/p&gt;

&lt;script src=&quot;http://api.html5media.info/1.1.5/html5media.min.js&quot;&gt;&lt;/script&gt;

&lt;audio src=&quot;http://s3.amazonaws.com/imakewebthings-blog/ShopTalk_011_Clip.mp3&quot; controls=&quot;controls&quot;&gt;&amp;nbsp;&lt;/audio&gt;

&lt;blockquote&gt;
  &lt;p&gt;I should say that I’m not afraid of it, I just prefer most things — like I use Sass all day long, right? I don’t want to go into the terminal, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd&lt;/code&gt; to where my thing is, and go &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sass --watch&lt;/code&gt; and then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--&lt;/code&gt; and then the stupid formats and all that stuff. And then every time I restart my computer I have to open it up and do it again. I would rather use something like &lt;a href=&quot;http://livereload.com&quot;&gt;LiveReload&lt;/a&gt; or &lt;a href=&quot;http://incident57.com/codekit/&quot;&gt;CodeKit&lt;/a&gt; that just automatically starts when I turn on my computer, it’s automatically watching those directories for changes. I prefer UIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s where I’m supposed to say, “Bullshit! Learn the command line,” and then check my d20 to see if the hit was critical. Except he’s right. Doing all that stuff &lt;strong&gt;is&lt;/strong&gt; annoying. Between CSS preprocessing, JavaScript transcompilation, image optimization, concatenation, minification, and source control, your average dev needs to launch a navy just to make their Hello World blink. Nobody wants to have to remember and type all this crap.&lt;/p&gt;

&lt;h2 id=&quot;another-option&quot;&gt;Another Option&lt;/h2&gt;

&lt;p&gt;I’m no command line junkie. Borderline competent, at best. Yet I find myself in projects that require something to happen in the command line. Spin up a node.js process. Connect to a local Mongo database. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rails c&lt;/code&gt;. There’s no fancy omnipotent Cocoa app that will manage these things for me. The good news: I don’t even try to remember it all.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;before&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'cd ~/Sites/imakewebthings.github.com'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;tab&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Jekyll'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'rvm 1.8.7'&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'jekyll --server'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;tab&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Sass'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'sass --style expanded --watch css:css'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;tab&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Git'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'git st'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'subl .'&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'open http://0.0.0.0:4000'&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'exit'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This is a &lt;a href=&quot;https://github.com/achiu/consular&quot;&gt;Consular&lt;/a&gt; script. The Consular script for this blog, as a matter of fact. Consular is a terminal automator written by &lt;a href=&quot;https://github.com/achiu&quot;&gt;Arthur Chiu&lt;/a&gt;. You create projects which are nothing more than a Ruby file like the one above. This file defines any number of terminal tabs and the processes to run within them. From then on you can just type a few words into the command line and the whole thing is executed. No more trying to remember the tedious crap.&lt;/p&gt;

&lt;p&gt;To install Consular:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem install consular&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Install the consular core for whatever terminal app you use. I use &lt;a href=&quot;http://www.iterm2.com/&quot;&gt;iTerm2&lt;/a&gt; so it’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem install consular-iterm&lt;/code&gt;. The project page has a list of all the supported cores and their corresponding gem names.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular init&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Open the newly created &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.consularc&lt;/code&gt; file and add a require statement for your core to the top. The project page for each core will have this snippet. For iTerm it’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;require 'consular/iterm'&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you can create projects with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular create projectname&lt;/code&gt;. Write the “Termfile” like the one above. Then you can launch the project with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular start projectname&lt;/code&gt;. Let’s take a look at that project definition from earlier, line by line, to see what it does.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;before&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'cd ~/Sites/imakewebthings.github.com'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Anything in a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;before&lt;/code&gt; block is executed immediately and at the beginning of every new tab creation. Since I may be anywhere in the file system when I run the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular start&lt;/code&gt; command, I want to make sure I go to the project directory. Many terminal apps also have a default setting to go to the home directory when creating new tabs rather than keep the location from the previous tab. There are settings to change this, but it’s good to know this annoyance is out of the way regardless.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;tab&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Jekyll'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'rvm 1.8.7'&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'jekyll --server'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you can believe it, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tab&lt;/code&gt; blocks create a new tab. You don’t have to name your tabs, but I prefer it. Inside that tab I switch to ruby 1.8.7 and start up &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki&quot;&gt;Jekyll&lt;/a&gt;, the static site generator that powers this blog.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;tab&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Sass'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'sass --style expanded --watch css:css'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Here is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sass&lt;/code&gt; watcher Chris brought up. For tabs that only have one command you don’t even need to place commands inside a block, you can just pass it the string to execute. For example: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tab 'tail error.log'&lt;/code&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;tab&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Git'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'git st'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Runs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git status&lt;/code&gt; just to see where things are. Since this tab doesn’t have a running process like the others, it’s also where I do any terminal work going forward. Because our original tab that everything started from is about to go away.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'subl .'&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#Opens project directory in Sublime Text 2&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'open http://0.0.0.0:4000/blog'&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'exit'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;It is in no way a requirement of a Consular script, but if I’m using it to create tabs I run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exit&lt;/code&gt; at the end. This closes the original tab. That original tab may be unnamed or named from a previously run script, and I no longer need or want it. Before exiting I launch anything that needs launching but doesn’t concern itself with the terminal. In this case, I open the local Jekyll instance in my default browser and open the project directory in &lt;a href=&quot;http://www.sublimetext.com/2&quot;&gt;Sublime Text 2&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;who-shouldnt-use-this&quot;&gt;Who Shouldn’t Use This&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If you’re a purely front-end developer&lt;/strong&gt;, you work on mostly static web projects, and &lt;em&gt;never&lt;/em&gt; need to touch the shell then by all means, grab CodeKit and &lt;a href=&quot;http://mac.github.com/&quot;&gt;GitHub for Mac&lt;/a&gt; and be happy. This is probably your ideal setup. If you can avoid using the command line altogether, that’s awesome. But keep reading. You may have reasons for using a terminal automator beyond your development projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you do everything in vim&lt;/strong&gt;, remote pair-program, have never sullied the hair on your neck with the edge of a razor, or otherwise spend &lt;strong&gt;a lot&lt;/strong&gt; of time on the command line then you want something more advanced. But if you fit this description, you already know about &lt;a href=&quot;http://tmux.sourceforge.net/&quot;&gt;tmux&lt;/a&gt; and &lt;a href=&quot;https://github.com/aziz/tmuxinator&quot;&gt;tmuxinator&lt;/a&gt; and stopped reading a long time ago.&lt;/p&gt;

&lt;h2 id=&quot;not-black-and-white&quot;&gt;Not Black and White&lt;/h2&gt;

&lt;p&gt;Here’s a false dichotomy for you. &lt;em&gt;Either you use the UI tools or you rock the command line.&lt;/em&gt; Keep this from creeping into your head. These tools don’t have to be used exclusive of each other. You can easily use something like Consular to launch a bunch of apps and quit the terminal altogether. Let’s take a look at my script for &lt;a href=&quot;http://imakewebthings.com/jquery-waypoints&quot;&gt;Waypoints&lt;/a&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;cd ~/Sites/waypoints/jquery&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;subl .&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;open http://local.jquery.waypoints.com/test&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;open http://github.com/imakewebthings/jquery-waypoints/issues&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;git st&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Aside from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git st&lt;/code&gt; I’m just launching applications. Two Chrome tabs and Sublime. If I didn’t use git from the command line this could just as easily end with…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;github&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# You've installed the GitHub for Mac command line tool, right?&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;exit&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I find this terminal-less ending appealing because it hints at what we’re &lt;strong&gt;really&lt;/strong&gt; doing with these scripts.&lt;/p&gt;

&lt;h2 id=&quot;come-for-the-terminal-automation-stay-for-the-context-switches&quot;&gt;Come for the Terminal Automation, Stay for the Context Switches&lt;/h2&gt;

&lt;p&gt;If there’s anything we can agree on as an industry it’s this: &lt;a href=&quot;http://www.joelonsoftware.com/articles/fog0000000022.html&quot;&gt;Context switches are bad&lt;/a&gt;.&lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; But even in the most optimal environment — free from interrupting phone calls, hour long “design meetings”, and shoulder-perched micromanagers — there will come a time when you need to switch contexts on purpose. Let’s look at a contrived but plausible day in the life of yours truly (computer activities only):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Wake up. Check email.&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;Work on &lt;em&gt;Client Project&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;Eat lunch. Check email.&lt;/li&gt;
  &lt;li&gt;Work on &lt;em&gt;Client Project&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;After dinner, fix a bug in Waypoints.&lt;/li&gt;
  &lt;li&gt;Make an improvement to a transition theme in deck.js.&lt;/li&gt;
  &lt;li&gt;Work on a draft of this blog post.&lt;/li&gt;
  &lt;li&gt;Check email.&lt;/li&gt;
  &lt;li&gt;Screw around. Facebook, games, read blogs, fantasy baseball, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You know what I do when I want to work on &lt;em&gt;Client Project&lt;/em&gt;, Waypoints, this blog, or any other coding project. But what about the other stuff? Each one of these items is a context switch, &lt;strong&gt;including the email and screwing around&lt;/strong&gt;. And every time I want to switch contexts I go through the same three steps, no matter the type of task.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Quit everything. By everything I mean every visible window. When I activate Exposé/Mission Control I just see background.&lt;sup id=&quot;fnref:3&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
  &lt;li&gt;Launch iTerm2.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular start contextname&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s right. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular start email&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;consular start dickaround&lt;/code&gt;. Now my day turns into a series of &lt;em&gt;Quit, Run Script, Do Work&lt;/em&gt;, &lt;em&gt;Quit, Run Script, Do Work&lt;/em&gt;, ad infinitum. That may sound boring or robotic, but I see it as relief for the brain. I don’t need to ask myself what programs and files to open. I just need to ask myself what I should be working on &lt;strong&gt;right now&lt;/strong&gt;. Then focus on doing that thing.&lt;/p&gt;

&lt;p&gt;This probably won’t help your brain get into flow with each switch — only doing the work will get you there — but having simple repeatable steps certainly makes the transition smoother and quicker. I dare you to give it a try — start small, one or two projects at first — then try to go back. I can’t.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;While they didn’t coin the phrase, perhaps the most important work on the subject of context switches and software development environments in general is &lt;a href=&quot;http://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439&quot;&gt;Peopleware&lt;/a&gt; by Tom DeMarco and Timothy Lister. I was lucky enough to have a teacher who made this required reading for intro Software Engineering courses. Go read it, now. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;I don’t want to get sidetracked on how to do email, but these usually get answered, deleted, or tagged and filed away in 15 minutes or less. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;I leave the programs that live in the taskbar or dock alone, such as Adium, Twitter, and Skype. I have one windowed program that I want to keep open across all contexts, and I keep it in a separate Space/Desktop for that reason: iTunes. &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</content>
		</entry>
	
		<entry>
			<title>Moving to GitHub Pages without F❤cking Up Email</title>
			<link href="http://imakewebthings.com/blog/github-pages-email" />
			<updated>2012-03-17T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/github-pages-email</id>
			<content type="html">&lt;p&gt;Things look different around here.  Two weeks ago I moved this site from a self-hosted WordPress install to &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki&quot;&gt;Jekyll&lt;/a&gt; running on &lt;a href=&quot;http://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt;.  But this isn’t about the redesign or the hosting move, it’s about the three days I spent silently bouncing email afterwards.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imakewebthings.com&lt;/code&gt; domain is registered through and was previously hosted on &lt;a href=&quot;http://asmallorange.com&quot;&gt;A Small Orange&lt;/a&gt;, which uses the cPanel site management software.  My email for the site is also hosted there as part of the package.  The root cause is my idiocy, but hopefully this page can provide clarity to the passing frustrated user hopelessly searching Google for answers.  Here’s how it went down.&lt;/p&gt;

&lt;h2 id=&quot;how-to-move-to-github-pages&quot;&gt;How to Move to GitHub Pages&lt;/h2&gt;

&lt;p&gt;Enough has been written on this topic over the years, so I won’t get into the details. It breaks down to:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create &lt;a href=&quot;https://github.com/imakewebthings/imakewebthings.github.com&quot;&gt;a repository&lt;/a&gt; on GitHub with the name of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;username.github.com&lt;/code&gt;.  Put your Jekyll powered site in this repository.  Once you push the site will be viewable at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://username.github.com&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Add &lt;a href=&quot;https://github.com/imakewebthings/imakewebthings.github.com/blob/master/CNAME&quot;&gt;a file&lt;/a&gt; named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CNAME&lt;/code&gt; to the root directory of this repository.  It is a text file that just contains one line, the domain name you wish to use.  In my case, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imakewebthings.com&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Change the DNS settings for your domain to point to GitHub’s servers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We’re concerned with the last step.  Here are &lt;a href=&quot;http://pages.github.com/#custom_domains&quot;&gt;the instructions&lt;/a&gt; on the GitHub Pages site (emphasis mine):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Next, you’ll need to visit your domain registrar or DNS host and add a record for your domain name. For a sub-domain like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www.example.com&lt;/code&gt; you would simply create a CNAME record pointing at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;charlie.github.com&lt;/code&gt;. If you are using a top-level domain like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;example.com&lt;/code&gt;, you must use an A record pointing to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;207.97.227.245&lt;/code&gt;. &lt;strong&gt;Do not use a CNAME record with a top-level domain, it can have adverse side effects on other services like email.&lt;/strong&gt; Many DNS services will let you set a CNAME on a TLD, even though you shouldn’t. Remember that it may take up to a full day for DNS changes to propagate, so be patient.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sweet.  I opened up cPanel to change the DNS records.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://s3.amazonaws.com/imakewebthings-blog/cpanel-domains.png&quot; alt=&quot;cPanel domain section, including Simple and Advanced DNS Zone Editor buttons&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The simple DNS editor doesn’t show the A record for top-level domains, so I went to the advanced editor.  The first DNS entry was an A record for the top-level pointing at my shared server IP.  I changed it to point to the GitHub IP address.  Several hours later the record change had started propogating and the site worked as expected.  So far, perfect.&lt;/p&gt;

&lt;p&gt;Three days later I received a Twitter DM that my email address was returning to sender with a warning, or worse, failing silently.&lt;/p&gt;

&lt;h2 id=&quot;what-went-wrong&quot;&gt;What Went Wrong?&lt;/h2&gt;

&lt;p&gt;The GitHub instructions don’t tell the whole story, nor should they, about all the things that could go wrong when making DNS changes.  The immediate lesson: It’s perfectly possible to screw up email on a domain without switching the TLD record to a CNAME &lt;strong&gt;if the MX record for that domain also points to the top-level record&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hold on,&lt;/em&gt; you say, &lt;em&gt;What are all these different record types?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Great question, voice in my head.  If you’ve managed DNS records before this is all 101 material. For folks like myself who until recently relied on other team members to deal with these matters, it’s foreign. To summarize:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;A Record&lt;/strong&gt;: The basic core of DNS.  It maps a nice, pretty URL to a messy IP address behind the scenes.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;CNAME&lt;/strong&gt;: A “Canonical Name” record. It acts as an alias, redirecting lookups to another record.  A common one is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www.tld.com&lt;/code&gt; pointing to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tld.com&lt;/code&gt;.  If a user navigates to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www.tld.com&lt;/code&gt; the DNS server will say, “Hey, go here instead.”&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;MX Record&lt;/strong&gt;: This record describes where to route SMTP mail traffic. It should point to wherever your email is hosted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you haven’t already guessed, my MX record for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imakewebthings.com&lt;/code&gt; domain was pointed to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;imakewebthings.com&lt;/code&gt; which was now resolving to the GitHub IP address instead of my old shared server that hosts the email.  Other hosts may point to a separate A record specifically for this purpose, but it’s worth checking. If you’re wondering why you don’t see the MX record listed, it’s because in cPanel &lt;strong&gt;MX records are not listed in the Advanced DNS Zone Editor.&lt;/strong&gt;  They’re in a separate page under the Mail section.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://s3.amazonaws.com/imakewebthings-blog/cpanel-mail.png&quot; alt=&quot;cPanel email section, including the MX Entry button&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;how-to-fix-it&quot;&gt;How to Fix It&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Keep the top level A record pointing to GitHub’s server.&lt;/li&gt;
  &lt;li&gt;Create a new A record for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mail.yourdomainhere.com&lt;/code&gt;.  If you already have a CNAME record for the mail subdomain, change it to an A record.  Point this record to your old host IP. If you don’t know it, look in the left sidebar of cPanel and click “expand stats.” It’s listed under Shared IP Address.&lt;/li&gt;
  &lt;li&gt;Change the MX entry to point to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mail.yourdomainhere.com&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Give it some time to propagate.  Several hours later you should start to see a steady stream of backed up messages.  Congratulations.  Now stop reading your email and get back to work.&lt;/p&gt;
</content>
		</entry>
	
		<entry>
			<title>Deck.js Post-mortem Quick Hits</title>
			<link href="http://imakewebthings.com/blog/deck-js-post-mortem-quick-hits" />
			<updated>2011-10-20T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/deck-js-post-mortem-quick-hits</id>
			<content type="html">&lt;p&gt;Two months ago marked the launch of &lt;a href=&quot;http://imakewebthings.github.com/deck.js&quot;&gt;deck.js&lt;/a&gt;, a jQuery frame­work for cre­at­ing &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; pre­sen­ta­tions. The next few days fol­lowed the same path as my &lt;a href=&quot;http://imakewebthings.com/blog/jquery-waypoints&quot;&gt;last open source ven­ture&lt;/a&gt;: A &lt;a href=&quot;http://forrst.com/posts/deck_js-N8l&quot;&gt;Forrst post&lt;/a&gt;. Spir­ited dis­cus­sion on &lt;a href=&quot;http://news.ycombinator.com/item?id=2916352&quot;&gt;Hacker News&lt;/a&gt;. A lot of eyes. At the time of this writ­ing deck.js is the 37th most watched JavaScript project on GitHub.&lt;/p&gt;

&lt;p&gt;The project has been and will con­tinue to be an absolute blast. Things are still young and chang­ing all the time, but here are a few of my thoughts so far:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;No going back&lt;/strong&gt;: This was my first full-on &lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot;&gt;&lt;span class=&quot;caps&quot;&gt;TDD&lt;/span&gt;/&lt;span class=&quot;caps&quot;&gt;BDD&lt;/span&gt;&lt;/a&gt; project. (Way­points tests were writ­ten post-launch.) I can­not imag­ine doing things any other way going for­ward. The ben­e­fits are immense: up-front &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; thrash­ing, reduc­ing unnec­es­sary &lt;span class=&quot;caps&quot;&gt;MVP&lt;/span&gt; fea­tures, catch­ing regres­sions, pro­mot­ing mod­u­lar­ity… I could go on for days. The biggest per­ceived “con”, increased devel­op­ment time, is more than erased by the time saved as a result of the pros. A project with any degree of com­plex­ity writ­ten by authors at all con­cerned with code qual­ity will benefit.&lt;/li&gt;

    &lt;li&gt;&lt;strong&gt;Between clients&lt;/strong&gt;: I devel­oped deck.js off and on over the course of a few months, in lulls between stretches of client work. Yet another advan­tage to &lt;span class=&quot;caps&quot;&gt;TDD&lt;/span&gt; is that it makes pick­ing up devel­op­ment eas­ier after weeks away from a project. Just fire up the tests, see what fails, and get to work. Over­all, this proved to be a great way to smooth out the nat­u­rally bumpy sched­ule that comes with free­lanc­ing. Plus build­ing a port­fo­lio of decent open-source projects leads to new clients, either directly through those libraries or as part of your over­all résumé.&lt;/li&gt;

    &lt;li&gt;&lt;strong&gt;You and I are not Marco Arment&lt;/strong&gt;: For months after &lt;a href=&quot;http://marco.org&quot;&gt;Marco&lt;/a&gt; opened a GitHub account it sat empty, no projects, but he had hun­dreds of fol­low­ers. &lt;em&gt;And for good rea­son&lt;/em&gt;. When you cre­ate &lt;a href=&quot;http://www.tumblr.com&quot;&gt;Tum­blr&lt;/a&gt; and &lt;a href=&quot;http://www.instapaper.com&quot;&gt;Instapa­per&lt;/a&gt; geeks are ready to look at any­thing you release until eter­nity. But you and I? Nobody is going to so much as peek at the source of our un-marketed projects. For three months deck.js lived on GitHub with­out any watch­ers. We can keep our project code out in the open, bro­ken, miles away from any­thing that could be called an alpha, with­out wor­ry­ing that any­body will use it let alone crit­i­cize it. So until you gar­ner the grav­i­tas of a Marco or pub­lish pub­lic doc­u­men­ta­tion and mar­ket­ing mate­r­ial, don’t fret over reveal­ing your source.&lt;/li&gt;

    &lt;li&gt;&lt;strong&gt;The project page is the project&lt;/strong&gt;: If your open source thing falls any­where under the umbrella of front-end web devel­op­ment it will be judged by the project page. When deck.js launched I made the mis­take of not pro­vid­ing a print stylesheet for the &lt;a href=&quot;http://imakewebthings.github.com/deck.js&quot;&gt;home­page&lt;/a&gt;. Inter­net com­menters deemed deck.js unprint­able, despite the fact that the actual library included sim­pli­fied black-and-white print styles sim­i­lar to &lt;a href=&quot;http://meyerweb.com/eric/tools/s5/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;S5&lt;/span&gt;&lt;/a&gt;. This was my bad. Most peo­ple will only look at the project page and judge on that alone. It’s bet­ter to spend the time sand­ing the cor­ners of your public-facing pages than try to explain to your users that they got it all wrong.&lt;/li&gt;
&lt;/ul&gt;</content>
		</entry>
	
		<entry>
			<title>jQuery Waypoints</title>
			<link href="http://imakewebthings.com/blog/jquery-waypoints" />
			<updated>2011-03-02T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/jquery-waypoints</id>
			<content type="html">&lt;p&gt;Last week I pushed a lit­tle jQuery plu­gin to GitHub called &lt;a href=&quot;http://imakewebthings.github.com/jquery-waypoints&quot; rel=&quot;external&quot;&gt;jQuery Way­points&lt;/a&gt; that gives devel­op­ers an easy hook into fir­ing a func­tion when users scroll to any given ele­ment.  Thanks to some love from the &lt;a href=&quot;http://forrst.com&quot;&gt;Forrst&lt;/a&gt; com­mu­nity and a brief stint in the Top 10 on &lt;a href=&quot;http://hackerne.ws/item?id=2255982&quot; rel=&quot;external&quot;&gt;Hacker News&lt;/a&gt;, it’s gained the atten­tion of a few eyes.  I’m just glad that &lt;em&gt;some­body&lt;/em&gt; found it use­ful. Now that I’ve had a chance to process the imme­di­ate feed­back and fix a bug or two, I’d like to look back on what I learned.&lt;/p&gt;

&lt;h2&gt;His­tory&lt;/h2&gt;

&lt;p&gt;Way­points started as a scrappy &lt;a href=&quot;http://mootools.net&quot; rel=&quot;external&quot;&gt;MooTools&lt;/a&gt; class that I wrote for a friend to use in one of his projects.  The code, aside from being a lit­tle gross, had the sole pur­pose of snap­ping the user’s scroll posi­tion to the top of a sec­tion when the user scrolled close enough to it.  I still don’t feel com­fort­able inter­rupt­ing a user’s nat­ural scroll to force them to a dif­fer­ent one, but the con­cept of using scroll prox­im­ity stuck with me.&lt;/p&gt;

&lt;h2&gt;Prior Art&lt;/h2&gt;

&lt;p&gt;Remy Sharp’s &lt;a href=&quot;http://remysharp.com/2009/01/26/element-in-view-event-plugin/&quot; rel=&quot;external&quot;&gt;inview&lt;/a&gt; plu­gin is another great way to tie user scrolling to events, but only con­cerns itself with two ele­ment posi­tions: enter­ing and leav­ing the view­port.  If those are the only ele­ment posi­tions you want to deal with, I still think inview is a supe­rior plugin.&lt;/p&gt;

&lt;h2&gt;GitHub = Pleasure&lt;/h2&gt;

&lt;p&gt;This was my first &lt;em&gt;real&lt;/em&gt; open source pub­lic project.  A lot of my career agency work has been for large clients that I prob­a­bly can’t even name under &lt;span class=&quot;caps&quot;&gt;NDA&lt;/span&gt;.  And my one &lt;a href=&quot;https://github.com/imakewebthings/mooswipe&quot; rel=&quot;external&quot;&gt;other pub­lic repos­i­tory&lt;/a&gt; is a MooTools port of some­body else’s &lt;a href=&quot;http://www.netcu.de/jquery-touchwipe-iphone-ipad-library&quot; rel=&quot;external&quot;&gt;orig­i­nal work&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://gitimmersion.com/&quot; rel=&quot;external&quot;&gt;Git Immer­sion&lt;/a&gt; is a great resource for any­one look­ing to get started using Git seri­ously.  Any­one who has ever taken the dive will tell you: there’s no going back. Once you’re com­fort­able with mov­ing between branches, com­mit­ting, and push­ing, &lt;a href=&quot;http://pages.github.com&quot; rel=&quot;external&quot;&gt;GitHub Pages&lt;/a&gt; are cake and a nat­ural place for project pages to live.&lt;/p&gt;

&lt;h2&gt;Doc­u­men­ta­tion = Important&lt;/h2&gt;

&lt;p&gt;Con­sid­er­ing I was 8800 miles away, I didn’t actu­ally &lt;em&gt;see&lt;/em&gt; it, but Kyle Neath’s &lt;a href=&quot;http://warpspire.com/talks/documentation/&quot; rel=&quot;external&quot;&gt;Doc­u­men­ta­tion is freak­ing awe­some&lt;/a&gt; deck really kicked me into giv­ing a much bet­ter project doc­u­men­ta­tion expe­ri­ence than I might have oth­er­wise.  I prob­a­bly spent as much time tweak­ing the word­ing and appear­ance of the docs as I did writ­ing the plu­gin.  Not only does it reduce fric­tion for the devel­oper try­ing to use Way­points, it reduces fric­tion for me in try­ing to answer ques­tions and sup­port it.&lt;/p&gt;

&lt;h2&gt;The Future&lt;/h2&gt;

&lt;p&gt;With the most recent release, I’ve fin­ished adding core func­tion­al­ity.  Writ­ing unit tests, fix­ing bugs as they come in, and expand­ing the plat­forms the plu­gin cov­ers will be the main focus in the near future. Way­points does what it does well enough and I’d pre­fer to keep it light.  I’ll be inter­ested to see if any­one uses it as a brick to build some­thing neat.  If you use Way­points and would like to share with me how you’re using it, &lt;a href=&quot;http://imakewebthings.com&quot;&gt;give me a shout&lt;/a&gt;.&lt;/p&gt;</content>
		</entry>
	
		<entry>
			<title>Bastard Child Selector</title>
			<link href="http://imakewebthings.com/blog/bastard-child-selector" />
			<updated>2010-10-25T00:00:00+00:00</updated>
			<id>http://imakewebthings.com/blog/bastard-child-selector</id>
			<content type="html">&lt;p&gt;The CSS child selector gets a bad rap.  Most web developers rarely give it a thought and favor instead the descendant selector.  But why?&lt;/p&gt;

&lt;h2&gt;What is the Child Selector?&lt;/h2&gt;

&lt;p&gt;The most simple answer: &lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s it, the greater-than symbol.  In a CSS selector it denotes a direct child and only a direct child.  A selector of &lt;code&gt;div &gt; p&lt;/code&gt; will match all &lt;code&gt;p&lt;/code&gt; elements that are direct children of a &lt;code&gt;div&lt;/code&gt; element.&lt;/p&gt;

&lt;p&gt;Contrast that with the &lt;strong&gt;descendant selector&lt;/strong&gt;, represented by a space.  A selector of &lt;code&gt;div p&lt;/code&gt; matches all &lt;code&gt;p&lt;/code&gt; elements that are descendants of &lt;code&gt;div&lt;/code&gt;, no matter how far down the DOM tree the &lt;code&gt;p&lt;/code&gt; exists.  Maybe the &lt;code&gt;p&lt;/code&gt; is inside an &lt;code&gt;li&lt;/code&gt; within a &lt;code&gt;ul&lt;/code&gt; within a &lt;code&gt;section&lt;/code&gt; within a &lt;code&gt;div&lt;/code&gt;?  Still matches.  The child selector would not.&lt;/p&gt;

&lt;h2&gt;Prior Art&lt;/h2&gt;

&lt;p&gt;Several articles have been published this year on CSS performance &amp;mdash; how browsers read CSS selectors and render elements.  Chris Coyier &lt;a href=&quot;http://css-tricks.com/efficiently-rendering-css/&quot; rel=&quot;external&quot;&gt;threw down&lt;/a&gt; in May with a rundown of best practices, and Jonathan Snook recently &lt;a href=&quot;http://snook.ca/archives/html_and_css/css-parent-selectors&quot; rel=&quot;external&quot;&gt;broached the subject&lt;/a&gt; with an explanation of why CSS doesn&amp;rsquo;t include a parent selector.  The meat of these recommendations come back to a &lt;a href=&quot;http://code.google.com/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors&quot;&gt;guide by Google&lt;/a&gt; and an aging but still relevant &lt;a href=&quot;https://developer.mozilla.org/en/Writing_Efficient_CSS&quot; rel=&quot;external&quot;&gt;guide by Dave Hyatt&lt;/a&gt; from his Netscape days.&lt;/p&gt;

&lt;p&gt;Read these articles, take in the lessons, and let&amp;rsquo;s look at&amp;hellip;&lt;/p&gt;

&lt;h2&gt;An Example&lt;/h2&gt;
&lt;style type=&quot;text/css&quot;&gt;
	.puffin-example {
		background:#ccc;
		color:#333 !important;
		padding:10px;
		font-size:14px !important;
		font-family:Helvetica, Arial, sans-serif !important;
		overflow:hidden;
		margin-bottom:16px;
	}
	
	.puffin-example &gt; p {
		margin:0 !important;
		padding:8px 0 !important;
	}
	
	.puffin-example &gt; h2 {
		font-size:24px !important;
		color:#000 !important;
		margin:0 !important;
		font-family:Helvetica, Arial, sans-serif !important;
		text-shadow:none !important;
	}
	
	.factoid {
		float:left;
		width:160px;
		padding:10px;
		font-size:12px;
		background:#eee;
		margin:8px 10px 10px 0;
	}
	
	.factoid h3 {
		color:#c00 !important;
		font-size:18px !important;
		margin:0 0 8px 0 !important;
		font-family:Helvetica, Arial, sans-serif !important;
		text-shadow:none !important;
	}
	
	.factoid p {
		margin:0 0 8px 0 !important;
	}
	
	.factoid a {
		display:block;
		margin:0;
		text-align:right;
		color:#08c !important;
		background:transparent !important;
	}
&lt;/style&gt;

&lt;section class=&quot;puffin-example&quot;&gt;
	&lt;h2&gt;Puffins&lt;/h2&gt;
	&lt;p&gt;Puffins are any of three small species of auk (or alcids) in the bird genus Fratercula with a brightly coloured beak during the breeding season. These are pelagic seabirds that feed primarily by diving in the water. They breed in large colonies on coastal cliffs or offshore islands, nesting in crevices among rocks or in burrows in the soil. Two species, the Tufted Puffin and Horned Puffin, are found in the North Pacific Ocean, while the Atlantic Puffin, is found in the North Atlantic Ocean.&lt;/p&gt;
	&lt;aside class=&quot;factoid&quot;&gt;
		&lt;h3&gt;Fun Fact&lt;/h3&gt;
		&lt;p&gt;The fresh heart of a puffin is eaten raw as a traditional Icelandic delicacy.&lt;/p&gt;
		&lt;a href=&quot;#&quot;&gt;Learn More&lt;/a&gt;
	&lt;/aside&gt;
	&lt;p&gt;All puffin species have predominantly black or black and white plumage, a stocky build, and large beaks. They shed the colourful outer parts of their bills after the breeding season, leaving a smaller and duller beak. Their short wings are adapted for swimming with a flying technique under water. In the air, they beat their wings rapidly (up to 400 times per minute) in swift flight, often flying low over the ocean&amp;rsquo;s surface.&lt;/p&gt;
&lt;/section&gt;

&lt;p&gt;&lt;small&gt;Content ripped straight from &lt;a href=&quot;http://en.wikipedia.org/wiki/Puffin&quot; rel=&quot;external&quot;&gt;Wikipedia&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;The source for the Fun Fact block might reasonably look like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;aside&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;factoid&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Fun Fact&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The fresh heart of a puffin is eaten raw as a traditional Icelandic delicacy.&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Learn More&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And the CSS:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;160px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#eee&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	
&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;h3&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#c00&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	
&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#08c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;From now on let&amp;rsquo;s try this:  Every time you would nonchalantly write a descendant selector, instead write it as a child selector by default.  A lot of the descendants we currently write could just as easily be childs, and in some of those cases you really &lt;em&gt;want&lt;/em&gt; them to be.  If after some time and thought you realize that a descendant selector is what you want, need, and intend, go ahead and change it.  Here is our revised CSS:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	
&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;h3&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	
&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;	&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The web development community retains the nasty habit of descendant selectors for one reason: IE6.  IE7+ and every other modern browser support the child selector.  While many shops out there have stopped &amp;ldquo;supporting&amp;rdquo; the ancient beast, years of ignoring the child selector have left their mark on our collective stylesheet writing standards. Changing this habit yields a few advantages.&lt;/p&gt;

&lt;h2&gt;Performance&lt;/h2&gt;

&lt;p&gt;If we focused on CSS rendering performance and rewrote our example by biblically following the Google and Mozilla articles, we would see:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;aside&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;factoid&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h3&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;factoid-header&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Fun Fact&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;factoid-content&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;The fresh heart of a puffin is eaten raw as a traditional Icelandic delicacy.&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;factoid-cta&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Learn More&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	
&lt;span class=&quot;nc&quot;&gt;.factoid-header&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	
&lt;span class=&quot;nc&quot;&gt;.factoid-content&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.factoid-cta&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Here we have a nasty case of &lt;a href=&quot;http://www.steveworkman.com/html5-2/standards/2009/classitis-the-new-css-disease/&quot; rel=&quot;external&quot;&gt;classitis&lt;/a&gt; weighing down the markup.  Without going into the details of what makes classitis so heinous, let&amp;rsquo;s discard this approach.&lt;/p&gt;

&lt;p&gt;If you read the performance articles you would know that the descendant selector will match the rightmost element, say our &lt;code&gt;a&lt;/code&gt; in &lt;code&gt;.factoid a&lt;/code&gt;, and look at &lt;em&gt;every element&lt;/em&gt; up the tree looking for &lt;code&gt;.factoid&lt;/code&gt; until it finds a match or hits the &lt;code&gt;body&lt;/code&gt;.  Using the child selector will only look one level up and stop if &lt;code&gt;.factoid&lt;/code&gt; isn&amp;rsquo;t found. This effects more than our factoid links.  The performance savings are realized for &lt;em&gt;every &lt;code&gt;a&lt;/code&gt; element in the document&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But here&amp;rsquo;s the deal: CSS performance is rarely an issue for modern websites.  If you&amp;rsquo;re building a static site, the speed of modern devices and browsers will cover up the more egregious selectors.  Web applications making constant and rapid DOM changes may see gains in slower handheld devices or older browsers. But there are better reasons to move towards more child selectors than just performance.&lt;/p&gt;

&lt;h2&gt;Preserving Defaults &amp;amp; Future Proofing&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s turn back to our example.  Maybe we&amp;rsquo;re building this site for a client.  The client swears factoids will follow this structure: Title, short sentence, link out.  Done.  In stone.  So we write the CSS in our original form using descendant selectors, ship it and everything is dandy.&lt;/p&gt;
&lt;p&gt;Six months later, the client decides they want to link up the word &amp;ldquo;Icelandic&amp;rdquo; to an article on Bj&amp;ouml;rk.  And this is what they see:&lt;/p&gt;

&lt;section class=&quot;puffin-example&quot;&gt;
	&lt;h2&gt;Puffins&lt;/h2&gt;
	&lt;p&gt;Puffins are any of three small species of auk (or alcids) in the bird genus Fratercula with a brightly coloured beak during the breeding season. These are pelagic seabirds that feed primarily by diving in the water. They breed in large colonies on coastal cliffs or offshore islands, nesting in crevices among rocks or in burrows in the soil. Two species, the Tufted Puffin and Horned Puffin, are found in the North Pacific Ocean, while the Atlantic Puffin, is found in the North Atlantic Ocean.&lt;/p&gt;
	&lt;aside class=&quot;factoid&quot;&gt;
		&lt;h3&gt;Fun Fact&lt;/h3&gt;
		&lt;p&gt;The fresh heart of a puffin is eaten raw as a traditional &lt;a href=&quot;#&quot;&gt;Icelandic&lt;/a&gt; delicacy.&lt;/p&gt;
		&lt;a href=&quot;#&quot;&gt;Learn More&lt;/a&gt;
	&lt;/aside&gt;
	&lt;p&gt;All puffin species have predominantly black or black and white plumage, a stocky build, and large beaks. They shed the colourful outer parts of their bills after the breeding season, leaving a smaller and duller beak. Their short wings are adapted for swimming with a flying technique under water. In the air, they beat their wings rapidly (up to 400 times per minute) in swift flight, often flying low over the ocean&amp;rsquo;s surface.&lt;/p&gt;
&lt;/section&gt;

&lt;p&gt;&lt;strong&gt;Woops.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll admit, this is an elementary example, and a problem we can easily foresee, but think about the implications when applied to larger layout elements.  Sure, your biggest client&amp;rsquo;s left sidebar may hold nothing but second-level navigation today, but who&amp;rsquo;s stopping it from holding a Twitter widget, two ad units, and a list of related posts down the road?  In our scenario the client has assured us that a Factoid structure will not change. The more realistic scenario: Nobody is thinking about these things.  They&amp;rsquo;re too concerned with how everything looks now.&lt;/p&gt;

&lt;p&gt;How many times have you found yourself writing something like this?&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#00c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#c00&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.factoid&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#00c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Avoiding this mess &amp;mdash; defining defaults, overriding them, and then re-overriding them again &amp;mdash; would have once been solved by adding a class to the link.  With our approach of using a child selector we avoid that extra markup cruft and preserve the defaults as we move down the DOM tree.  Along with the potential performance gains, I hope this is enough to get you to move away from lazily pressing the space key and give the child selector a chance.&lt;/p&gt;

&lt;h2&gt;Extra Tidbit&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;The ultimate test of perfectly preserved default styles?&lt;/em&gt;  Take all your main content and erase everything else.  All the layout structure: erase it. Just leave your naked content, then apply your main stylesheet.  Does it look exactly the same (fonts, margins, colors, etc.) as the in-page content, except now full width and aligned left?  Congratulations.  Personally, I&amp;rsquo;ve never been able to get there, but I keep aiming.&lt;/p&gt;</content>
		</entry>
	

</feed>
