<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Harry Wolff</title><description>Personal site of Harry Wolff (hswolff). Find articles on JavaScript, videos about code, and stories of my life.</description><link>https://hswolff.com/</link><item><title>Things I Don’t Like about Vue.js (as a React engineer)</title><link>https://hswolff.com/blog/things-i-dont-like-about-vuejs-as-a-react-engineer/</link><guid isPermaLink="true">https://hswolff.com/blog/things-i-dont-like-about-vuejs-as-a-react-engineer/</guid><pubDate>Tue, 27 Oct 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This blog post is a follow up from my last article &lt;a href=&quot;/blog/what-vuejs-does-better-than-react/&quot;&gt;What Vue.js Does Better Than React&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This article, instead of focusing on what Vue.js does better than React, will take the opposing perspective.&lt;/p&gt;
&lt;p&gt;Let&apos;s take a dive into all the things that I think React does better than Vue.js&lt;/p&gt;
&lt;p&gt;Notable preface: I&apos;ve used React professionally for the past 5 years, so it&apos;s obviously my UI framework of choice. I&apos;ve tried to take as close to an objective stance on these points, but I&apos;m sure you&apos;ll see my subjectivism poking through.&lt;/p&gt;
&lt;h2&gt;Table of contents&lt;/h2&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html&quot;&gt;Templates&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the biggest features of Vue.js, and frankly what is Vue.js&apos; biggest strength, is its template syntax to write UIs.&lt;/p&gt;
&lt;p&gt;After using React for 5 years, which is as close to plain JavaScript as you can get, having to learn another template syntax is not something that I want to bother with.&lt;/p&gt;
&lt;p&gt;In my career I&apos;ve learned: Mustache.js, Handlebars, Lodash&apos;s template syntax, Django syntax, and probably more that I&apos;ve forgotten. I don&apos;t want to learn yet another template syntax with Vue.js.&lt;/p&gt;
&lt;p&gt;Each template syntax has some similarities and some differences that gives me ever so much of a headache switching from one to another.&lt;/p&gt;
&lt;p&gt;Another thing that I don&apos;t like about template syntax is that it adds a layer of abstraction between when you write and what runs in the browser.&lt;/p&gt;
&lt;p&gt;With React you have &lt;a href=&quot;https://reactjs.org/docs/jsx-in-depth.html&quot;&gt;JSX which just compiles down to function calls&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// React in
&amp;lt;div title=&quot;Hello&quot;&amp;gt;Message: {message}&amp;lt;/div&amp;gt;;

// React out
React.createElement(div, { title: &apos;Hello&apos; }, &apos;Message: &apos; + message);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With Vue.js I have no idea what the templates compile down to.&lt;/p&gt;
&lt;p&gt;Both React and Vue.js only allow &lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#using-javascript-expressions&quot;&gt;JavaScript expressions&lt;/a&gt; in their templates, which makes sense given the constraints of JavaScript, but where things get confusing for me with Vue.js is that &lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#javascript-expressions&quot;&gt;there’s only access to a subset of globals&lt;/a&gt; inside expressions. I&apos;m sure there&apos;s a good reason for that, but having to keep in mind that Vue.js templates are not simply JavaScript adds a layer of complexity I&apos;d rather do without.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#directives&quot;&gt;Directives&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Directives is the killer feature of Vue.js. It&apos;s what makes their templates so powerful.&lt;/p&gt;
&lt;p&gt;However.&lt;/p&gt;
&lt;p&gt;Directives are effectively an API you have to learn to use Vue.js templates efficiently. Compared to Angular.js (which I used way back in the day) &lt;a href=&quot;https://v3.vuejs.org/api/directives.html&quot;&gt;the list of Vue.js directives&lt;/a&gt; are pretty small, however it&apos;s an added layer of complexity required to use Vue.js efficiently.&lt;/p&gt;
&lt;p&gt;This is further exacerbated by the flexibility Vue.js bestows directives, which itself comes with additional complexity.&lt;/p&gt;
&lt;p&gt;There are &lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#arguments&quot;&gt;directive arguments&lt;/a&gt;, that can have &lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#dynamic-arguments&quot;&gt;dynamic arguments&lt;/a&gt;, and then there are &lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#modifiers&quot;&gt;directive modifiers&lt;/a&gt; (which I did hold up as a strength in my first blog post, but it comes at the cost of additional complexity)!&lt;/p&gt;
&lt;p&gt;Most of the syntax for directives aren&apos;t terrible, but I do find the syntax for &lt;a href=&quot;https://v3.vuejs.org/api/directives.html#v-for&quot;&gt;v-for directives&lt;/a&gt; to be very un-JavaScript. They&apos;re much closer to Python than anything else, which seems weird to include in a JavaScript framework.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/component-registration.html#module-systems&quot;&gt;Components&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is a nitpick, but one that reinforces my template point.&lt;/p&gt;
&lt;p&gt;Since Vue.js is largely a template driven framework, when you extend it with custom components, you need to tell the Vue.js template compiler about the components you&apos;re using.&lt;/p&gt;
&lt;p&gt;This results in a lot of duplicate code, that just looks completely superfluous to me.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Import your components as you normally would with ES Modules
import ComponentA from &apos;./ComponentA&apos;;
import ComponentC from &apos;./ComponentC&apos;;

export default {
  components: {
    // Register them with the template compiler
    ComponentA,
    ComponentC,
  },
  // Then finally use them in your template
  template: `
		&amp;lt;ComponentA /&amp;gt;
	`,
};
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/component-custom-events.html&quot;&gt;Custom Events&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Aside from templates, custom events are one of the biggest differences between Vue.js and React.&lt;/p&gt;
&lt;p&gt;Everything in React is a component and a prop (to almost an unhealthy degree). When you want a child React component to communicate to a parent component you pass down a function that the child component can call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function Parent() {
  const onClick = () =&amp;gt; alert(&apos;hello!&apos;);
  return &amp;lt;Child onClick={onClick} /&amp;gt;;
}

function Child({ onClick }) {
  return &amp;lt;button onClick={onClick}&amp;gt;Click me!&amp;lt;/button&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However the way to do this in Vue.js is with events:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const ParentComponent = {
  components: { ChildComponent },
  template: `&amp;lt;ChildComponent @greeting=&quot;alert(&apos;hello&apos;)&quot; /&amp;gt;`,
};

const ChildComponent = {
  emits: [&apos;greeting&apos;],
  template: `&amp;lt;button @click=&quot;$emit(&apos;greeting&apos;)&quot;&amp;gt;Click me!&amp;lt;/button&amp;gt;`,
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Honestly I&apos;m not terribly sure how I feel about using events as a way for children to communicate up.&lt;/p&gt;
&lt;p&gt;When I used events with Angular.js it was horrible as there was no concrete contract between what events were emitted and what were being listened to.&lt;/p&gt;
&lt;p&gt;However Vue.js mitigates that issue with tooling to make sure that when some parent tries to listen to an event the component actually emits that event.&lt;/p&gt;
&lt;p&gt;Without that tooling I think Vue.js would fall prey to the same issues as Angular.js but it&apos;s Vue.js&apos; excellent tooling that truly saves the day here.&lt;/p&gt;
&lt;p&gt;That being said, React&apos;s function passing via props works just as well and is in my opinion even more robust.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/events.html#method-event-handlers&quot;&gt;Method Event Handlers&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Related to custom events is how Vue.js attaches event handlers into their templates. It&apos;s one of my most despised mechanisms: string references!&lt;/p&gt;
&lt;p&gt;When you reference a method in a Vue.js template you pass in the name of the function as a string:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;button @click=&quot;greet&quot;&amp;gt;Greet&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which...I&apos;ve been bit so bad in the past when using string references.&lt;/p&gt;
&lt;p&gt;However like above, the saving grace here is Vue.js&apos; tooling will catch any silly typos. However it&apos;s a pattern I&apos;ve grown to greatly dislike and would prefer not to use again.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/reactivity.html&quot;&gt;Reactivity&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Most of the magic of Vue.js comes from its reactivity library. Its what gives Vue.js the ability to efficiently and quickly update UI when data changes. It reminds me greatly of &lt;a href=&quot;https://mobx.js.org/README.html&quot;&gt;MobX&lt;/a&gt;, but built-in to Vue.js and tailored for its needs.&lt;/p&gt;
&lt;p&gt;However both MobX and Vue.js&apos; Reactivity comes with trade-offs, where you have to consider the implementation details of Reactivity when using it in components.&lt;/p&gt;
&lt;p&gt;For example when creating a reactive object you wrap the object with the &lt;code&gt;reactive&lt;/code&gt; function. However when you want to use a primitive value you wrap it in &lt;code&gt;ref&lt;/code&gt; and it acts very similar to React&apos;s &lt;code&gt;useRef&lt;/code&gt; hook.&lt;/p&gt;
&lt;p&gt;If you want to destructure a &lt;code&gt;reactive&lt;/code&gt; object you need to wrap it in &lt;code&gt;toRefs(reactiveObject)&lt;/code&gt; to make sure you don&apos;t lose the reactive bindings. Which is only needed due to how reactivity works in Vue.js (with Proxy&apos;s).&lt;/p&gt;
&lt;p&gt;For primitive ref values Vue.js will &lt;a href=&quot;https://v3.vuejs.org/guide/reactivity-fundamentals.html#ref-unwrapping&quot;&gt;automatically unwrap the ref values in templates&lt;/a&gt;, which is nice and helpful, but produces inconsistent usages of ref values.&lt;/p&gt;
&lt;p&gt;In templates you don&apos;t have to unwrap, but in the component JavaScript you need to unwrap. This added context switch seems un-necessary to me and confusing at first glance.&lt;/p&gt;
&lt;p&gt;For common use cases I&apos;m sure these edge cases are seldom felt, but I&apos;m curious how it scales.&lt;/p&gt;
&lt;p&gt;This of course is opposed to React&apos;s almost too simple &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useRef&lt;/code&gt; which just return setter functions and a consistent ref-object interface respectively. Perhaps React&apos;s API is too simple as it pushes most of the behavior on the end-developer, but at least there&apos;s no magic, and that&apos;s what I care about most nowadays.&lt;/p&gt;
&lt;h2&gt;Video&lt;/h2&gt;
&lt;p&gt;Like every post, I have an accompanying video to watch as well:&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/zuLR3KcxIOY&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;h2&gt;Wrap-up&lt;/h2&gt;
&lt;p&gt;It shouldn&apos;t be any surprise that I prefer React&apos;s way of doing things more than Vue.js.&lt;/p&gt;
&lt;p&gt;Ultimately the difference comes down to my dislike for how much Vue.js does on my behalf. I prefer to have access to the raw functions and methods to completely control my UI - which React provides.&lt;/p&gt;
&lt;p&gt;React isn&apos;t without its share of quirks, but I do find React&apos;s quirks to at least be clear. There&apos;s very few layers of indirection between what I wrote and what React does. (Ignoring the dark magic that is the react-reconciler library and god help anyone who tries to debug stack traces within those depths).&lt;/p&gt;
&lt;p&gt;It&apos;s hard to sit here and not say that React is better, because I do personally think React is better - for me! If Vue.js tickles your fancy better then keep using Vue.js! My only hope here is to highlight the differences between Vue.js and React and why React remains my preferred choice for a UI library.&lt;/p&gt;
</content:encoded></item><item><title>What Vue.js Does Better Than React</title><link>https://hswolff.com/blog/what-vuejs-does-better-than-react/</link><guid isPermaLink="true">https://hswolff.com/blog/what-vuejs-does-better-than-react/</guid><pubDate>Mon, 19 Oct 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve been a React engineer for the past 5 years. I love React. I love making React applications. I think it&apos;s one of the best UI frameworks available right now.&lt;/p&gt;
&lt;p&gt;However, there are a few competitors in this space. One of the biggest is &lt;a href=&quot;https://vuejs.org/&quot;&gt;Vue.js&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&apos;ve played around with Vue.js a little bit in the past but I figured it was way past due to do a deep dive into how Vue.js works, and how it makes my life as a UI engineer easy.&lt;/p&gt;
&lt;p&gt;After delving deep into the Vue.js docs and playing around with Vue.js (note: I am in no way a Vue.js expert) I was shocked to find myself liking the way Vue.js did some things better than React.&lt;/p&gt;
&lt;p&gt;Ultimately I hope that React &lt;s&gt;steals&lt;/s&gt; is inspired by these things that Vue.js does and starts doing them as well.&lt;/p&gt;
&lt;h2&gt;Table of contents&lt;/h2&gt;
&lt;h2&gt;Different Philosophies&lt;/h2&gt;
&lt;p&gt;One of the key differences between Vue.js and React is how they market and refer to themselves.&lt;/p&gt;
&lt;p&gt;Taken straight from their home pages, React describes itself as &quot;a JavaScript &lt;strong&gt;library&lt;/strong&gt; for building user interfaces&quot; whereas Vue.js describes itself as &quot;progressive JavaScript &lt;strong&gt;framework&lt;/strong&gt;&quot; (emphasis mine).&lt;/p&gt;
&lt;p&gt;React is a library, Vue.js is a framework. I think in many ways that is the underlying reason for the difference in how and why each UI framework does the things it does.&lt;/p&gt;
&lt;p&gt;I wanted to highlight this so you keep it in mind while you read this post. Frameworks are historically more comprehensive and exhaustive in what they provide and require, whereas libraries are slimmer and do less, but what they do focus on they do extremely well.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/single-file-component.html&quot;&gt;Single File Components&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Both Vue.js and React have components as a building block to create your UI.&lt;/p&gt;
&lt;p&gt;Components are commonly comprised of 3 parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UI (HTML)&lt;/li&gt;
&lt;li&gt;Behavior (JavaScript)&lt;/li&gt;
&lt;li&gt;Appearance (CSS)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Vue.js has their concept of a &quot;Single File Component&quot; which is an out of the box way to write components that covers all 3 parts.&lt;/p&gt;
&lt;p&gt;Here&apos;s what it looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;p&amp;gt;{{ greeting }} World!&amp;lt;/p&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
  module.exports = {
    data() {
      return {
        greeting: &apos;Hello&apos;,
      };
    },
  };
&amp;lt;/script&amp;gt;

&amp;lt;style scoped&amp;gt;
  p {
    font-size: 2em;
    text-align: center;
  }
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You don&apos;t have to be a Vue.js engineer to understand what&apos;s going on here.&lt;/p&gt;
&lt;p&gt;React components include UI and Behavior out of the box, but style is very much kept out of the equation:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import React, { useState } from &apos;react&apos;;

function Button() {
  const [count, setCount] = useState(0);

  return (
    &amp;lt;button onClick={() =&amp;gt; setCount(count + 1)}&amp;gt;
      Current count: {count}
      &amp;lt;br /&amp;gt;
      Click me
    &amp;lt;/button&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Of course React has a very rich community so if you do want to include styles you can easily reach for &lt;a href=&quot;https://emotion.sh/docs/introduction&quot;&gt;Emotion&lt;/a&gt; or &lt;a href=&quot;https://styled-components.com/&quot;&gt;Styled Components&lt;/a&gt; and they will fill the Style hole, but:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It&apos;s not built in&lt;/li&gt;
&lt;li&gt;You have to know these libraries exist to use them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As opposed to Vue.js where it&apos;s there, for free, by default.&lt;/p&gt;
&lt;h2&gt;Officially Supported Related Libraries&lt;/h2&gt;
&lt;p&gt;Any sufficiently large and complex UI application requires two additional pieces of functionality to support their large size:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Router&lt;/li&gt;
&lt;li&gt;State Management&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Vue.js has officially supported libraries that cover both those use cases, &lt;a href=&quot;https://router.vuejs.org/&quot;&gt;Vue Router and&lt;/a&gt; &lt;a href=&quot;https://vuex.vuejs.org/&quot;&gt;Vuex&lt;/a&gt; respectively.&lt;/p&gt;
&lt;p&gt;These libraries are explicitly mentioned on the Vue.js docs page and they are developed and maintained alongside Vue.js core. That&apos;s simply phenomenal.&lt;/p&gt;
&lt;p&gt;It gives new Vue.js engineers a clear path towards a solution to their problems and gives them the confidence that these libraries are built to last so they can be confident when choosing them.&lt;/p&gt;
&lt;p&gt;Having first-party supported libraries doesn&apos;t limit community solutions, but it does provide a go-to solution for new comers.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/style-guide/&quot;&gt;Style Guide&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Uh, I want React to have this yesterday. Before you even read this section click the link and browse around Vue.js&apos; style guide.&lt;/p&gt;
&lt;p&gt;It answers so many questions newcomers to Vue.js may have. It provides best practices and guidelines on how to write &quot;proper&quot; and approachable Vue.js applications.&lt;/p&gt;
&lt;p&gt;It shares and codifies battle tested and community vetted best practices and patterns.&lt;/p&gt;
&lt;p&gt;To top it all off - it&apos;s maintained and supported by Vue.js itself! Terrific!&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;%5Bhttps://v3.vuejs.org/guide/class-and-style.html#binding-html-classes%5D(https://v3.vuejs.org/guide/class-and-style.html#binding-html-classes)&quot;&gt;Class and Style Bindings&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As mentioned above Vue.js has built in support for styling. Further than that Vue.js essentially has the library &lt;a href=&quot;https://github.com/JedWatson/classnames&quot;&gt;classNames&lt;/a&gt; built-in.&lt;/p&gt;
&lt;p&gt;Classnames is a terrific library for easily concatenating and dynamically constructing CSS classnames that should be applied to an HTML element.&lt;/p&gt;
&lt;p&gt;In React land you&apos;d have to know this library exists, and then install it.&lt;/p&gt;
&lt;p&gt;In Vue.js it&apos;s just another built-in feature. &lt;a href=&quot;https://v3.vuejs.org/guide/class-and-style.html#object-syntax&quot;&gt;From the docs&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;Given a Vue.js template like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div
  class=&quot;static&quot;
  :class=&quot;{ active: isActive, &apos;text-danger&apos;: hasError }&quot;
&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And data like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;data() {
  return {
    isActive: true,
    hasError: false
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting UI will be:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;static active&quot;&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Having this built in is awesome.&lt;/p&gt;
&lt;p&gt;Vue.js goes even further with their support for inline styles. Vue.js, like React, supports inline styles, however where Vue.js outshines React is its ability to auto prefix CSS that needs it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/class-and-style.html#auto-prefixing&quot;&gt;From the docs:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When you use a CSS property that requires vendor prefixes in :style, for example transform, Vue will automatically detect and add appropriate prefixes to the applied styles.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Truly shows the strength of being a framework and controlling your own template syntax.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/component-slots.html#slot-content&quot;&gt;Slots&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Everything in React is a prop.&lt;/p&gt;
&lt;p&gt;If you want to render multiple arbitrary children in a React component then you just add more props:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function Nav({ left, right }) {
  return (
    &amp;lt;nav&amp;gt;
      &amp;lt;div className=&quot;left&quot;&amp;gt;{left}&amp;lt;/div&amp;gt;
      &amp;lt;div className=&quot;right&quot;&amp;gt;{right}&amp;lt;/div&amp;gt;
    &amp;lt;/nav&amp;gt;
  );
}

function App() {
  return (
    &amp;lt;main&amp;gt;
      &amp;lt;Nav left={&amp;lt;Logo /&amp;gt;} right={&amp;lt;UserDropdown /&amp;gt;} /&amp;gt;
    &amp;lt;/main&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works fine but it&apos;s a tad awkward, especially if the content inside the props gets large.&lt;/p&gt;
&lt;p&gt;Vue.js takes a different approach via Slots, and I think it&apos;s API is a little more cleaner.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- A Vue.js component template named &quot;base-layout&quot; --&amp;gt;
&amp;lt;div class=&quot;container&quot;&amp;gt;
  &amp;lt;header&amp;gt;
    &amp;lt;slot name=&quot;header&quot;&amp;gt;&amp;lt;/slot&amp;gt;
  &amp;lt;/header&amp;gt;
  &amp;lt;main&amp;gt;
    &amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;
  &amp;lt;/main&amp;gt;
  &amp;lt;footer&amp;gt;
    &amp;lt;slot name=&quot;footer&quot;&amp;gt;&amp;lt;/slot&amp;gt;
  &amp;lt;/footer&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;!-- When &quot;base-layout&quot; is used --&amp;gt;
&amp;lt;base-layout&amp;gt;
  &amp;lt;template v-slot:header&amp;gt;
    &amp;lt;h1&amp;gt;Here might be a page title&amp;lt;/h1&amp;gt;
  &amp;lt;/template&amp;gt;

  &amp;lt;template v-slot:default&amp;gt;
    &amp;lt;p&amp;gt;A paragraph for the main content.&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;And another one.&amp;lt;/p&amp;gt;
  &amp;lt;/template&amp;gt;

  &amp;lt;template v-slot:footer&amp;gt;
    &amp;lt;p&amp;gt;Here&apos;s some contact info&amp;lt;/p&amp;gt;
  &amp;lt;/template&amp;gt;
&amp;lt;/base-layout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Vue.js uses Slots (which is inspired by the Web Components spec draft) to clearly denote where content goes inside a component.&lt;/p&gt;
&lt;p&gt;Something that Vue.js does repeatedly is provide shorthand for common tasks. In this case, the above example can be abridged with the Slot shorthand:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;base-layout&amp;gt;
  &amp;lt;template #header&amp;gt;
    &amp;lt;h1&amp;gt;Here might be a page title&amp;lt;/h1&amp;gt;
  &amp;lt;/template&amp;gt;

  &amp;lt;template #default&amp;gt;
    &amp;lt;p&amp;gt;A paragraph for the main content.&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;And another one.&amp;lt;/p&amp;gt;
  &amp;lt;/template&amp;gt;

  &amp;lt;template #footer&amp;gt;
    &amp;lt;p&amp;gt;Here&apos;s some contact info&amp;lt;/p&amp;gt;
  &amp;lt;/template&amp;gt;
&amp;lt;/base-layout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/template-syntax.html#modifiers&quot;&gt;Directive Modifiers&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Vue.js has this feature called Directive Modifiers that I think are really really cool.&lt;/p&gt;
&lt;p&gt;Before I can talk about Directive Modifiers let me give you a quick pitch on what a Directive is.&lt;/p&gt;
&lt;p&gt;Directives are &quot;special attributes with the &lt;code&gt;v-&lt;/code&gt; prefix&quot; which you use inside Vue.js templates.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A directive&apos;s job is to reactively apply side effects to the DOM when the value of its expression changes&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// If &quot;seen&quot; variable is false then this p tag is not rendered
&amp;lt;p v-if=&quot;seen&quot;&amp;gt;Now you see me&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&apos;s directives for event handlers:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- full syntax --&amp;gt;
&amp;lt;a v-on:click=&quot;doSomething&quot;&amp;gt; ... &amp;lt;/a&amp;gt;

&amp;lt;!-- shorthand --&amp;gt;
&amp;lt;a @click=&quot;doSomething&quot;&amp;gt; ... &amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;https://v3.vuejs.org/api/directives.html&quot;&gt;And there&apos;s many more Directives.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Directives also support modifiers.&lt;/p&gt;
&lt;p&gt;It&apos;s a very developer friendly way to perform common tasks with common directives.&lt;/p&gt;
&lt;p&gt;For event handler directives (&lt;code&gt;v-on&lt;/code&gt;) there&apos;s a whole slew of modifiers:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- the click event&apos;s propagation will be stopped --&amp;gt;
&amp;lt;a @click.stop=&quot;doThis&quot;&amp;gt;&amp;lt;/a&amp;gt;

&amp;lt;!-- the submit event will no longer reload the page --&amp;gt;
&amp;lt;form @submit.prevent=&quot;onSubmit&quot;&amp;gt;&amp;lt;/form&amp;gt;

&amp;lt;!-- modifiers can be chained --&amp;gt;
&amp;lt;a @click.stop.prevent=&quot;doThat&quot;&amp;gt;&amp;lt;/a&amp;gt;

&amp;lt;!-- just the modifier --&amp;gt;
&amp;lt;form @submit.prevent&amp;gt;&amp;lt;/form&amp;gt;

...and more!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you wanted to do this in React you&apos;d either make a helper function or a custom component. Which is fine, but doesn&apos;t feel as clean compared to directive modifiers.&lt;/p&gt;
&lt;p&gt;I am curious if someone could make a Babel JSX superset so you could write code like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;form onSubmit.prevent={onSubmit} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And it would transform to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;React.createElement(form, { onSubmit: preventWrapper(onSubmit) });
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;s not in the ethos of React, but I still think it&apos;s a super neat productivity win.&lt;/p&gt;
&lt;p&gt;There&apos;s many more Vue.js modifiers. Some of the coolest ones are &lt;a href=&quot;https://v3.vuejs.org/guide/events.html#key-modifiers&quot;&gt;key modifiers&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- only call `submit()` when the `key` is `Enter` --&amp;gt;
&amp;lt;input @keyup.enter=&quot;submit&quot; /&amp;gt;

&amp;lt;input @keyup.page-down=&quot;onPageDown&quot; /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Very, very cool.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/forms.html#basic-usage&quot;&gt;Form Input Bindings&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;v-model&lt;/code&gt; directive has a really interesting characteristic when binding data to form input elements.&lt;/p&gt;
&lt;p&gt;From the docs, v-model internally uses different properties and emits different events for different input elements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;text and textarea elements use &lt;code&gt;value&lt;/code&gt; property and &lt;code&gt;input&lt;/code&gt; event;&lt;/li&gt;
&lt;li&gt;checkboxes and radiobuttons use &lt;code&gt;checked&lt;/code&gt; property and &lt;code&gt;change&lt;/code&gt; event;&lt;/li&gt;
&lt;li&gt;select fields use &lt;code&gt;value&lt;/code&gt; as a prop and &lt;code&gt;change&lt;/code&gt; as an event.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What&apos;s great about this is you don&apos;t need to care about how the data is synced, just that it&apos;s taken care of for you.&lt;/p&gt;
&lt;p&gt;Let&apos;s compare how React would do these bindings and how Vue.js does it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Input
////////

// React
&amp;lt;input type=&quot;input&quot; value={message} onChange={onChange} /&amp;gt;

// Vue.js
&amp;lt;input type=&quot;input&quot; v-model=&quot;message&quot; /&amp;gt;

// Checkboxes and Radiobuttons
////////

// React
&amp;lt;input type=&quot;checkbox&quot; checked={message != null} onChange={onChange} /&amp;gt;

// Vue.js
&amp;lt;input type=&quot;checkbox&quot; v-model=&quot;message&quot; /&amp;gt;

// Select
////////

// React
&amp;lt;select value={message} onChange={onChange}&amp;gt;
	&amp;lt;option&amp;gt;A&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;

// Vue.js
&amp;lt;select v-model=&quot;message&quot;&amp;gt;
	&amp;lt;option&amp;gt;A&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Detecting a pattern here?&lt;/p&gt;
&lt;p&gt;Now, one thing I will say in React&apos;s defense is that React encourages (and requires) you to learn how the data is actually set and how it changes. Which means that if you were to ever write a form with Vanilla JS you&apos;d have a lot more knowledge on how it works and be able to code it correctly. As opposed to Vue.js which just abstracts away all those quirks for you.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/custom-directive.html&quot;&gt;Custom Directives&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Like any good framework you can create your own custom directives in Vue.js.&lt;/p&gt;
&lt;p&gt;Vue.js does note that &quot;the primary form of code reuse and abstraction is components&quot; however one of the best examples of why a custom directive may be better is with their custom &lt;code&gt;v-focus&lt;/code&gt; directive to automatically focus an input element on mount:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const app = Vue.createApp({})
// Register a global custom directive called `v-focus`
app.directive(&apos;focus&apos;, {
  // When the bound element is mounted into the DOM...
  mounted(el) {
    // Focus the element
    el.focus()
  }
})

&amp;lt;input v-focus /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In React you&apos;d probably write a custom component to accomplish the same thing, which seems a little heavy for such a light task.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://v3.vuejs.org/guide/typescript-support.html&quot;&gt;Written in TypeScript&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Last but not least, Vue.js was recently rewritten from the ground up in TypeScript.&lt;/p&gt;
&lt;p&gt;This means their TypeScript support is first-class as the framework itself is written in TypeScript.&lt;/p&gt;
&lt;p&gt;Ultimately it doesn&apos;t really matter what React is written in, and I don&apos;t think it makes that much of a difference, but it&apos;s still a small little thing that was nice to see Vue.js have.&lt;/p&gt;
&lt;h2&gt;Video&lt;/h2&gt;
&lt;p&gt;I&apos;ve expanded on these thoughts in video form as well! Feel free to watch if you&apos;re interested:&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/RFlQ8HP8Tr4&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;h2&gt;Closing Thoughts&lt;/h2&gt;
&lt;p&gt;After all that am I going to abandon React and start using Vue.js exclusively? No. I still very much enjoy the &quot;library-ness&quot; of React and frankly I&apos;m already very proficient at writing React applications.&lt;/p&gt;
&lt;p&gt;However I would love to see React grab some inspiration from Vue.js and incorporate some of these great ideas into React. If I had to choose just one from this list it&apos;s absolutely the style guide. I would love to see React have an officially supported and maintained style guide.&lt;/p&gt;
&lt;p&gt;Hopefully I&apos;ve opened your eyes to some things that you didn&apos;t know Vue.js did! I was certainly surprised to find myself really enjoying the way Vue.js did things!&lt;/p&gt;
</content:encoded></item><item><title>My Tech Stack (2020 Edition)</title><link>https://hswolff.com/blog/my-tech-stack-2020-edition/</link><guid isPermaLink="true">https://hswolff.com/blog/my-tech-stack-2020-edition/</guid><pubDate>Sun, 09 Aug 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In my spare time I enjoy working on side projects. Little websites and projects that I can play around with to either learn new things or to create something for fun.&lt;/p&gt;
&lt;p&gt;In the past I&apos;ve always been stymied in my attempts to create something for fun because some part of the process becomes laborious and boring to work on. So when that inevitably happens, I stop working on the project, and dust begins to accumulate.&lt;/p&gt;
&lt;p&gt;When I&apos;m working on a side project I don&apos;t want to focus on technical problems, I want to focus on the product I&apos;m creating. I don&apos;t want to have to re-think how OAuth works, I want to let someone login with their GitHub credentials.&lt;/p&gt;
&lt;p&gt;So for the past couple of months I&apos;ve been putting together a tech stack that I can use on these side projects that lets me focus on the product at hand, and ignore all the technical distractions.&lt;/p&gt;
&lt;p&gt;I&apos;m so proud to say that I&apos;ve found a tech stack I&apos;m super excited about that does exactly what I need.&lt;/p&gt;
&lt;p&gt;I made a video about it that you can watch right here.&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/9plIzok5LCQ&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;However if you prefer the format of spoken word, then keep on reading.&lt;/p&gt;
&lt;h2&gt;Table of contents&lt;/h2&gt;
&lt;hr /&gt;
&lt;h2&gt;Frontend&lt;/h2&gt;
&lt;h3&gt;&lt;a href=&quot;https://reactjs.org/&quot;&gt;React.js&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It goes without saying but I&apos;m a huge fan of React. I think it&apos;s the best way to write a frontend application. It lets me be super productive and at this point I have many years of experience with it, letting me write code really quickly.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://nextjs.org/&quot;&gt;Next.js&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;React is great, but by itself it doesn&apos;t go very far. To be productive with React requires a lot of tooling and setup and frankly I would prefer to not waste my time dealing with all that.&lt;/p&gt;
&lt;p&gt;Next.js handles that all for me, and then some. It lets me start coding with React and not worry about all the boilerplate noise.&lt;/p&gt;
&lt;p&gt;Beyond the boilerplate Next.js comes with some truly incredible features:&lt;/p&gt;
&lt;h4&gt;Server side rendering&lt;/h4&gt;
&lt;p&gt;I&apos;ve tried creating my own server-side rendered React app in the past and let me tell you...it&apos;s very hard. The fact this comes out of the box with Next is something that I think most people will take for granted, but it&apos;s incredible how easy they make it.&lt;/p&gt;
&lt;h4&gt;Static page generation&lt;/h4&gt;
&lt;p&gt;I get the best of both worlds - server rendered pages AND statically generated pages. Which means that for pages that I want to offload most of the work to the client, I can!&lt;/p&gt;
&lt;h4&gt;Server API endpoints&lt;/h4&gt;
&lt;p&gt;No need for Express to make custom data endpoints, it&apos;s built in to Next.js!&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;All these features make it super easy to get going with Next.js. It&apos;s truly the best React framework available right now.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://tailwindcss.com/&quot;&gt;Tailwind CSS&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I&apos;m not a designer. I can implement designs, but creating my own designs is a large area of weakness for me.&lt;/p&gt;
&lt;p&gt;I also have no desire to use Bootstrap. I can&apos;t stomach the thought of my site looking like another bootstrap website.&lt;/p&gt;
&lt;p&gt;Instead I&apos;m turning my interests to Tailwind, which has some strong default styles available, but also being flexible enough that I can truly make my project look like my own.&lt;/p&gt;
&lt;p&gt;It&apos;s also just a very interesting way of doing CSS. The utility CSS approach is one that I would have scoffed at a few years ago but I&apos;m really excited about it nowadays.&lt;/p&gt;
&lt;p&gt;The fact I can design a full website just with Tailwind and no custom CSS is truly incredible to me.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://next.chakra-ui.com/&quot;&gt;Chakra UI&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Tailwind covers just CSS and styles. However some components, such as a Tooltip or a Modal, require interactivity and JavaScript.&lt;/p&gt;
&lt;p&gt;Again, because I&apos;d rather focus on my project and not the technology, I&apos;m turning to Chakra to cover those use cases.&lt;/p&gt;
&lt;p&gt;It also has some strong default styles that look to blend nicely with Tailwind.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://emotion.sh/docs/introduction&quot;&gt;Emotion&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If I do need my own custom styles then I&apos;m a big believer in CSS-in-JS nowadays. (If you want to hear &lt;a href=&quot;https://youtu.be/rKz6cLXhpwA&quot;&gt;more of my thoughts on CSS-in-JS then watch my video about it&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Emotion is my favorite CSS-in-JS library nowadays. It lets me be hyper productive and super expressive in how I write my styles. Great library.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://reactjs.org/docs/context.html&quot;&gt;React Context&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To store data I&apos;ve gone back to basics and just rely on vanilla React Context. Most of my data needs are simple enough that a plain Context provider will handily cover my needs.&lt;/p&gt;
&lt;p&gt;If I do find my data structures getting complex then I will always turn to &lt;a href=&quot;https://immerjs.github.io/immer/&quot;&gt;Immer&lt;/a&gt; as an easy to update my state.&lt;/p&gt;
&lt;p&gt;Check out my videos about Context and Immer to gain more of an idea of how I like to use them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://youtu.be/o-nCM1857AQ&quot;&gt;Why I Love useReducer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://youtu.be/StABs9JxeNE&quot;&gt;How to useContext with useReducer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://youtu.be/PjsGz6sNG3g&quot;&gt;Level Up useReducer with Immer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;a href=&quot;https://react-query.tanstack.com/&quot;&gt;React Query&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is a new addition to my tech stack but one I&apos;m super glad to have found. React Query makes it easy to make REST calls to my backend and cache the results in the browser.&lt;/p&gt;
&lt;p&gt;It&apos;s API is intuitive and provides some lovely structure to all my data fetching. Very well designed library!&lt;/p&gt;
&lt;h2&gt;Backend&lt;/h2&gt;
&lt;h3&gt;&lt;a href=&quot;https://nextjs.org/docs/api-routes/introduction&quot;&gt;Next.js API Routes&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Surprised to see Next.js again? Don&apos;t be! This is why I love it so much - it does double duty!&lt;/p&gt;
&lt;p&gt;Using Next.js&apos; API Routes I can serve up any arbitrary data to the frontend. Completely replaces Express for me!&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://www.mongodb.com/cloud/atlas&quot;&gt;MongoDB Atlas&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Disclaimer: I work for MongoDB&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I need to store data somewhere, right? And the best place for that is a database, right?&lt;/p&gt;
&lt;p&gt;The best database right now in my opinion is MongoDB. Not only that but MongoDB Atlas is a hosted mongodb service, with a free tier included!&lt;/p&gt;
&lt;p&gt;Which means I can create a free MongoDB database, connect it to my Next.js app, and serve data from my database, all for free! Wonderful!&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://next-auth.js.org/&quot;&gt;NextAuth.js&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Authentication is a pain in the ass to code. I have no interest in re-implementing the OAuth protocol to provide authentication via third-party sites.&lt;/p&gt;
&lt;p&gt;Luckily this library, NextAuth.js, takes care of all that boilerplate for me.&lt;/p&gt;
&lt;p&gt;The installation process is drop dead simple - just add one splatted route in my Next.js API Routes.&lt;/p&gt;
&lt;p&gt;All told I was able to login via GitHub in under 5 minutes. Supurb.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/Marak/Faker.js&quot;&gt;faker.js&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;While developing I need some dummy data to play with. Faker.js is a great library for generating fake data so I can spend more time designing my UI and less worried about filling in blank spaces. Nice little library.&lt;/p&gt;
&lt;h2&gt;Testing&lt;/h2&gt;
&lt;h3&gt;&lt;a href=&quot;https://jestjs.io/&quot;&gt;Jest&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Jest is the gold standard in testing for JavaScript applications. In my opinion no other testing framework comes close to offering what Jest provides.&lt;/p&gt;
&lt;p&gt;Strong defaults, massive ecosystem, and a true joy to use.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://testing-library.com/docs/react-testing-library/intro&quot;&gt;React Testing Library&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;For testing React applications, React Testing Library is the best choice. It&apos;s strongest selling point is that it only uses React&apos;s public API when rendering React components.&lt;/p&gt;
&lt;p&gt;This means that you&apos;re gauranteed to be testing components the same way they are rendered for a user.&lt;/p&gt;
&lt;p&gt;Additionally the utilities and helper functions encourages strong testing practices such that your tests cover how your users use your application.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://www.cypress.io/&quot;&gt;Cypress.io&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Cypress is the best way to write end-to-end tests. E2E tests being tests that run in a browser.&lt;/p&gt;
&lt;p&gt;There are two standout features for Cypress that make it super pleasing to work with:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It has built in flakiness mitigation. If you&apos;ve ever used Selenium in the past, or other browser-based testing libraries, then you know how painful it is to write reliable tests. For example, when you open a model with an animation and click a button inside the modal, adding in handling to make sure the test waits for the animation to finish is notoriously difficult and annoying. This is built-in to Cypress.&lt;/li&gt;
&lt;li&gt;It is incredibly easy to debug and write tests. It has a GUI that provides a clear way of understanding how your tests are behaving. In that GUI you get screenshots of how your tests changed the browser, including time-traveling capabilities, to roll back a few steps and see the browser at a previous step. You truly have to try it to understand how powerful it is.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Hosting&lt;/h2&gt;
&lt;h3&gt;&lt;a href=&quot;https://vercel.com/&quot;&gt;Vercel&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There&apos;s no better place to host my project than by the authors of Next.js, that being Vercel.&lt;/p&gt;
&lt;p&gt;They have a free tier as well, and a super easy deploy process.&lt;/p&gt;
&lt;p&gt;What&apos;s the deploy process? Push to git and that&apos;s it. Vercel watches changes to your git repo and will automatically rebuild on any new commits.&lt;/p&gt;
&lt;p&gt;It also has branch previews. Such that if I create a branch and push new code to that branch, Vercel will also build that version of my site for me as well.&lt;/p&gt;
&lt;p&gt;A wonderful experience all around.&lt;/p&gt;
&lt;h2&gt;Start Coding!&lt;/h2&gt;
&lt;p&gt;That&apos;s my current tech stack! It took me a while to put it together, but I&apos;m very happy with how it turned out.&lt;/p&gt;
&lt;p&gt;What I love about this stack is it handles all the boilerplate for me. I don&apos;t need to worry about auth, design, or how to store data. It&apos;s all taken care of for me.&lt;/p&gt;
&lt;p&gt;What I love even more about this stack is that by default it costs $0. Which, when I&apos;m playing around with a side project, is what I want. I don&apos;t want to pay something while I&apos;m still figuring out what it is I&apos;m building.&lt;/p&gt;
&lt;p&gt;Curious if you use any of the same technologies as me, or if your stack is slightly different. &lt;a href=&quot;https://twitter.com/hswolff&quot;&gt;Be sure to tweet at me to let me know, I&apos;m curious to hear!&lt;/a&gt;&lt;/p&gt;
</content:encoded></item><item><title>2019 In Review</title><link>https://hswolff.com/blog/2019-in-review/</link><guid isPermaLink="true">https://hswolff.com/blog/2019-in-review/</guid><pubDate>Sun, 08 Dec 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;So not only is the end of 2019 quickly approaching, but so is the end of a decade. The 2010s are drawing to a close. An entire decade is over, and we&apos;re just about to enter the 2020s. What an amazing time to be alive.&lt;/p&gt;
&lt;p&gt;I wanted to take a few moments to reflect on the past year. Quite a lot happened and I would be remiss if I didn&apos;t reflect on the growth and exciting events that happened to me in 2019.&lt;/p&gt;
&lt;p&gt;I&apos;ve also made a video talking about my 2019 in case you want to see this post in video form:&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/V3e-ij6qo3g&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;h2&gt;2019 Most Watched Videos&lt;/h2&gt;
&lt;p&gt;Last year I was used to getting between 300-500 views per video. If a video cracked more than 500 views I was ecstatic. It meant people were actually watching what I was creating.&lt;/p&gt;
&lt;p&gt;This year could not have been more different. This year I regularly had videos cross over 1000 views, a fact I am still not quite used to.&lt;/p&gt;
&lt;p&gt;Getting so many people watching my videos is such a wonderful progression for my YouTube channel. It&apos;s so encouraging and helps me keep going.&lt;/p&gt;
&lt;p&gt;I went through all the videos I made in 2019 and sorted them by most viewed. Here&apos;s that list:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=o-nCM1857AQ&quot;&gt;Why I Love useReducer&lt;/a&gt; (11943)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=HQq5Sod8AEk&quot;&gt;Async React Hooks&lt;/a&gt; (5710)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=StABs9JxeNE&quot;&gt;How to useContext with useReducer&lt;/a&gt; (4754)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=9lkZ77m-39I&quot;&gt;Testing React Hooks&lt;/a&gt; (4586)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=48gHuY4w0hY&quot;&gt;A Svelte Chat with Rich Harris!&lt;/a&gt; (4347)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=-wBNV7i_b9o&quot;&gt;TypeScript and React&lt;/a&gt; (3768)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=TPVQ3M9b6CY&quot;&gt;Playing with Svelte 3&lt;/a&gt; (3215)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=RS1GpKxCoIA&quot;&gt;Getting Dapper with Sapper&lt;/a&gt; (3089)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=PjsGz6sNG3g&quot;&gt;Level Up useReducer with Immer&lt;/a&gt; (2975)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=QFKZmBMgvus&quot;&gt;What&apos;s New with React Dev Tools 4&lt;/a&gt; (2579)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=8_ZjNnUqarg&quot;&gt;Overview of React Concurrent Mode&lt;/a&gt; (2499)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=nePDL5lQSE4&quot;&gt;What are TypeScript Generics?&lt;/a&gt; (2411)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=lnThZpX80x8&quot;&gt;My Visual Studio Code Extensions, 2019 Edition&lt;/a&gt; (1908)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=bk1tmNKtXBo&quot;&gt;What is React Ink?&lt;/a&gt; (1846)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=Ap_LrI8Wibo&quot;&gt;What is TypeScript?&lt;/a&gt; (1624)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=rKz6cLXhpwA&quot;&gt;CSS in JS: My favorite&lt;/a&gt; (1459)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=2-77KhGWlRg&quot;&gt;How to use the GitHub Package Registry&lt;/a&gt; (1423)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=xSSP-fj8YF4&quot;&gt;Playing with Framer Motion&lt;/a&gt; (1412)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=lfYo4mfOyM8&quot;&gt;What is CodeSandbox?&lt;/a&gt; (1220)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=WRfhMI1gskk&quot;&gt;Setting Up TypeScript w/ Babel&lt;/a&gt; (1215)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;lt;!--
&lt;a href=&quot;https://www.youtube.com/watch?v=VAYIPSNXHhw&quot;&gt;Function Declarations vs Function Expressions&lt;/a&gt; (1177)
&lt;a href=&quot;https://www.youtube.com/watch?v=pKMWU9OrA2s&quot;&gt;CSS Modules: Why are they great?&lt;/a&gt; (1114)
&lt;a href=&quot;https://www.youtube.com/watch?v=et_1NoEvVww&quot;&gt;Preview of the JavaScript Ecosystem in 2019&lt;/a&gt; (982)
&lt;a href=&quot;https://www.youtube.com/watch?v=onrMjAGY4qA&quot;&gt;How does React Suspense Work?&lt;/a&gt; (978)
&lt;a href=&quot;https://www.youtube.com/watch?v=aTlVbIRsu6Q&quot;&gt;useLocationHash Custom Hook&lt;/a&gt; (906)
&lt;a href=&quot;https://www.youtube.com/watch?v=E8714rfIlnE&quot;&gt;Destructuring&lt;/a&gt; (899)
&lt;a href=&quot;https://www.youtube.com/watch?v=fov4Tbigv5E&quot;&gt;Let&apos;s Build a React Native App: Migrating to React Hooks&lt;/a&gt; (896)
&lt;a href=&quot;https://www.youtube.com/watch?v=sVYlv78IY8o&quot;&gt;Setting Up TypeScript w/ tsc&lt;/a&gt; (886)
&lt;a href=&quot;https://www.youtube.com/watch?v=oaVTDYwAjJw&quot;&gt;Optional Chaining&lt;/a&gt; (867)
&lt;a href=&quot;https://www.youtube.com/watch?v=b_BxL781b3E&quot;&gt;TypeScript Fundamentals - Functions and Classes&lt;/a&gt; (787)
&lt;a href=&quot;https://www.youtube.com/watch?v=UIXcspECBJs&quot;&gt;TypeScript Fundamentals - Primitives and Base Types&lt;/a&gt; (742)
&lt;a href=&quot;https://www.youtube.com/watch?v=V4SaBY12nYM&quot;&gt;Voyage into CSS Part 1: BEM, OOCSS, SMACSS, and Atomic CSS, Oh my!&lt;/a&gt; (719)
&lt;a href=&quot;https://www.youtube.com/watch?v=GqBoJuQqbjk&quot;&gt;React Rally 2019&lt;/a&gt; (711)
&lt;a href=&quot;https://www.youtube.com/watch?v=6bI3y5UAtEM&quot;&gt;APIs of the Web&lt;/a&gt; (665)
&lt;a href=&quot;https://www.youtube.com/watch?v=PtGbhwxwVM4&quot;&gt;Let&apos;s Build a React Native App: Where&apos;d I Go?&lt;/a&gt; (662)
&lt;a href=&quot;https://www.youtube.com/watch?v=abbo83_mJDE&quot;&gt;How const works&lt;/a&gt; (609)
&lt;a href=&quot;https://www.youtube.com/watch?v=Ad4ZqIPmtGA&quot;&gt;Nullish Coalescing&lt;/a&gt; (597)
&lt;a href=&quot;https://www.youtube.com/watch?v=dVbsDizoo8c&quot;&gt;I Helped My Wife By Coding a CSV Formatter&lt;/a&gt; (566)
&lt;a href=&quot;https://www.youtube.com/watch?v=yyfOltqU7QI&quot;&gt;I&apos;m Moving!&lt;/a&gt; (439)
&lt;a href=&quot;https://www.youtube.com/watch?v=0AUvoelRc68&quot;&gt;Starting a Newsletter&lt;/a&gt; (310)
&lt;a href=&quot;https://www.youtube.com/watch?v=YAzmV68txzQ&quot;&gt;I’m on vacation in Spain!&lt;/a&gt; (299)
&lt;a href=&quot;https://www.youtube.com/watch?v=_nxvNymxpBA&quot;&gt;Our First Patron (become a patron!)&lt;/a&gt; (221)
&lt;a href=&quot;https://www.youtube.com/watch?v=YiI3sUG6tkk&quot;&gt;Launching a Patreon page!&lt;/a&gt; (216)
--&amp;gt;&lt;/p&gt;
&lt;h2&gt;Other 2019 Milestones&lt;/h2&gt;
&lt;p&gt;Some really exciting things happened in 2019!&lt;/p&gt;
&lt;p&gt;I &lt;a href=&quot;https://hswolff.com/blog/react-alicante-2019/&quot;&gt;spoke at a conference, React Alicante 2019&lt;/a&gt;! It was really fun getting to present to people in person. Getting to share my ideas in real time was a lot of fun. I love feeling the audience listen while I talk, and adjusting how I present to make it the most entertaining and informational.&lt;/p&gt;
&lt;p&gt;I was also &lt;a href=&quot;https://hswolff.com/blog/guest-on-freecodecamp-podcast/&quot;&gt;a guest on FreeCodeCamp&apos;s Podcast&lt;/a&gt; where I got to talk about myself for an hour straight. It was fun sharing my history: how I got my start in the industry, what my progression looked like, how I got to be who I am today. If you&apos;re curious about that backstory then that is definitely the best place to start.&lt;/p&gt;
&lt;p&gt;And also...if you&apos;re reading these words...I started blogging again! 2018 was a very light year for blog posts but I was able to actually get myself back into the writer&apos;s seat and put some &quot;ink to papper&quot; so to speak. I hope to keep that up going into 2020.&lt;/p&gt;
&lt;h2&gt;The Future&lt;/h2&gt;
&lt;p&gt;I have quite a few projects I want to take on in 2019 (like I don&apos;t have enough, wth Harry).&lt;/p&gt;
&lt;p&gt;The first one has already begun: &lt;a href=&quot;https://tinyletter.com/hswolff/&quot;&gt;I started a newsletter!&lt;/a&gt;. This is the direct result of ending &lt;a href=&quot;https://theconsolelog.com/&quot;&gt;the podcast I created&lt;/a&gt; but it has nearly the same format and content. Want to stay up to date on the latest JavaScript news? Subscribe!&lt;/p&gt;
&lt;p&gt;A big project I want to take on next year is create a full-fledged course. Probably it&apos;ll be to teach React but there&apos;s no certainty about the topic. However I do want to make a full length course that lets me dive deep into a subject and teach it as well as possible. Stay tuned as that project progresses!&lt;/p&gt;
&lt;p&gt;I also want to do more for my &lt;a href=&quot;https://www.patreon.com/hswolff&quot;&gt;Patreon&lt;/a&gt; patrons, make that even more of a valuable membership. I recently started a Discord server for my Patrons, such that if you become a Patron you get to talk to me in real time! It&apos;s so real you can practically touch me!&lt;/p&gt;
&lt;p&gt;Here&apos;s to next year and the next decade! Happy New Year!&lt;/p&gt;
</content:encoded></item><item><title>Pro VSCode Tricks</title><link>https://hswolff.com/blog/pro-vscode-tricks/</link><guid isPermaLink="true">https://hswolff.com/blog/pro-vscode-tricks/</guid><pubDate>Sat, 07 Dec 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;One of the most important things you can do to become a highly efficient programmer is to learn how to use your code editor. Most text editors, or &lt;a href=&quot;https://en.wikipedia.org/wiki/Integrated_development_environment&quot;&gt;IDEs&lt;/a&gt;, host a huge amount of functionality that help you code fast and efficiently. The only thing that sucks is that it can be very hard to learn all of those pro features - there&apos;s almost too much!&lt;/p&gt;
&lt;p&gt;I&apos;ve been using &lt;a href=&quot;https://code.visualstudio.com/&quot;&gt;VSCode&lt;/a&gt; now for over two years and I&apos;ve picked up many shortcuts and tricks along the way that have become invaluable to how I code. In fact, I&apos;m so efficient with VSCode that it&apos;s my goto program when I&apos;m writing anything that has to do with text.&lt;/p&gt;
&lt;p&gt;So, rather than keep all these secret tricks to myself I&apos;d prefer to share them with you! Yes you, the reader of this article!&lt;/p&gt;
&lt;p&gt;I imagine you&apos;re curious how you can super-charge your own VSCode usage, right? After all, that&apos;s why you&apos;re here!&lt;/p&gt;
&lt;p&gt;And if you&apos;d rather have me show you all these tricks then you&apos;re in luck as well! I have a wonderful video already recorded and edited for your viewing entertainment:&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/l4ANg098TlI&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;However, if you&apos;re the reading sort, behold! All my Pro VSCode Tricks!&lt;/p&gt;
&lt;h2&gt;Navigation Shortcuts&lt;/h2&gt;
&lt;p&gt;These keyboard shortcuts help me move around VSCode without ever reaching for my mouse. They&apos;re simple quality of life improvements, but when taken together add up to an immense amount of value.&lt;/p&gt;
&lt;p&gt;These shortcuts help me change the layout of VSCode, which depending upon what I&apos;m doing, is of great help.&lt;/p&gt;
&lt;h3&gt;Toggle Side Bar Visibility: Command ⌘ + B&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/toggle-side-bar.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;If I need more horizontal real estate this is my go to move. It hides the side bar so I can focus only on the code in front of me.&lt;/p&gt;
&lt;h3&gt;Toggle Bottom Panel: Command ⌘ + J&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/toggle-bottom-panel.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;This is the sister command to the one above. This lets me hide or show the bottom panel so I get more vertical real estate.&lt;/p&gt;
&lt;p&gt;With these two powers combined I get a full screen window without switching to full screen mode!&lt;/p&gt;
&lt;h3&gt;Open Terminal: Control ⌃ + `&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/open-terminal.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;I use this to jump into the terminal to do some CLI work. I used to use this command a lot more before I learned about the toggle bottom panel command, but it&apos;s still a useful one to know.&lt;/p&gt;
&lt;h3&gt;Open Explorer: Command ⌘ + Shift ⇧ + E&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The Explorer is that big tree that lists all the files in your current project. It&apos;s the one that you probably use all the time to jump between different files. If you ever need to go straight to there then this is the shortcut for you.&lt;/p&gt;
&lt;h3&gt;Open Search: Command ⌘ + Shift ⇧ + F&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Likewise, if you want to do a global search over all the files in your project you can jump directly to the global find pane.&lt;/p&gt;
&lt;h2&gt;Project Manager&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/alefragnani/vscode-project-manager&quot;&gt;Project Manager is actually an extension.&lt;/a&gt; However it&apos;s one that I rely on all the time.&lt;/p&gt;
&lt;p&gt;It lets me set a list of projects that I&apos;m actively working on and lets me quickly jump between them.&lt;/p&gt;
&lt;p&gt;Saves a lot of time to having look up where the directories are in my file system, I can just search by the project name and be on my way.&lt;/p&gt;
&lt;h2&gt;Selection Pro Moves&lt;/h2&gt;
&lt;p&gt;Oh man...this is by far the bread and butter of all my pro moves. This is how I&apos;m able to make multiple modifications all at the same time, saving me seconds every day. Seconds! You add up those seconds and it turns into a full day! I&apos;m going to save you a day&apos;s worth of time!&lt;/p&gt;
&lt;p&gt;Also you&apos;ll look really cool doing this.&lt;/p&gt;
&lt;h3&gt;Select Multiple Words: Command ⌘ + D&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/select-multiple-words.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;This one is very hard to explain in words. Basically if you have some word on a page you can select it, and then hit Command ⌘ + D to select the next instance of this word. This becomes awesome when you&apos;re editing an array of objects in a JSON or JSON-like file.&lt;/p&gt;
&lt;p&gt;If you have a key called &apos;name&apos; you can expand your selection so that you select every &apos;name&apos; word on the page and then you can make edits all at once.&lt;/p&gt;
&lt;p&gt;Even further, once you&apos;ve expanded your selection to all the places you want, you can then move your cursor around as you would before. So if you wanted to modify the value instead of the key you could hit right a couple of times and be on your merry editing way.&lt;/p&gt;
&lt;h3&gt;Jump over words: Option ⌥&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/jump-over-words.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;This is actually a system wide shortcut, but one that I take advantage of in VSCode.&lt;/p&gt;
&lt;p&gt;By default when you move your cursor with the arrow keys they move one by one. One by one, and it becomes very inefficient when you&apos;re trying to navigate across a lot of text.&lt;/p&gt;
&lt;p&gt;If instead you hold down the Option ⌥ key and then navigate with the arrow keys it changes the behavior. Now you&apos;ll be jumping over words, letting you quickly move forward and backwords when moving code around.&lt;/p&gt;
&lt;p&gt;Also if you hold Shift ⇧ on top of holding Option ⌥ you&apos;ll be able to select words at a time.&lt;/p&gt;
&lt;p&gt;So, if you&apos;ve made multiple selections using the trick above, and then hold Option ⌥ with Shift ⇧ you can then easily select multiple blocks of text and then can edit them all at the same time.&lt;/p&gt;
&lt;p&gt;This is the super power-up combo that makes me feel like a dark wizard, and I love it.&lt;/p&gt;
&lt;h3&gt;Move Line Up or Down: Option ⌥ + Up/Down&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/move-line-up-down.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s say you have a variable assignment that you want to move up a few lines. If you use this trick that becomes a real quick job. You don&apos;t have to select the line, cut the line, move the cursor, paste the line. Just put your cursor on the line you want to move and use this trick to move it wherever you want.&lt;/p&gt;
&lt;p&gt;This trick also works if you select multiple lines. If you have any number of lines selected and you use this shortcut then VSCode will move that entire block for you.&lt;/p&gt;
&lt;h3&gt;Multiline Selection: Option ⌥ + Shift ⇧ + L&lt;/h3&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/multiline-select.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/BCJTI/vscode-multi-line-tricks&quot;&gt;Multiline Selection is another extension.&lt;/a&gt; This is functionality that was ported over from Sublime Text, and I got used to it there and was glad to see someone make a VSCode replacement.&lt;/p&gt;
&lt;p&gt;Select multiple lines and then use this shortcut to make a cursor selection on every line.&lt;/p&gt;
&lt;p&gt;I use this instead of the Command ⌘ + D shortcut when there isn&apos;t a common word to select on every line.&lt;/p&gt;
&lt;p&gt;So it becomes very helpful if I have a couple of consecutive lines that I want to make the same edits to, but their contents are all different.&lt;/p&gt;
&lt;h3&gt;Fast Line Removal: Command ⌘ + X&lt;/h3&gt;
&lt;p&gt;Did you know that VSCode has the ability to quickly remove a full line? This shortcut is actually for cutting text from the page, however if you don&apos;t have any text selected VSCode will fall back to the entire line.&lt;/p&gt;
&lt;p&gt;So I use this a lot to quickly get rid of multiple lines of text by repeatedly hitting this shortcut.&lt;/p&gt;
&lt;p&gt;There&apos;s an actual shortcut to delete a line but this one is so much easier to use.&lt;/p&gt;
&lt;h2&gt;Built in VCS editor&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;VSCode has an &lt;a href=&quot;https://code.visualstudio.com/docs/editor/versioncontrol&quot;&gt;excellent built-in version control system editor.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&apos;s so good that it&apos;s replaced all the other GUIs I was using to manage Git.&lt;/p&gt;
&lt;p&gt;Learn how to use it! It&apos;s powerful, flexible, and built right into VSCode!&lt;/p&gt;
&lt;p&gt;One of my favorite things to do is staging a few lines from a changed file, rather than the entire thing. That&apos;s a real hassle in the CLI but an absolute joy using VSCode.&lt;/p&gt;
&lt;h2&gt;Command Palette: Command ⌘ + Shift ⇧ + P&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This trick is the end all be all shortcut. It lets you access every command possible within VSCode from a fast fuzzy-finder search. Type in anything you can think of and it&apos;ll show you the commands available.&lt;/p&gt;
&lt;p&gt;For example if you type in &quot;File&quot; it&apos;ll show you commands to &quot;Copy Path of Active File&quot; and other similar ones.&lt;/p&gt;
&lt;p&gt;It&apos;ll also show you the shortcut to that command if a shortcut exists. Such that you can use the Command Palette to learn and discover other shortcuts!&lt;/p&gt;
&lt;p&gt;It&apos;s a shortcut to learning shortcuts!&lt;/p&gt;
&lt;h2&gt;Easy prototyping&lt;/h2&gt;
&lt;p&gt;&amp;lt;video controls loop&amp;gt;
&amp;lt;source src=&quot;/images/posts/2019/vscode-pro-tricks/fast-prototyping.mp4&quot; type=&quot;video/mp4&quot; /&amp;gt;
&amp;lt;/video&amp;gt;&lt;/p&gt;
&lt;p&gt;I use this trick a lot when putting together some example code.&lt;/p&gt;
&lt;p&gt;I open a new file in VSCode.&lt;/p&gt;
&lt;p&gt;Open the Command Palette (described above).&lt;/p&gt;
&lt;p&gt;Select &quot;Change Language Mode&quot;.&lt;/p&gt;
&lt;p&gt;Search for the language I want (most commonly JavaScript).&lt;/p&gt;
&lt;p&gt;And then I have a new file that has all the syntax highlighting and completions that I usually expect when coding that file.&lt;/p&gt;
&lt;p&gt;Makes it really easy to create a new scratch pad to try out some ideas and still have them look as pretty as the rest of my other files.&lt;/p&gt;
&lt;h2&gt;Pro: GitHub Pull Requests Extension&lt;/h2&gt;
&lt;p&gt;This is a bonus tip! This is also an extension, the &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github&quot;&gt;GitHub Pull Requests extension&lt;/a&gt;. It&apos;s actually developed by Microsoft itself and under active development which are both great things.&lt;/p&gt;
&lt;p&gt;I didn&apos;t use this extension for the longest time and then one day I gave it a try and oh man...I wish I had tried it out a long time ago.&lt;/p&gt;
&lt;p&gt;What this extension makes easy is checking out code from a PR so I can play around with it locally.&lt;/p&gt;
&lt;p&gt;This extension actually puts VSCode into &apos;Review Mode&apos; where you can even add comments to the GitHub PR directly in VSCode! It&apos;s incedible!&lt;/p&gt;
&lt;p&gt;And when you&apos;re done all you have to do is hit &apos;Exit Review Mode&apos; and you&apos;re back to where you started. So cool!&lt;/p&gt;
&lt;h2&gt;Get Practicing!&lt;/h2&gt;
&lt;p&gt;All these tricks require practice for you to become an expert with them.&lt;/p&gt;
&lt;p&gt;Take one or two tricks at a time and try them out. See if you can get them to become muscle memory so that you start relying on them without even realizing it.&lt;/p&gt;
&lt;p&gt;Once you got that shortcut under control then move onto another one.&lt;/p&gt;
&lt;p&gt;These shortcuts are half the reason I enjoy using VSCode so much. I&apos;m actually able to control it and have it do what I want with as minimal effort as possible.&lt;/p&gt;
&lt;p&gt;I&apos;m always on the hunt for more shortcuts or pro moves! I&apos;m curios to hear what your VSCode pro moves are! Tweet at me or add a comment down below!&lt;/p&gt;
&lt;p&gt;Happy VSCoding!&lt;/p&gt;
</content:encoded></item><item><title>Why Is React Concurrent Mode Exciting?</title><link>https://hswolff.com/blog/why-is-react-concurrent-mode-exciting/</link><guid isPermaLink="true">https://hswolff.com/blog/why-is-react-concurrent-mode-exciting/</guid><pubDate>Sun, 27 Oct 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;A guide for non-React engineers.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Last week the React team released an &lt;a href=&quot;https://reactjs.org/docs/concurrent-mode-intro.html&quot;&gt;experimental version of Concurrent Mode&lt;/a&gt; to the public. It&apos;s been in development for over a year and the React community has been very excited about its release.&lt;/p&gt;
&lt;p&gt;What is Concurrent Mode? The documentation pages has a nice and concise description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Concurrent Mode is a set of new features that help React apps stay responsive and gracefully adjust to the user’s device capabilities and network speed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;However if you don&apos;t know how Concurrent Mode works or what it actually lets you do you may be left wondering, &quot;Why all the excitement?&quot;&lt;/p&gt;
&lt;p&gt;If that&apos;s you then this blog post is for you.&lt;/p&gt;
&lt;h2&gt;The Problem Is Being In Sync&lt;/h2&gt;
&lt;p&gt;Most (perhaps all?) UI frameworks today synchronously update the browser.&lt;/p&gt;
&lt;p&gt;Which means that when you render a list of items, the UI framework applies those changes to the screen all at once. Nothing else on the page can do anything until the UI framework is done rendering those items. If you have 1,000,000 items to render on the screen you&apos;re going to have to wait until all those items are rendered and shown before you can do anything else.&lt;/p&gt;
&lt;p&gt;However let&apos;s say you have a filter on that same page. Where someone can filter that list of items. That person cannot type in that input box until your list of 1,000,000 items has finished being rendered.&lt;/p&gt;
&lt;p&gt;I&apos;m sure you&apos;ve encountered this in the past. It makes for a very unpleasant user experience. The easy fix is to debounce the user input, but that still doesn&apos;t reduce the time it takes to render 1,000,000 items.&lt;/p&gt;
&lt;p&gt;With Concurrent Mode React has the ability to pause the rendering of 1,000,000 items and update the input filter.&lt;/p&gt;
&lt;p&gt;This lets the user type as much as they want in that input filter and not have to wait for 1,000,000 items to be rendered on the page.&lt;/p&gt;
&lt;p&gt;This lets the browser feel more responsive and gives the user a much better experience. There&apos;s no longer any lag to show the user what they are typing in. React can jump inbetween rendering the input filter and the 1,000,000 items and never leave the user wondering why the browser seems to be locked.&lt;/p&gt;
&lt;p&gt;This is what Concurrent Mode enables.&lt;/p&gt;
&lt;h2&gt;How is this even possible?&lt;/h2&gt;
&lt;p&gt;Concurrent Mode is difficult to understand. It does complex things and as a result is a little complex to understand.&lt;/p&gt;
&lt;p&gt;I&apos;m intentionally not including code examples in this post as I want to focus on the theory. If you &lt;em&gt;are&lt;/em&gt; interested in what React Concurrent Mode &lt;a href=&quot;https://reactjs.org/docs/concurrent-mode-suspense.html#what-is-suspense-exactly&quot;&gt;looks like in code then please check out the docs pages.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://reactjs.org/docs/concurrent-mode-intro.html#blocking-vs-interruptible-rendering&quot;&gt;React documentation about Concurrent Mode&lt;/a&gt; uses version control as a metaphor. I think this is a great metaphor to help understand how Concurrent Mode works.&lt;/p&gt;
&lt;p&gt;However I&apos;m going to give you another explanation. The more, the better!&lt;/p&gt;
&lt;p&gt;Concurrent Mode let&apos;s React do two things at once (hence the word concurrent). The thing that React is primarily focused on is rendering UI to a page. So, with Concurrent Mode, React can now do two renders at once.&lt;/p&gt;
&lt;p&gt;Having the ability to do 2 renders at the same time unlocks a whole world of possibilities.&lt;/p&gt;
&lt;p&gt;Let&apos;s say you&apos;re on my blog&apos;s home page. There&apos;s a button on there that lets you open and close my list of posts.&lt;/p&gt;
&lt;p&gt;You then click to my About page. The About page has text, a picture of me, and it makes an API call to fetch my latest tweets.&lt;/p&gt;
&lt;p&gt;Without Concurrent Mode React has no choice but to immediately show the About page. This is going to show the text immediately but it will take some time for the image to load and the API call to complete. So you sit on the About page and things incrementally jump into place. This is how most UI frameworks behave nowadays.&lt;/p&gt;
&lt;p&gt;With Concurrent Mode React can start to render my About page &lt;strong&gt;in memory and while rendering my Home page&lt;/strong&gt; and not show it to the user. React can wait for the image to load and the API call to complete, and when that is all done, show it all at once to the user.&lt;/p&gt;
&lt;p&gt;The user never sees things load incrementally, it just sees a page all at once. It gives a feeling of responsiveness and speed.&lt;/p&gt;
&lt;p&gt;Even more exciting is that Concurrent Mode lets you control how the About page is shown.&lt;/p&gt;
&lt;p&gt;Let&apos;s say the API call is the slowest part of the entire page. Rather than wait for every piece of data to complete we can tell React to render the About page as soon as we load the image. That means we can show the user the page as soon as our most important data is available, and then only show a loading indicator for the tweets section.&lt;/p&gt;
&lt;p&gt;Concurrent Mode lets you control what parts of a page are required and what parts can be deferred. As the data requirements for a page grow in complexity Concurrent Mode lets you take back control of how your page is rendered.&lt;/p&gt;
&lt;p&gt;This is what is exciting about Concurrent Mode.&lt;/p&gt;
&lt;h2&gt;What else can I do with Concurrent Mode?&lt;/h2&gt;
&lt;p&gt;With Concurrent Mode you can control how React uses its ability to render two things at once.&lt;/p&gt;
&lt;p&gt;Let&apos;s say you have a page that uses two different API calls: &lt;code&gt;loadUser&lt;/code&gt; and &lt;code&gt;loadUserFriends&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We know that &lt;code&gt;loadUserFriends&lt;/code&gt; is a slower API. With Concurrent mode we can decide how we want React to render the page.&lt;/p&gt;
&lt;p&gt;Should it wait for both API calls to complete before rendering anything? Or should it wait for the API calls independently, rendering UI when each API call completes?&lt;/p&gt;
&lt;p&gt;Furthermore imagine we had a loading spinner for each part of this page. With Concurrent Mode you can control when and how those loading spinners are rendered on the page. Perhaps you only want to show 1 loading spinner. This is possible with Concurrent Mode.&lt;/p&gt;
&lt;h2&gt;Do you need Concurrent Mode?&lt;/h2&gt;
&lt;p&gt;No. You really don&apos;t. Most applications won&apos;t &lt;em&gt;need&lt;/em&gt; Concurrent Mode. It&apos;s far and above an advanced feature of React, one created and driven by the needs of Facebook itself.&lt;/p&gt;
&lt;p&gt;Yet like all things the React team developed this feature in a way that it &lt;em&gt;could&lt;/em&gt; be used by the entire React community.&lt;/p&gt;
&lt;p&gt;Such that if you &lt;em&gt;want&lt;/em&gt; these types of features you can have them.&lt;/p&gt;
&lt;p&gt;There is no rush to immediately adopt Concurrent Mode. It won&apos;t magically transform a React app to become great.&lt;/p&gt;
&lt;p&gt;However it is a powerful way to control how your React application handles asynchronous tasks and renders UI.&lt;/p&gt;
&lt;p&gt;It&apos;s available if you so desire.&lt;/p&gt;
&lt;h2&gt;Random Questions You May Have&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Can you do the things you described without Concurrent mode?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Yes, you can! However it&apos;s hard, tricky, error prone, and I&apos;d argue impossible to scale. With Concurrent mode these behaviors become built-in to how you write your React app. You&apos;re working with the framework rather than around the framework.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Do you have to use Concurrent Mode?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Nope! Feel free to never ever worry about it. Just like &lt;a href=&quot;https://reactjs.org/docs/portals.html&quot;&gt;React Portals&lt;/a&gt; it&apos;s available if you need it.&lt;/p&gt;
&lt;h2&gt;Wrap Up&lt;/h2&gt;
&lt;p&gt;Personally I&apos;m looking forward to playing around with Concurrent mode. I love what capabilities it unlocks.&lt;/p&gt;
&lt;p&gt;The ways in which I can create my React apps are now more flexible and expressive. Perhaps even more fun?&lt;/p&gt;
&lt;p&gt;It will be very exciting to see how Concurrent Mode evolves over the next couple of months. I can&apos;t wait to get involved.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Video&lt;/h2&gt;
&lt;p&gt;I&apos;ve made a more in-depth look into what Concurrent Mode is on my YouTube channel. If you want a bit of a deeper dive then have a watch below!&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/8_ZjNnUqarg&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>React Alicante 2019</title><link>https://hswolff.com/blog/react-alicante-2019/</link><guid isPermaLink="true">https://hswolff.com/blog/react-alicante-2019/</guid><pubDate>Sun, 20 Oct 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On September 27th, 2019 I gave a conference talk in Alicante, Spain at &lt;a href=&quot;https://reactalicante.es/&quot;&gt;React Alicante 2019&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Believe it or not this was my first true conference talk of 2019! What fun!&lt;/p&gt;
&lt;p&gt;Had a great crowd show up for my talk. It was in the middle of the morning on the first day which turned out to be a great time to get high attendance.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My talk was called &lt;em&gt;Evergreen Legacy Applications&lt;/em&gt;, here was the summary:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;While most of the world is excited about all the newest and coolest technologies you’re stuck maintaining a legacy application. It’s not glamorous, but it works and pays the bills. What if you could have the best of both worlds? Keep your legacy application and use the latest and greatest tools? This dream can be your reality. I’m here to share some of the techniques, ideas, and code I’ve used to make this dream come true. While the task may seem daunting, if you come to this talk you’ll learn strategies you can use to slowly migrate your legacy application to become evergreen.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It was largely about my experience migrating the MongoDB Atlas application from Backbone.js to React over the past 3 years. A lot of fun!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://speakerdeck.com/hswolff/evergreen-legacy-applications&quot;&gt;Here are the slides of the talk.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the video of the talk so you can relive it in all its glory!&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe width=&quot;640&quot; height=&quot;360&quot; src=&quot;https://www.youtube.com/embed/t0fH0KdhJH4?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Guest on FreeCodeCamp Podcast</title><link>https://hswolff.com/blog/guest-on-freecodecamp-podcast/</link><guid isPermaLink="true">https://hswolff.com/blog/guest-on-freecodecamp-podcast/</guid><pubDate>Mon, 07 Oct 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Recently I was a guest on &lt;a href=&quot;https://podcast.freecodecamp.org&quot;&gt;freeCodeCamp&apos;s Podcast&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;I had a lot of fun chatting with &lt;a href=&quot;https://twitter.com/abbeyrenn&quot;&gt;Abbey&lt;/a&gt;, the host, who asked wonderful questions that let me talk at length about my career.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.freecodecamp.org/news/from-startups-to-manager-at-mongodb-podcast/&quot;&gt;There&apos;s a wonderful blog post up about the contents of the episode&lt;/a&gt; if you want to read the cliff notes, but to get most of the meat definitely tune in and listen.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://podcast.freecodecamp.org/ep-78-from-early-stage-startups-to-manager-at-mongodb&quot;&gt;Here&apos;s a direct link to the episode&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>How To useContext With useReducer</title><link>https://hswolff.com/blog/how-to-usecontext-with-usereducer/</link><guid isPermaLink="true">https://hswolff.com/blog/how-to-usecontext-with-usereducer/</guid><pubDate>Sun, 19 May 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Welcome back to the last installment of our mini-course on &lt;code&gt;useReducer&lt;/code&gt;!&lt;/p&gt;
&lt;p&gt;If this is your first time here I recommend you check out the first two posts in this series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/blog/why-i-love-usereducer/&quot;&gt;Why I Love useReducer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/level-up-usereducer-with-immer/&quot;&gt;Level Up useReducer with Immer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Today&apos;s post rounds out this trilogy. Today we learn about &lt;code&gt;useContext&lt;/code&gt;, and how it makes your usage of &lt;code&gt;useReducer&lt;/code&gt; flexible for any size application.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;useContext&lt;/code&gt; is of course the React Hook way to consume &lt;a href=&quot;https://reactjs.org/docs/context.html&quot;&gt;React Context&lt;/a&gt;. It&apos;s a way to share data to any descendent component without having to manually pass the props through every intermediary component. Sometimes known as &lt;a href=&quot;https://kentcdodds.com/blog/prop-drilling&quot;&gt;prop drilling&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before we get too far into the weeds I want to let you know this blog post is also in video form. Have a watch if you prefer that format.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/StABs9JxeNE&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hswolff/youtube/blob/master/videos/why-i-love-usereducer/src/LoginWithContext.js&quot;&gt;Also all source code is available on GitHub.&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Why do I need Context?&lt;/h1&gt;
&lt;p&gt;The &lt;a href=&quot;https://reactjs.org/docs/context.html&quot;&gt;React docs&lt;/a&gt; have a wonderful and succinct explanation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Context provides a way to pass data through the component tree without having to pass props down manually at every level.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Example usually help me understand things best. Notice in this example how we have to pass both &lt;code&gt;dispatch&lt;/code&gt; and &lt;code&gt;isLoggedIn&lt;/code&gt; to &lt;code&gt;TodoPage&lt;/code&gt; so that it can then in turn give it to each &lt;code&gt;TodoItem&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;What&apos;s unfortunate about this is that &lt;code&gt;TodoPage&lt;/code&gt; has no need for &lt;code&gt;dispatch&lt;/code&gt; or &lt;code&gt;isLoggedIn&lt;/code&gt;. The only reason it&apos;s being given those values is so it can pass it along. This is props drilling.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export default function App() {
  const [state, dispatch] = useReducer(loginReducer, initialState);
  const { todos, isLoggedIn } = state;
  return (
    &amp;lt;div className=&quot;App useContext&quot;&amp;gt;
      &amp;lt;TodoPage todos={todos} dispatch={dispatch} isLoggedIn={isLoggedIn} /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

function TodoPage({ todos, dispatch, isLoggedIn }) {
  return (
    &amp;lt;div className=&quot;todoContainer&quot;&amp;gt;
      &amp;lt;h2&amp;gt;Todos&amp;lt;/h2&amp;gt;
      {todos.map(item =&amp;gt; (
        &amp;lt;TodoItem
          key={item.title}
          dispatch={dispatch}
          isLoggedIn={isLoggedIn}
          {...item}
        /&amp;gt;
      ))}
    &amp;lt;/div&amp;gt;
  );
}

function TodoItem({ title, completed, dispatch, isLoggedIn }) {
  const isLoggedIn = true;
  return (
    &amp;lt;div className=&quot;todoItem&quot;&amp;gt;
      &amp;lt;p&amp;gt;{title}&amp;lt;/p&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;input
          type=&quot;checkbox&quot;
          checked={completed}
          onClick={() =&amp;gt; {
            if (!isLoggedIn) {
              alert(&apos;Please login to click this!&apos;);
            }
          }}
          onChange={() =&amp;gt; {
            if (isLoggedIn) {
              dispatch({ type: &apos;toggleTodoCompleted&apos;, payload: title });
            }
          }}
        /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;How Context Helps&lt;/h1&gt;
&lt;p&gt;Context removes the need for us to pass props to components that don&apos;t need it. It essentially lets some parent component expose a value to any descendent component. The big thing about context is the descendent doesn&apos;t have to be an immediate child, it can be as deep in the React component tree as you like.&lt;/p&gt;
&lt;p&gt;This is essentially the third way you can store and share data in React. There&apos;s state, props, and context. Context isn&apos;t something that you should feel the need to use frequently, however knowing it exists, and knowing why you might want to use it, is extremely valuable to have in your toolbox.&lt;/p&gt;
&lt;h1&gt;How to Create a Context&lt;/h1&gt;
&lt;p&gt;There is one way to create a context in React. It&apos;s via the top-level React API:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const MyContext = React.createContext();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The object given back has two properties on it, &lt;code&gt;MyContext.Provider&lt;/code&gt; and &lt;code&gt;MyContext.Consumer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;MyContext.Provider&lt;/code&gt; is how you establish the root of a context environment. It&apos;s what allows any descendent component to consume the data stored on the context. It accepts one prop &lt;code&gt;value&lt;/code&gt; and that is what context consumers can access.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const MyContext = React.createContext();

export default function App() {
  const [state, dispatch] = useReducer(loginReducer, initialState);
  const { todos, isLoggedIn } = state;
  return (
    // Note: This current way of exposing these values can lead to unexpected bugs.
    // We&apos;ll talk about this later in the post why writing `{state, dispatch}` can
    // lead to performance issues.
    &amp;lt;MyContext.Provider value={{ state, dispatch }}&amp;gt;
      &amp;lt;div className=&quot;App useContext&quot;&amp;gt;
        &amp;lt;TodoPage todos={todos} dispatch={dispatch} isLoggedIn={isLoggedIn} /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/MyContext.Provider&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;How to Consume Context with Hooks&lt;/h1&gt;
&lt;p&gt;There are actually three different ways you can consume a context in React. For the purposes of this blog post I&apos;m only going to discuss how we do it with Hooks.&lt;/p&gt;
&lt;p&gt;There&apos;s a built-in Hook provided by React called &lt;code&gt;useContext&lt;/code&gt; that allows any descendent component to gain access to the value on a Context Provider. It also subscribes the component that uses &lt;code&gt;useContext&lt;/code&gt; to be re-rendered anytime the value of the context changes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;useContext&lt;/code&gt; takes in one argument which is the object that&apos;s returned when we originally called &lt;code&gt;React.createContext&lt;/code&gt;. This tells React which context value we want.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function TodoItem({ title, completed }) {
  const { state, dispatch } = useContext(MyContext);
  const { isLoggedIn } = state;
  return (
    &amp;lt;div className=&quot;todoItem&quot;&amp;gt;
      &amp;lt;p&amp;gt;{title}&amp;lt;/p&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;input
          type=&quot;checkbox&quot;
          checked={completed}
          onClick={() =&amp;gt; {
            if (!isLoggedIn) {
              alert(&apos;Please login to click this!&apos;);
            }
          }}
          onChange={() =&amp;gt; {
            if (isLoggedIn) {
              dispatch({ type: &apos;toggleTodoCompleted&apos;, payload: title });
            }
          }}
        /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now &lt;code&gt;TodoItem&lt;/code&gt; is getting &lt;code&gt;state&lt;/code&gt; and &lt;code&gt;dispatch&lt;/code&gt; from Context instead! And if we showed the full example we&apos;d note that &lt;code&gt;TodoApp&lt;/code&gt; doesn&apos;t need to be given &lt;code&gt;state&lt;/code&gt; and &lt;code&gt;dispatch&lt;/code&gt; anymore because &lt;code&gt;TodoItem&lt;/code&gt; can access it directly from context!&lt;/p&gt;
&lt;h1&gt;Performance Concerns&lt;/h1&gt;
&lt;p&gt;Remember how I said to not have that inline object inside the &lt;code&gt;value&lt;/code&gt; prop when we called &lt;code&gt;&amp;lt;MyContext.Provider value={{state, dispatch}}&amp;gt;&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;The reason for that is that everytime &lt;code&gt;App&lt;/code&gt; (which is where &lt;code&gt;MyContext.Provider&lt;/code&gt; is being rendered) is re-rendered, it&apos;s going to create a new object on the &lt;code&gt;value&lt;/code&gt; prop. Which means that any component that is consuming that context will also be re-rendered as well.&lt;/p&gt;
&lt;p&gt;We won&apos;t be able to rely on only &lt;code&gt;state&lt;/code&gt; changing to cause consuming components to re-render, we also have to worry about &lt;code&gt;App&lt;/code&gt; re-rendering causing consuing components to re-render as well.&lt;/p&gt;
&lt;p&gt;There&apos;s two ways to fix this issue.&lt;/p&gt;
&lt;p&gt;One is to use &lt;code&gt;useMemo&lt;/code&gt; to memoize the value given to the provider:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const contextValue = useMemo(() =&amp;gt; {
  return { state, dispatch };
}, [state, dispatch]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The other is to make two separate contexts and have each provide &lt;code&gt;state&lt;/code&gt; and &lt;code&gt;dispatch&lt;/code&gt; independently.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const StateContext = React.createContext();
const DispatchContext = React.createContext();

export default function App() {
  const [state, dispatch] = useReducer(loginReducer, initialState);
  const { todos, isLoggedIn } = state;
  return (
    &amp;lt;DispatchContext.Provider value={dispatch}&amp;gt;
      &amp;lt;StateContext.Provider value={state}&amp;gt;
        &amp;lt;div className=&quot;App useContext&quot;&amp;gt;
          &amp;lt;TodoPage todos={todos} dispatch={dispatch} isLoggedIn={isLoggedIn} /&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/StateContext.Provider&amp;gt;
    &amp;lt;/DispatchContext.Provider&amp;gt;
  );
}

function TodoItem({ title, completed }) {
  const dispatch = useContext(DispatchContext);
  const state = useContext(StateContext);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Why Context Works Great With useReducer&lt;/h1&gt;
&lt;p&gt;What I find great about using Context with &lt;code&gt;useReducer&lt;/code&gt; is that it becomes trivial to allow any descendent component to update state in your reducer.&lt;/p&gt;
&lt;p&gt;All you need to expose is the &lt;code&gt;dispatch&lt;/code&gt; function and then any descendent function can &lt;code&gt;dispatch&lt;/code&gt; anything that it wants. Those state changes are still maintained in the reducer function, keeping that close locality of all state transitions.&lt;/p&gt;
&lt;p&gt;Also due to the API of Context you can clearly find which components are consuming the &lt;code&gt;dispatch&lt;/code&gt; function, allowing you to retain a clear view of how your data is flowing and changing. This is historically one of the strengths of React and it remains true even when you break out of the state to props paradigm.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Context is not always necessary. However I do think it is important for you to know how to use it, because there are certain occasions where it&apos;ll make your life far easier.&lt;/p&gt;
&lt;p&gt;If you have some page that has complex state transitions then &lt;code&gt;useReducer&lt;/code&gt; is a sure-fire answer.&lt;/p&gt;
&lt;p&gt;If you have deeply nested components that have to cause those state transitions then get using &lt;code&gt;useContext&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;All together you can make some incredibly powerful components with these two features. I&apos;m excited to see what you dream up.&lt;/p&gt;
</content:encoded></item><item><title>Level Up useReducer with Immer</title><link>https://hswolff.com/blog/level-up-usereducer-with-immer/</link><guid isPermaLink="true">https://hswolff.com/blog/level-up-usereducer-with-immer/</guid><pubDate>Fri, 10 May 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you&apos;re just joining us, this post is an add-on to my &lt;a href=&quot;/blog/why-i-love-usereducer/&quot;&gt;Why I Love useReducer&lt;/a&gt; post. If you haven&apos;t read that already, I recommend you take a second and have a peek before you continue reading this post!&lt;/p&gt;
&lt;p&gt;And if you want to skip to the third installment of this trilogy then go ahead and check out &lt;a href=&quot;/blog/how-to-usecontext-with-usereducer&quot;&gt;How To useContext With useReducer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, now that we all agree that &lt;code&gt;useReducer&lt;/code&gt; is the best thing since the wheel, let&apos;s talk about how we can make it even better. I&apos;m talking better than a wheel. Like, individually wrapped slices of cheese better.&lt;/p&gt;
&lt;p&gt;One of the things that &lt;code&gt;useReducer&lt;/code&gt; excels at is handling complex state tree mutations. If you have a lot of state going on in your component, then &lt;code&gt;useReducer&lt;/code&gt; is going to help you wrangle it under control such that you know how your state is changing.&lt;/p&gt;
&lt;p&gt;The one gotchya here is that for &lt;code&gt;useReducer&lt;/code&gt; to work correctly it requires you return a new instance of state to signal to React that data has changed and it needs to re-render.&lt;/p&gt;
&lt;p&gt;What that means is a lot of code in &lt;code&gt;useReducer&lt;/code&gt; functions that look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case &apos;submit&apos;:
    // Return a new object, so React knows things changed
    // Which means you have to manually...
    return {
        // Copy over state
        ...state,
        // Set new state value
        isSubmitting: true,
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works fine, however if your state tree gets heavily nested it becomes increasingly more difficult to remember to copy over values when making a new object instance.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case &apos;addTeamMember&apos;:
    return {
        // Copy over root state
        ...state,
        teams: {
            // Copy over teams so we don&apos;t just replace it
            ...state.teams,
            [teamId]: {
                // Also copy over this team&apos;s data
                ...state.teams[teamId]
                // And then add the new data
                [userId]: newUser,
            }
        }
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This level of manually copying over an object sucks.&lt;/p&gt;
&lt;p&gt;Luckily there&apos;s a library that makes this easy.&lt;/p&gt;
&lt;p&gt;It&apos;s called &lt;a href=&quot;https://github.com/immerjs/immer&quot;&gt;Immer&lt;/a&gt; and I love it.&lt;/p&gt;
&lt;h1&gt;Video&lt;/h1&gt;
&lt;p&gt;FYI this post is also in video form!&lt;/p&gt;
&lt;p&gt;See my teach you about using Immer in &lt;code&gt;useReducer&lt;/code&gt;, rather than you read these words and teach yourself! Don&apos;t put me out of a job, let me teach you! I love to talk, truly!&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/PjsGz6sNG3g&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h1&gt;Source Code&lt;/h1&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hswolff/youtube/blob/master/videos/why-i-love-usereducer/src/LoginUseReducerImmer.js&quot;&gt;If you want to jump straight to all the code, it&apos;s all available on GitHub.&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Immer&lt;/h1&gt;
&lt;p&gt;Immer let&apos;s you make immutable copies of objects via a mutable API.&lt;/p&gt;
&lt;p&gt;That&apos;s my most succinct explanation for what Immer is, and why it&apos;s awesome.&lt;/p&gt;
&lt;p&gt;Rather than having to deal with immutable data structures (i.e. &lt;a href=&quot;https://immutable-js.github.io/immutable-js/&quot;&gt;ImmutableJS&lt;/a&gt;) or fancy Babel transforms that deal with &lt;a href=&quot;https://en.wikipedia.org/wiki/Abstract_syntax_tree&quot;&gt;ASTs&lt;/a&gt;, Immer uses the very neat and clever idea of &lt;a href=&quot;https://en.wikipedia.org/wiki/Copy-on-write&quot;&gt;copy-on-write&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Essentially what that means is Immer tracks every mutable change you&apos;re making, and Immer will then replay those changes producing a new immutable copy of your object with all those changes applied.&lt;/p&gt;
&lt;h1&gt;What&apos;s it look like?&lt;/h1&gt;
&lt;p&gt;Immer has two primary ways of using it.&lt;/p&gt;
&lt;h2&gt;Function&lt;/h2&gt;
&lt;p&gt;The most common way of using Immer is via calling its function.&lt;/p&gt;
&lt;p&gt;By convention the function is called &lt;code&gt;produce&lt;/code&gt;, as it produces the next state.&lt;/p&gt;
&lt;p&gt;The first argument to &lt;code&gt;produce&lt;/code&gt; is the object you want to mutate.&lt;/p&gt;
&lt;p&gt;The second argument is a function that is called with that same object you want to mutate, except it&apos;s been modified slightly by Immer. It&apos;s actually been wrapped in a &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy&quot;&gt;Proxy&lt;/a&gt; so that Immer can track all the modifications you make.&lt;/p&gt;
&lt;p&gt;When your function finishes, Immer will go through all the changes you created, re-apply them to your original state object in an immutable manner, and produce your new immutable object.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import produce from &apos;immer&apos;;

const state = {
  team: {
    teamFoo: {
      harry: {},
    },
  },
};

const newState = produce(state, draft =&amp;gt; {
  draft.team.teamFoo.matthew = {};

  draft.team.newTeam = {
    joel: {},
    adam: {},
  };
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;newState&lt;/code&gt; is a new object with all those changes applied.&lt;/p&gt;
&lt;h2&gt;Curried&lt;/h2&gt;
&lt;p&gt;The curried API Immer inverts the arguments (as most curried APIs do). Rather than the first argument being the object you wish to modify, it becomes the function that tells Immer how you want to modify the object.&lt;/p&gt;
&lt;p&gt;What Immer returns then is a new version of your update function that is wrapped in the &lt;code&gt;produce&lt;/code&gt; function.&lt;/p&gt;
&lt;p&gt;Taking the example from above&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function updater(draft) {
  draft.team.teamFoo.matthew = {};

  draft.team.newTeam = {
    joel: {},
    adam: {},
  };
}

const curriedUpdater = produce(updater);

const state = {
  team: {
    teamFoo: {
      harry: {},
    },
  },
};

const newState = curriedUpdater(state);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That &lt;code&gt;curriedUpdater&lt;/code&gt; function is roughly equivalent to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const curriedUpdater = (state, ...args) =&amp;gt; {
  return produce(state, draft =&amp;gt; {
    updater(draft, ...args);
  });
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Such that you can now call &lt;code&gt;curriedUpdater&lt;/code&gt; and it&apos;ll automatically wrap the original &lt;code&gt;updater&lt;/code&gt; function with &lt;code&gt;produce&lt;/code&gt; so that all mutations produce immutable copies.&lt;/p&gt;
&lt;h1&gt;Use Immer with useReducer&lt;/h1&gt;
&lt;p&gt;So how does this apply to &lt;code&gt;useReducer&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;As we already saw above we have to make deeply nested changes to our state objects so that React knows it should re-render.&lt;/p&gt;
&lt;p&gt;We saw that ugly example of copying over state above.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case &apos;addTeamMember&apos;:
    return {
        // Copy over root state
        ...state,
        teams: {
            // Copy over teams so we don&apos;t just replace it
            ...state.teams,
            [teamId]: {
                // Also copy over this team&apos;s data
                ...state.teams[teamId]
                // And then add the new data
                [userId]: newUser,
            }
        }
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;How does that look like using Immer?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case &apos;addTeamMember&apos;:
    return produce(state, draft =&amp;gt; {
        draft.teams[teamId][userId] = newUser
    });
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just a little easier.&lt;/p&gt;
&lt;h2&gt;Curried useReducer Reducer Function&lt;/h2&gt;
&lt;p&gt;And if we use the curried API from Immer we can easily have our entire &lt;code&gt;useReducer&lt;/code&gt; reducer function leverage the powers of Immer:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Calling first argument draft instead of state as it&apos;s the immer draft object.
function reducerFunction(draft, action) {
  // reducer code goes here.
}

const curriedReducerFunction = produce(reducerFunction);

useReducer(curriedReducerFunction, initialState);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Everytime &lt;code&gt;useReducer&lt;/code&gt; runs it will call &lt;code&gt;curriedReducerFunction&lt;/code&gt; with the current state and the action object.&lt;/p&gt;
&lt;p&gt;However since we provided the curried function that means immer will run before it makes its way to our actual &lt;code&gt;reducerFunction&lt;/code&gt;, such that all the &lt;code&gt;reducerFunction&lt;/code&gt; ever gets is the &lt;code&gt;draft&lt;/code&gt; object from Immer!&lt;/p&gt;
&lt;h1&gt;Did you level up?&lt;/h1&gt;
&lt;p&gt;One thing to keep in mind before you go around converting all your reducer functions to use Immer is that you don&apos;t always need Immer. If you have a shallow object then copying over state yourself is &lt;em&gt;perfectly fine&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;In fact I&apos;d encourage you to only reach for Immer if you have a deeply nested and complex object. That&apos;s where the benefits of Immer truly come into play. That&apos;s where it&apos;ll help you write more maintainable and bug-free code.&lt;/p&gt;
&lt;p&gt;Don&apos;t rush to use Immer, know when it&apos;s appropriate to reach for this powerful tool.&lt;/p&gt;
&lt;p&gt;However when you do use Immer I think you&apos;ll have a great time. It makes state updates easy and clear to any reader what you&apos;re doing.&lt;/p&gt;
&lt;p&gt;Also you don&apos;t have to worry about forgetting to copy over state anywhere, Immer will handle that all for you.&lt;/p&gt;
&lt;p&gt;Immer is actually better than both the wheel and individually sliced cheese. It&apos;s so good it&apos;s just like an individually wrapped cheese wheel.&lt;/p&gt;
</content:encoded></item><item><title>Why I Love useReducer</title><link>https://hswolff.com/blog/why-i-love-usereducer/</link><guid isPermaLink="true">https://hswolff.com/blog/why-i-love-usereducer/</guid><pubDate>Fri, 03 May 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This post is the first of a trilogy. Check out the other two posts as well:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/blog/level-up-usereducer-with-immer/&quot;&gt;Level Up useReducer with Immer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/blog/how-to-usecontext-with-usereducer/&quot;&gt;How To useContext With useReducer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I didn&apos;t realize until recently how much I loved the &lt;a href=&quot;https://reactjs.org/docs/hooks-reference.html#usereducer&quot;&gt;React Hook useReducer&lt;/a&gt;. It&apos;s one of those advanced hooks, and while I read the documentation about it and already have a good amount of experience with &lt;a href=&quot;https://redux.js.org/&quot;&gt;Redux&lt;/a&gt;, it took a little while for me to fully understand just how powerful &lt;code&gt;useReducer&lt;/code&gt; can make your components.&lt;/p&gt;
&lt;p&gt;I made a video about this. To show my love for &lt;code&gt;useReducer&lt;/code&gt;. I encourage you to take a watch. The first 10 minutes are me setting the scene. Together we&apos;re building a pretty generic Login Form, one that has been written countless times. In the first half of the video I make the component using multiple &lt;code&gt;useState&lt;/code&gt; calls, as I normally would with a React Class Component.&lt;/p&gt;
&lt;p&gt;Then at around the 11 minute mark I start migrating my code to use &lt;code&gt;useReducer&lt;/code&gt; instead - and the fireworks fly!&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/o-nCM1857AQ&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hswolff/youtube/blob/master/videos/why-i-love-usereducer/src/LoginUseReducer.js&quot;&gt;All source code is available on GitHub.&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Why do I love useReducer?&lt;/h1&gt;
&lt;p&gt;The simple answer is that it lets you separate the &lt;em&gt;What&lt;/em&gt; from the &lt;em&gt;How&lt;/em&gt;. To expand upon that, it may be that &lt;em&gt;What&lt;/em&gt; a user wants to do is &lt;code&gt;login&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;useState&lt;/code&gt; when a user wants to &lt;code&gt;login&lt;/code&gt; I create function that handles a lot of the &lt;em&gt;How&lt;/em&gt;. &lt;em&gt;How&lt;/em&gt; my component has to behave when a user wants to &lt;code&gt;login&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sets &lt;code&gt;loading&lt;/code&gt; to true&lt;/li&gt;
&lt;li&gt;Clears out old &lt;code&gt;error&lt;/code&gt; state&lt;/li&gt;
&lt;li&gt;Disables the button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With &lt;code&gt;useReducer&lt;/code&gt; all my component has to do is think about &lt;em&gt;What&lt;/em&gt; the user wants. Which is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;dispatch(&apos;login&apos;)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After that all the &lt;em&gt;How&lt;/em&gt; is handled inside the &lt;code&gt;loginReducer&lt;/code&gt; function.&lt;/p&gt;
&lt;p&gt;Furthermore, any future &lt;em&gt;How&lt;/em&gt; questions become completely centralized inside of that one &lt;code&gt;loginReducer&lt;/code&gt; function. My component can just keep on thinking about the &lt;em&gt;What&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;It&apos;s a subtle distinction but an extremely powerful one.&lt;/p&gt;
&lt;p&gt;To further show the point &lt;a href=&quot;https://github.com/hswolff/youtube/tree/master/videos/why-i-love-usereducer&quot;&gt;you can check out the full source code here&lt;/a&gt; or see these inline examples.&lt;/p&gt;
&lt;p&gt;I&apos;m going to ignore showing the UI, if you want to see that you can check out the repo. For now I just want to focus on the data we&apos;re storing and updating.&lt;/p&gt;
&lt;h1&gt;Using useState&lt;/h1&gt;
&lt;p&gt;Here I have 5 calls to useState to manage all the distinct state transitions.&lt;/p&gt;
&lt;p&gt;In my &lt;code&gt;onSubmit&lt;/code&gt; call I have to careful orchestrate all the state changes that I want.&lt;/p&gt;
&lt;p&gt;They&apos;re tightly coupled to the onSubmit handler and awkward to extract.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function LoginUseState() {
  const [username, setUsername] = useState(&apos;&apos;);
  const [password, setPassword] = useState(&apos;&apos;);
  const [isLoading, showLoader] = useState(false);
  const [error, setError] = useState(&apos;&apos;);
  const [isLoggedIn, setIsLoggedIn] = useState(false);

  const onSubmit = async e =&amp;gt; {
    e.preventDefault();

    setError(&apos;&apos;);
    showLoader(true);

    try {
      await login({ username, password });
      setIsLoggedIn(true);
    } catch (error) {
      setError(&apos;Incorrect username or password!&apos;);
      showLoader(false);
      setUsername(&apos;&apos;);
      setPassword(&apos;&apos;);
    }
  };

  return; // remaining UI code here
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Using useReducer&lt;/h1&gt;
&lt;p&gt;While it may be overall longer, I would argue that it&apos;s much easier to read and track what&apos;s going on.&lt;/p&gt;
&lt;p&gt;If you jump straight to the &lt;code&gt;onSubmit&lt;/code&gt; function I can now clearly show the intent of the user. There&apos;s only 3 behaviors that can happen, &apos;login&apos;, &apos;success&apos;, and &apos;error&apos;. What that means is not a concern of my component, it&apos;s all handled in the &lt;code&gt;loginReducer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Even better, it becomes easier for me to make wide-ranging changes to state changes because all the state changes are centrally located.&lt;/p&gt;
&lt;p&gt;And even more exciting is that all state changes become easy to share by default.&lt;/p&gt;
&lt;p&gt;If I want to show my error state from elsewhere in the component I can easily re-use the same &lt;code&gt;dispatch({ type: &apos;error&apos; })&lt;/code&gt; and I&apos;m good to go.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function LoginUseReducer() {
  const [state, dispatch] = useReducer(loginReducer, initialState);
  const { username, password, isLoading, error, isLoggedIn } = state;

  const onSubmit = async e =&amp;gt; {
    e.preventDefault();

    dispatch({ type: &apos;login&apos; });

    try {
      await login({ username, password });
      dispatch({ type: &apos;success&apos; });
    } catch (error) {
      dispatch({ type: &apos;error&apos; });
    }
  };

  return; // UI here
}

function loginReducer(state, action) {
  switch (action.type) {
    case &apos;field&apos;: {
      return {
        ...state,
        [action.fieldName]: action.payload,
      };
    }
    case &apos;login&apos;: {
      return {
        ...state,
        error: &apos;&apos;,
        isLoading: true,
      };
    }
    case &apos;success&apos;: {
      return {
        ...state,
        isLoggedIn: true,
        isLoading: false,
      };
    }
    case &apos;error&apos;: {
      return {
        ...state,
        error: &apos;Incorrect username or password!&apos;,
        isLoggedIn: false,
        isLoading: false,
        username: &apos;&apos;,
        password: &apos;&apos;,
      };
    }
    case &apos;logOut&apos;: {
      return {
        ...state,
        isLoggedIn: false,
      };
    }
    default:
      return state;
  }
}

const initialState = {
  username: &apos;&apos;,
  password: &apos;&apos;,
  isLoading: false,
  error: &apos;&apos;,
  isLoggedIn: false,
};
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Think like the user&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;useReducer&lt;/code&gt; gets you to write code the way a user will interact with your component.&lt;/p&gt;
&lt;p&gt;You are encouraged to think in the &lt;em&gt;What&lt;/em&gt; and centralize all &lt;em&gt;How&lt;/em&gt; questions inside the reducer.&lt;/p&gt;
&lt;p&gt;I&apos;m so excited &lt;code&gt;useReducer&lt;/code&gt; is now built-in to React. It&apos;s one more reason why I love it.&lt;/p&gt;
</content:encoded></item><item><title>What is React Ink?</title><link>https://hswolff.com/blog/what-is-react-ink/</link><guid isPermaLink="true">https://hswolff.com/blog/what-is-react-ink/</guid><pubDate>Sun, 14 Apr 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The first time I learned about &lt;a href=&quot;https://github.com/vadimdemedes/ink&quot;&gt;React Ink&lt;/a&gt; I was immediately intrigued. A project that lets me take all my React knowledge and use it to make a CLI program? Sounds great to me!&lt;/p&gt;
&lt;p&gt;In this video we&apos;ll explore what React Ink is and what you can do with it. We&apos;ll get up and running from a blank project and get our own React Ink project working locally.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/bk1tmNKtXBo&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;However, I know some people prefer to read rather than write, so for all of you that prefer to use your eyes, keep on reading.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hswolff/youtube/tree/master/videos/what-is-react-ink&quot;&gt;Or if you prefer to just see the code, then by all means click on through.&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;What is React Ink?&lt;/h2&gt;
&lt;p&gt;React Ink lets you write CLI programs using React. That&apos;s the most &quot;to the point&quot; explanation that I can come up with. However let&apos;s delve into what that means.&lt;/p&gt;
&lt;p&gt;If you&apos;re writing a regular website with React you need to use two things: &lt;a href=&quot;https://reactjs.org/docs/react-api.html&quot;&gt;React&lt;/a&gt; and &lt;a href=&quot;https://reactjs.org/docs/react-dom.html&quot;&gt;React DOM&lt;/a&gt;. Often these two things are conflated because 99% of the time you&apos;re using them together without realizing it. However there is an important distinction between these two libraries (and yes they are two separate npm packages).&lt;/p&gt;
&lt;p&gt;React is the package that you use to write React Components. The components you write with React describe what they do and how they look. You can make a custom &lt;code&gt;Button&lt;/code&gt; component and that can be reused in any of your other components. You can listen to lifecycle hooks and react to updates.&lt;/p&gt;
&lt;p&gt;React DOM is how your React Components come to life. It&apos;s the library that translates your abstract descriptions of your React Components into actual DOM elements in a browser. In React ecosystem parlance it&apos;s called a &apos;renderer&apos;. There are many renderers for React. React DOM is one. React Native is another. It&apos;ll take your React code and then render it into a native app.&lt;/p&gt;
&lt;p&gt;React Ink is also a renderer. It&apos;ll take your React Components and render it into a terminal. Granted, you need to use the components that React Ink provides, so that the React Ink renderer knows how to transform that into a CLI, but this separation of concerns, of describing your application (React) to then rendering your application (React DOM / React Native / React Ink) is one of the fundamental strengths of the React architecture.&lt;/p&gt;
&lt;h2&gt;What does React Ink look like?&lt;/h2&gt;
&lt;p&gt;React Ink comes with a few built in components that let you create your CLI program. You can &lt;a href=&quot;https://github.com/vadimdemedes/ink#built-in-components&quot;&gt;see the full list here&lt;/a&gt; but let me highlight a few of the ones that I&apos;ve played around with:&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/vadimdemedes/ink#box&quot;&gt;Box&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Essentially a &lt;code&gt;&amp;lt;div /&amp;gt;&lt;/code&gt; for the CLI. It lets you position elements in your terminal to make your CLI program look as pretty as possible.&lt;/p&gt;
&lt;p&gt;You may wonder how you actually handle layout in a CLI if there&apos;s no CSS? Well &lt;code&gt;Box&lt;/code&gt; supports properties that let you control layout. Props such as &lt;code&gt;height&lt;/code&gt; and &lt;code&gt;padding&lt;/code&gt; and all related flex properties. Essentially anything you&apos;d need to create a layout &lt;code&gt;Box&lt;/code&gt; should have you covered.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/vadimdemedes/ink#color&quot;&gt;Color&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A CLI is boring if it&apos;s all white text on a black background. Luckily the &lt;code&gt;Color&lt;/code&gt; component lets you add some flair to your CLI. Via some props you can make an otherwise boring CLI look pretty with shades of blue.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;Color rgb={[255, 255, 255]} bgKeyword=&quot;magenta&quot;&amp;gt;
  I am pretty!
&amp;lt;/Color&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Everything else&lt;/h3&gt;
&lt;p&gt;This is just a very small sample of what Components are availabe for your use.&lt;/p&gt;
&lt;p&gt;And if that&apos;s not enough you can always write &lt;a href=&quot;https://github.com/vadimdemedes/ink#useful-components&quot;&gt;your own custom Ink Component&lt;/a&gt;. There&apos;s already a handful available in the community and it&apos;s never too late to create your own.&lt;/p&gt;
&lt;h2&gt;It&apos;s Just React™&lt;/h2&gt;
&lt;p&gt;Outside of having to use React Ink Components, everything else is just React. Which means you can use Class Components with state or Function Components with Hooks. You can use Fragments and you can use regular event handlers. It&apos;s Just React!&lt;/p&gt;
&lt;p&gt;For example there&apos;s a &lt;a href=&quot;https://github.com/vadimdemedes/ink-text-input&quot;&gt;text input component&lt;/a&gt;. If you want to get input from someone in the CLI this is how you&apos;d do it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import React from &apos;react&apos;;
import { render, Box } from &apos;ink&apos;;
import TextInput from &apos;ink-text-input&apos;;

class Greeting extends React.Component {
  state = {
    name: &apos;&apos;,
  };

  onChange = name =&amp;gt; {
    this.setState({ name });
  };

  render() {
    return (
      &amp;lt;Box&amp;gt;
        &amp;lt;Box marginRight={1}&amp;gt;
          &amp;lt;Color blue&amp;gt;Hello!&amp;lt;/Color&amp;gt;
          What&apos;s your name?
        &amp;lt;/Box&amp;gt;

        {this.state.name ? (
          &amp;lt;Color green&amp;gt;Hello {this.state.name}&amp;lt;/Color&amp;gt;
        ) : (
          &amp;lt;TextInput value={this.state.name} onChange={this.onChange} /&amp;gt;
        )}
      &amp;lt;/Box&amp;gt;
    );
  }
}

render(&amp;lt;Greeting /&amp;gt;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Looks just like a React app doesn&apos;t it?&lt;/p&gt;
&lt;h2&gt;Wrap-up&lt;/h2&gt;
&lt;p&gt;This is just the beginning of exploring what you can do with React Ink.&lt;/p&gt;
&lt;p&gt;This is also why I love React. It lets you take all your current React knowledge and apply it in an entirely new context. It really lets React stay true to its mantra of being a framework that you learn once, write everywhere.&lt;/p&gt;
&lt;p&gt;If you&apos;ve ever tried to write a nice CLI yourself you know that it&apos;s not a pleasant experience. Adding React into the mix suddently makes it fun again. I&apos;m very excited to see what you come up with!&lt;/p&gt;
</content:encoded></item><item><title>Setting Up TypeScript</title><link>https://hswolff.com/blog/setting-up-typescript/</link><guid isPermaLink="true">https://hswolff.com/blog/setting-up-typescript/</guid><pubDate>Sun, 10 Mar 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Now that we&apos;ve gotten &lt;a href=&quot;/blog/what-is-typescript/&quot;&gt;a nice and easy introduction to &lt;em&gt;what&lt;/em&gt; TypeScript is&lt;/a&gt; we can start talking about how to code with TypeScript. Specifically how to get our local dev environment set up so that we can actually write TypeScript code. That means getting TypeScript to compile and type check on our local machine.&lt;/p&gt;
&lt;p&gt;I&apos;m not going to go into how TypeScript works yet - that&apos;ll be covered in a future blog post. This is in many ways the pre-requisite to that eventual guide on how to write TypeScript code. I feel it&apos;s important that we have our dev environment set up correctly so we can validate that we&apos;re writing correct TypeScript code.&lt;/p&gt;
&lt;p&gt;You can consume this content in two glorious ways. In video form, which I must admit will be rife with great humor and dazzling visuals, or you can consume it the way of cave men: with scratches on a wall. To which I mean in written form.&lt;/p&gt;
&lt;p&gt;There&apos;s two parts to this blog post because there&apos;s two ways you can compile TypeScript code.&lt;/p&gt;
&lt;p&gt;The first is with the official &lt;a href=&quot;https://www.npmjs.com/package/typescript&quot;&gt;TypeScript CLI &lt;code&gt;tsc&lt;/code&gt;&lt;/a&gt;. That&apos;s the path most new TypeScript projects follow. It provides transpiling and type checking, making it an all in one solution that is easy to get up and going with.&lt;/p&gt;
&lt;p&gt;The other is with &lt;a href=&quot;https://babeljs.io/&quot;&gt;Babel&lt;/a&gt;. Starting with version 7 of Babel there is now a plugin that adds support for &lt;a href=&quot;https://babeljs.io/docs/en/babel-preset-typescript&quot;&gt;transpiling TypeScript code with Babel&lt;/a&gt;. The one caveat is that Babel only does the transpiling, it doesn&apos;t check types at all. To still get the full TypeScript experience you&apos;ll still need the official TypeScript CLI and use it for type checking your code.&lt;/p&gt;
&lt;h1&gt;With TypeScript&apos;s CLI&lt;/h1&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/sVYlv78IY8o&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;First thing we need to do is get ourselves the &lt;code&gt;tsc&lt;/code&gt; program installed. Let&apos;s let our favorite package manager handle that for us:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm install -g typescript
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will install &lt;code&gt;cli&lt;/code&gt; globally making it available to compile TypeScript anywhere on our system.&lt;/p&gt;
&lt;p&gt;Let&apos;s write our first (basic) TypeScript file so we can start playing around with &lt;code&gt;tsc&lt;/code&gt;. Let&apos;s name this file &lt;code&gt;greeter.ts&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// greeter.ts

function greeting(name: string) {
  console.log(`Hello ${name}`);
}

greeting(&apos;YouTube!&apos;);

greeting(&apos;1&apos;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From here we can quickly transpile that code via:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tsc greeter.ts
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see a new file added in your directory called &lt;code&gt;greeter.js&lt;/code&gt;. If you peek inside it you&apos;ll see that TypeScript transpiled your code! Great success transpiling your first TypeScript file!&lt;/p&gt;
&lt;p&gt;If you want you can take this a little further and make a TypeScript project. You can create a &lt;code&gt;tsconfig.json&lt;/code&gt; file which controls the behavior of TypeScript, allowing you to customize its behavior for your projects needs.&lt;/p&gt;
&lt;p&gt;The best way to create that file is via&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tsc --init
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This creates a great starting &lt;code&gt;tsconfig.json&lt;/code&gt; file with sensible defaults and inline comments for every configuration. One that I enjoy changing is the &lt;code&gt;target&lt;/code&gt; setting.&lt;/p&gt;
&lt;p&gt;Try changing &lt;code&gt;target&lt;/code&gt; to &lt;code&gt;es2015&lt;/code&gt; and then re-run &lt;code&gt;tsc&lt;/code&gt;. If you want to use your &lt;code&gt;tsconfig.json&lt;/code&gt; file then you can just run &lt;code&gt;tsc&lt;/code&gt; by itself and it&apos;ll auto find the configuration file.&lt;/p&gt;
&lt;p&gt;Did you notice the compiled output changed? It kept the template string this time! That&apos;s because we&apos;re now targeting an environment of &lt;code&gt;es2015&lt;/code&gt; which has support for template strings, so TypeScript doesn&apos;t transiple it away!&lt;/p&gt;
&lt;h1&gt;With Babel&lt;/h1&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/WRfhMI1gskk&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;Getting started with Babel requires a little more work than just using TypeScript. For starters we need more than one npm package. So let&apos;s initialize an npm project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm init -y
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This creates a &lt;code&gt;package.json&lt;/code&gt; file and skips all prompts so we can just get on our merry way of installing even &lt;em&gt;more&lt;/em&gt; packages!&lt;/p&gt;
&lt;p&gt;Then we need to install the &lt;a href=&quot;https://babeljs.io/setup#installation&quot;&gt;Babel CLI&lt;/a&gt; and associated &lt;a href=&quot;https://babeljs.io/docs/en/babel-preset-typescript&quot;&gt;Babel TypeScript plugin&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm install --save-dev @babel/core @babel/cli
npm install --save-dev @babel/preset-typescript
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We need to tell Babel to use our plugin. The best approach for that is with a &lt;code&gt;.babelrc&lt;/code&gt; file. Create a &lt;code&gt;.babelrc&lt;/code&gt; file and put the following inside:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;presets&quot;: [&quot;@babel/preset-typescript&quot;]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And now we can finally compile our TypeScript file!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npx babel --extensions &quot;.ts&quot; greeter.ts -d dist
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This uses npm&apos;s &lt;a href=&quot;https://www.npmjs.com/package/npx&quot;&gt;npx feature&lt;/a&gt; which lets us easily call into CLI programs installed within &lt;code&gt;node_modules&lt;/code&gt;. We need to tell Babel that we want it to also check &lt;code&gt;.ts&lt;/code&gt; extensions which is where we wrote our TypeScript file.&lt;/p&gt;
&lt;p&gt;With that you should see your transpiled &lt;code&gt;greeter.js&lt;/code&gt; file made with some pretty JavaScript inside! Yay!&lt;/p&gt;
&lt;p&gt;Note that Babel does not do any type checking. It just transpiles. To do type checking you&apos;ll need the &lt;code&gt;tsc&lt;/code&gt; CLI as described above.&lt;/p&gt;
&lt;p&gt;In this situation, when used with Babel you may want to turn on the &lt;code&gt;noEmit&lt;/code&gt; configuration for TypeScript. This tells TypeScript to not output any files, and just let it focus on doing type checking.&lt;/p&gt;
</content:encoded></item><item><title>What is TypeScript?</title><link>https://hswolff.com/blog/what-is-typescript/</link><guid isPermaLink="true">https://hswolff.com/blog/what-is-typescript/</guid><pubDate>Mon, 18 Feb 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;TypeScript is probably the best way to add static typing to JavaScript. That&apos;s probably all that people really know about TypeScript though - that it adds static types. I like to delve a little deeper into a topic before I start to learn it, so I figured I&apos;d take you along for the ride.&lt;/p&gt;
&lt;p&gt;Check out the video for all the details, or read about the highlights from the video below.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/Ap_LrI8Wibo&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;It&apos;s a strict syntactical superset of JavaScript.&lt;/p&gt;
&lt;p&gt;Why does this matter? Because any JavaScript application automatically becomes a TypeScript application.&lt;/p&gt;
&lt;p&gt;Anders Hejlsberg is the lead developer of TypeScript. This matters because he knows a thing or two about writing a programming language, having created C#, Delphi, and Turbo Pascal. So, he knows a thing or two about how to make a programming language.&lt;/p&gt;
&lt;p&gt;TypeScript was first made public in October 2012, which was far earlier than I had ever imagined.&lt;/p&gt;
&lt;p&gt;TypeScript is by no means the first static type checker for JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developers.google.com/closure/compiler/&quot;&gt;Google Closure Compiler&lt;/a&gt; was probably one of the first ones. It was released all the way back in 2009. It&apos;s method of adding static types was via JSDoc comments. As you annotated code with JSDoc comment blocks the Closure Compiler parsed it and imbued your code with static types. Closure Compiler is still developed and used, however mostly internally to Google.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://flow.org/&quot;&gt;Flowtype&lt;/a&gt; is another popular static type checker. Created by Facebook, it adds static type information via inline annotations (similar to TypeScript). It&apos;s not as popular or widely used in the open source community as TypeScript.&lt;/p&gt;
&lt;h1&gt;Why TypeScript?&lt;/h1&gt;
&lt;p&gt;So we talked about what is TypeScript, but now let&apos;s talk about why you should consider using TypeScript.&lt;/p&gt;
&lt;p&gt;I delve into more detail in the video but here are the bullet point reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Due to types being checked at compile time, and due to the fact that type information is in many ways documentation, TypeScript effectively provides code enforced documentation. For that reason alone you should try out TypeScript.&lt;/li&gt;
&lt;li&gt;Great developer experience via great IDE support. In particular the experience of writing a TypeScript application with VSCode is almost as good as a Java IDE.&lt;/li&gt;
&lt;li&gt;Helps maintain a large application across a large team.&lt;/li&gt;
&lt;li&gt;It&apos;s definitely the market leader right now in terms of static type checkers. This should provide a sense of calm that your investment in learning won&apos;t be wasted.&lt;/li&gt;
&lt;li&gt;They’re very good with community feedback.&lt;/li&gt;
&lt;li&gt;They publicize and follow a &lt;a href=&quot;https://github.com/Microsoft/TypeScript/wiki/Roadmap&quot;&gt;Public Roadmap&lt;/a&gt; so you know what they&apos;re going to work on next, and when you should expect it.&lt;/li&gt;
&lt;li&gt;Monthly release cadence.&lt;/li&gt;
&lt;li&gt;Framework support: Angular, React (with JSX), Vue.js, and all others.&lt;/li&gt;
&lt;li&gt;It fully supports the ability to incrementally migrate a JavaScript application to a TypeScript application.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>Preview of the JavaScript Ecosystem in 2019</title><link>https://hswolff.com/blog/preview-of-the-javascript-ecosystem-in-2019/</link><guid isPermaLink="true">https://hswolff.com/blog/preview-of-the-javascript-ecosystem-in-2019/</guid><pubDate>Sat, 09 Feb 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I’m not really in the business of telling the future however I do think it would be fun to mirror all of my &lt;a href=&quot;/blog/javascript-year-in-review-2018/&quot;&gt;year&lt;/a&gt; in &lt;a href=&quot;/blog/react-year-in-review-2018/&quot;&gt;review&lt;/a&gt; posts with one that looks forward to the year to come.&lt;/p&gt;
&lt;p&gt;There’s a lot of new things I’m very excited about this coming year. I don’t know when I’ll be able to lay my grubby hands onto all these new shiny things but I can tell you that I’m practically drooling at all the exciting new things that are coming in 2019.&lt;/p&gt;
&lt;p&gt;There’s a whole range of new things happening this year. From JavaScript frameworks, to CSS advancements, to general ecosystem trends. All of them are exciting and further proof that there’s no better time to be a JavaScript developer than today.&lt;/p&gt;
&lt;p&gt;What follows is a preview of things to look forward to in 2019.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/et_1NoEvVww&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h1&gt;React&lt;/h1&gt;
&lt;p&gt;Every year I think that React has peaked and every year I’m proven wrong. 2019 is shaping up to be one of the most monumental years of React since the deprecation of &lt;a href=&quot;https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#migrating-from-reactcreateclass&quot;&gt;React.createClass&lt;/a&gt; in favor of classes.&lt;/p&gt;
&lt;p&gt;How is React going to disrupt classes? By going to functions of course. That’s why &lt;a href=&quot;https://reactjs.org/docs/hooks-intro.html&quot;&gt;React Hooks&lt;/a&gt; are such a big deal. While the React team has no current plans to deprecate classes, by introducing Hooks they are laying the groundwork to enable a future where React is no longer dependent on class Components. It’s kinda wild to see this full circle of changes coming to fruition. From a JS object, to class, to function. Maybe next year the React team will migrate from functions to using RegEx’s as how a component is defined (that’s a joke, to be clear).&lt;/p&gt;
&lt;p&gt;The React team laid out their &lt;a href=&quot;https://reactjs.org/blog/2018/11/27/react-16-roadmap.html&quot;&gt;roadmap for upcoming React features in 16.x&lt;/a&gt; and the entire post is worth a read. There’s large changes coming, all of which is going to vastly change (for the better!) the way people write their applications.&lt;/p&gt;
&lt;p&gt;The biggest one I’m excited about is &lt;a href=&quot;https://reactjs.org/blog/2018/11/27/react-16-roadmap.html#react-16x-mid-2019-the-one-with-suspense-for-data-fetching&quot;&gt;Suspense for Data Fetching&lt;/a&gt;. This feature solves a long-standing hole in functionality that Redux tried to solve many years ago. It answers the question of “How do I load async data in React and make it accessible throughout my entire application as easy as possible?” Suspense for Data fetching answers that question and provides a solution that is as clever as it is naughty. You may have heard stories about how React is throwing Promises…well that’s to achieve the goals in this feature.&lt;/p&gt;
&lt;h1&gt;Vue.js 3.0&lt;/h1&gt;
&lt;p&gt;I don’t personally use Vue.js however I admire the framework and the smart work that has been put into making it accessible to all skill levels while also being as flexible as possible.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://medium.com/the-vue-point/plans-for-the-next-iteration-of-vue-js-777ffea6fabf&quot;&gt;The Vue.js team is kicking it up a notch this year with Vue.js 3.0&lt;/a&gt;. This blog post is all the details I currently know about Vue 3.0, however if all the promises are delivered then Vue 3.0 is going to be one incredible framework.&lt;/p&gt;
&lt;p&gt;One of the big things I love about Vue.js is they unabashedly incorporate the best ideas from peer frameworks into Vue.js in a way that feels natural to a Vue.js engineer. Vue 3.0 seems to be continuing this great tradition but kicking it up a notch.&lt;/p&gt;
&lt;p&gt;When Vue.js 3.0 is released I’m going to play with it immediately. It sounds very exciting and I love seeing how different people solve the same problem. That problem being: how do you make UI development easier? Vue.js has its eye on the prize.&lt;/p&gt;
&lt;h1&gt;CSS&lt;/h1&gt;
&lt;p&gt;Welcome to the unsung hero of the internet, CSS. I predict big things for CSS in 2019.&lt;/p&gt;
&lt;p&gt;The first is the continued growth and usage of &lt;strong&gt;CSS in JS&lt;/strong&gt;, led in large part by &lt;a href=&quot;https://www.styled-components.com/&quot;&gt;styled-components&lt;/a&gt; and &lt;a href=&quot;https://emotion.sh/&quot;&gt;emotion.sh&lt;/a&gt;. I honestly never tire of the Twitter debates about the merits of CSS in JS (it’s nuanced!) but I do predict continued momentum for CSS-in-JS usage. Why? They solve a pain point that vanilla CSS has no current solution for. Namely the C in CSS. That cascade is hard to wrangle, especially amongst a large team. CSS-in-JS is the cascade-wrangler.&lt;/p&gt;
&lt;p&gt;If you follow my &lt;a href=&quot;https://www.youtube.com/user/hswolff&quot;&gt;YouTube videos&lt;/a&gt; you’ll know that I’m long been very excited about &lt;a href=&quot;https://developers.google.com/web/updates/2016/05/houdini&quot;&gt;CSS Houdini.&lt;/a&gt; The easiest way to explain it is that it is what Babel is to JavaScript - a way to allow developers to use advanced CSS features today. It does this via creating new APIs that let UI engineers control and alter how CSS behaves on your page.&lt;/p&gt;
&lt;p&gt;CSS Houdini is itself a project that encompasses many different APIs. One of them, the one I’m most excited about, is called the &lt;a href=&quot;https://github.com/w3c/css-houdini-drafts/blob/master/css-layout-api/EXPLAINER.md&quot;&gt;Layout API&lt;/a&gt;. The Layout API exposes API methods that allows developers to customize how content is laid out on the page. You know how we have &lt;code&gt;display: block&lt;/code&gt; and &lt;code&gt;display: flex&lt;/code&gt;? The Layout API lets you create your own custom &lt;code&gt;display: magic&lt;/code&gt; and you define its behavior. Very very exciting stuff.&lt;/p&gt;
&lt;p&gt;Last piece of CSS prediction is that 2019 will finally be the year that CSS Grids take off. It’s been a couple of years that CSS Grid has been available and the browsers that support CSS Grid have now had a chance to spread across the internet. Such that, this is the year where it finally becomes safe and exciting to start using CSS Grid in production. I myself need to learn more about it as it’s a very exciting piece of technology. If you only support evergreen browsers and not IE then CSS Grids is ready for the big time!&lt;/p&gt;
&lt;h1&gt;Webpack 5&lt;/h1&gt;
&lt;p&gt;Seems like Webpack has a major release every year, which is quite the lovely release cadence. This year is no exception with the first &lt;a href=&quot;https://github.com/webpack/webpack/issues/8537&quot;&gt;Webpack 5 Alpha already released&lt;/a&gt; and feedback is being solicited.&lt;/p&gt;
&lt;p&gt;The marquee feature in Webpack 5 is persistent caching, a feature I’ve long been excited about. The gist of this feature is now, when you kill Webpack and start it back up, it won’t have to restart all of its work. It can pick up where it left off as it saves its state to disk, ready to be used next time.&lt;/p&gt;
&lt;p&gt;Also it’s great to see such a depended on piece of technology be even and measured with their release cadence. If we had a new Webpack version every month I don’t think that would be good for the wider JavaScript ecosystem at all.&lt;/p&gt;
&lt;h1&gt;TypeScript&lt;/h1&gt;
&lt;p&gt;TypeScript’s popularity has started to seriously increase in the past couple of months. In particular, January 2019 seemed to be the month of TypeScript - it was all that people seemed to be talking about.&lt;/p&gt;
&lt;p&gt;I predict this to be a big year for TypeScript as we see it continue to assert its dominance as the defacto language to use if you want types in JavaScript. Flow squandered any competitive advantage they had by not being good open source participants, leaving the door wide open for TypeScript to take the lead.&lt;/p&gt;
&lt;p&gt;What’s great about an increase in TypeScript popularity is how it’ll have a knock on effect for VSCode. VSCode (my editor of choice, my editor of love) derives a lot of its functionality from leveraging TypeScript under the hood. As TypeScript continues to grow and mature it’ll simply make VSCode better as well.&lt;/p&gt;
&lt;p&gt;I expect VSCode to grow its feature set, racing for feature parity with a typical IDE however never lose its text editor feel. That’s the combo that I yearn for. Simple feel of a text editor with all the bells and whistles of a fancy IDE. I think VSCode has a great shot to obtain that complex middle ground, and this year will see great growth toward that end.&lt;/p&gt;
&lt;h1&gt;ReasonML&lt;/h1&gt;
&lt;p&gt;ReasonML is another compile to JavaScript language, albeit one that is a little less familiar than TypeScript. It’s a language derived from OCaml that through the ingenuity of a project called BuckleScript can compile ReasonML code into JavaScript code.&lt;/p&gt;
&lt;p&gt;It’s still very much early days for ReasonML, with 2018 being a steady year of growth for early adopters. 2019 might prove to be a bigger year for ReasonML, albeit one that isn’t explosive. It’s still a niche, but one that I predict will have some respectable growth.&lt;/p&gt;
&lt;p&gt;The bigger story to me with ReasonML is how it can compile to native code. ReasonML is built on top of OCaml, which already can compile to native code, and there’s already some very exciting projects that are in the works. Also due to ReasonML’s syntax trying to mirror JavaScript as close as possible, it makes for a potentially very powerful combination. One such project is called Revery, which is trying to fashion itself an Electron toolkit - I.e write ReasonML code and then create a native app. Very exciting things.&lt;/p&gt;
&lt;h1&gt;Node&lt;/h1&gt;
&lt;p&gt;2019 is going to be a turning point for Node. Two big things are brewing for Node.&lt;/p&gt;
&lt;p&gt;The first is native ES Modules support. There’s currently support for ES Modules in Node behind a feature flag and requiring a file extension of &lt;code&gt;.mjs&lt;/code&gt;. I’m not the biggest fan of this restriction and there’s many in the community who feel the same way. I hope that this year Node is able to make solid progress on its ES Modules story, paving the way for stronger unification of Node and JavaScript. I’m not very hopeful it’ll happen in 2019, as there’s a lot to consider and work through, but I anticipate good progress to be made in 2019.&lt;/p&gt;
&lt;p&gt;Another very interesting trend I predict happening in 2019 is multi threaded Node applications. &lt;a href=&quot;https://nodejs.org/api/worker_threads.html&quot;&gt;Worker Threads&lt;/a&gt; is a brand new module available in Node 11, and once it makes it way to Node 12 (a LTS release) I can’t wait for the first multi-threaded Node app to be released.&lt;/p&gt;
&lt;p&gt;Historically Node apps have been good for non-CPU bound use cases. This is due to the JS run time loop and not having any way to offload CPU intensive tasks to a separate worker thread. Well with this new module that is no longer the case - we’ll be able to easily spin out a new thread to take care of whatever task we need.&lt;/p&gt;
&lt;p&gt;This small addition is going to have a large ripple effect across the Node ecosystem, opening up a whole new range of applications. I’m very excited about it.&lt;/p&gt;
&lt;p&gt;To round out this Node prediction section I want to mention an upcoming project named &lt;a href=&quot;https://deno.land/&quot;&gt;Deno&lt;/a&gt;. Created by Ryan Dahl, the original creator of Node.js, Deno is in many ways his second attempt at a server-side JavaScript runtime.&lt;/p&gt;
&lt;p&gt;Deno has TypeScript built in and ES Modules built in. It has a different approach towards handling dependencies, and it’s written in Rust. It’s a project I have my eye on, and I’m very curious if its popularity will grow.&lt;/p&gt;
&lt;p&gt;Node is so entrenched at this point that I find it very doubtful that Deno could supersede Node, but competition is always good. Maybe it’ll force Node to gets its ES Modules story figured out.&lt;/p&gt;
&lt;h1&gt;npm &amp;amp; Yarn&lt;/h1&gt;
&lt;p&gt;2019 is going to be the year of the package manager revolution. Both npm and Yarn have huge plans on how to take their projects to the next level and they’re both very exciting.&lt;/p&gt;
&lt;p&gt;npm is working on &lt;a href=&quot;https://github.com/npm/tink&quot;&gt;Tink&lt;/a&gt;, a reimagined approach to how dependencies are installed. The high level thought is that instead of re-installing the same package in all your applications and putting it into separate &lt;code&gt;node_modules&lt;/code&gt; folders, Tink aims to have a global cache and link up those packages and versions into the &lt;code&gt;node_modules&lt;/code&gt; folder of your application. This has the aim to drastically improve installation speed and decrease the size of your &lt;code&gt;node_modules&lt;/code&gt; folder.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/yarnpkg/yarn/issues/6953&quot;&gt;Yarn recently laid out their 2.0 roadmap&lt;/a&gt; and it’s audacious, to say the least. Yarn seems to want to become a package manager platform, with enough flexibility to support installing packages across languages, not exclusive to JavaScript. Imagine installing dependencies with Yarn for a PHP app. Wild!&lt;/p&gt;
&lt;p&gt;These two plans predict big things for package management in the JavaScript in 2019. I can’t wait to start playing with these two things. I can only imagine the amazing lift in developer productivity they’ll bring.&lt;/p&gt;
&lt;h1&gt;GitHub&lt;/h1&gt;
&lt;p&gt;Here’s an interesting one for you - I predict that Microsoft’s purchase of GitHub is going to be a huge boon to the development and feature of GitHub.&lt;/p&gt;
&lt;p&gt;The purchase of GitHub has blessed them with one amazing gift: no longer having to worry about how to make money. Now that Microsoft has removed the need for GitHub to internally find how to become profitable, GitHub can instead focus on what it does best: product.&lt;/p&gt;
&lt;p&gt;We’re already seeing this bear fruit with small UI and UX tweaks in the past few months. The sticky bar on PR review pages, new dashboard page. I’m sure these were under development before the Microsoft purchase, however now there’s less that GitHub has to juggle.&lt;/p&gt;
&lt;p&gt;GitHub is going to get great in 2019.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;So that wraps my predictions for the JavaScript ecosystem in 2019. It’s never been a better time to be a JavaScript developer, and it’s just going to get better.&lt;/p&gt;
&lt;p&gt;It’s also exciting to see the ecosystem mature. Modern Javascript is relatively young compared to other more mature ecosystems (have you seen what a Java IDE can do? Woah!) and now that the initial rush of understanding how powerful JavaScript can be is slowing, we can now focus on making JavaScript more approachable and sustainable.&lt;/p&gt;
</content:encoded></item><item><title>Top 10 Albums of 2018</title><link>https://hswolff.com/blog/top-10-albums-of-2018/</link><guid isPermaLink="true">https://hswolff.com/blog/top-10-albums-of-2018/</guid><pubDate>Tue, 08 Jan 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;2018 was quite the year for me. The biggest and most obvious change was &lt;a href=&quot;/blog/fatherhood/&quot;&gt;becoming a parent&lt;/a&gt;. That was far and above the highlight of the year.&lt;/p&gt;
&lt;p&gt;Not only was was becoming a father the highlight of the year but it was also a big influence on my music listening behavior. Namely, it put a bit of a damper on how much music I could listen to. Most of the time was spent listening to lullabies. Or rather, just white noise. Babies sure love white noise. That&apos;s their favorite soundtrack. And I heard it on repeat. Most nights. A lot of nights. So many nights. I wish I could get that sleep back.&lt;/p&gt;
&lt;p&gt;So having a baby put a bit of a damper on how much music I could listen to. However a second change in my listening habits also had a big influence on how much music I listened to in 2018. That was the increase in how many podcasts I listened to. I quickly fell in love with the &lt;a href=&quot;https://crooked.com/podcast-series/pod-save-america/&quot;&gt;Pod Save America&lt;/a&gt;, which I listened to almost every day on my commute to and from work. That was my go-to podcast but I also avidly listened to the following podcasts too:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://frontendhappyhour.com/&quot;&gt;Frontend Happy Hour&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://reactpodcast.simplecast.fm/&quot;&gt;React Podcast&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.theringer.com/the-dave-chang-show&quot;&gt;The Dave Chang Show&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.wtfpod.com/&quot;&gt;WTF with Marc Maron&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://headgum.com/good-one-a-podcast-about-jokes&quot;&gt;Good One&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I didn&apos;t listen to &lt;a href=&quot;https://theconsolelog.com/&quot;&gt;my own podcast&lt;/a&gt; as I felt that was a little too self indulgent, even for my tastes.&lt;/p&gt;
&lt;p&gt;The last major change in 2018 for my listening habits was the rise in my usage of Apple Music and its multitude of playlists. Many days I spent listening to one of the many playlists provided by Apple Music, exposing me to many artists and songs but not letting me really sink my teeth into albums as a whole.&lt;/p&gt;
&lt;p&gt;That&apos;s what I like to write about in these posts. The albums from the past year that I enjoy in whole. The albums that I let play from start to finish and have a great time hearing the full vision of the artist.&lt;/p&gt;
&lt;p&gt;Despite those three big changes I still listened to plenty of albums in 2018. This is my list of top albums from 2018.&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;Top 10 Albums of 2018&lt;/h1&gt;
&lt;h2&gt;10. The Decemberists &quot;I&apos;ll Be Your Girl&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&apos;ve long been a Decemberists fan. I was even able to see them live when I was in college. I love their mix of indie and folk. The mood they impart on their songs always fills me with love and joy, despite having an odd icy overtone. That ice is probably due to their name, which is hard to shake off.&lt;/p&gt;
&lt;p&gt;Their first album since 2014, I had a great time getting to enjoy new Decemberists tunes. It was a solid new foray - not their best, but certainly not their worst. At times a little more alty and rocky than previous albums but still rightly retained their Decemberists sound.&lt;/p&gt;
&lt;h2&gt;9. Ben Howard &quot;Noonday Dream&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&apos;m always a sucker for solid singer/songwriter albums. They&apos;re great when I get in a slightly melancholic mood, or just need a relaxing record to put on.&lt;/p&gt;
&lt;p&gt;Ben Howard creates relaxing and pretty songs with a nice ambient backdrop to a lead acoustic guitar that put me into a calm place that lets me relax when the world starts to race a little too fast for my tastes.&lt;/p&gt;
&lt;h2&gt;8. Post Malone &quot;beerbongs &amp;amp; bentleys&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My main complaint about this album is that it&apos;s too long. It&apos;s a sprawling album with 18 tracks, making it a bit of a chore to get all the way through. The first half of the album is packed with stellar tracks, however after that it loses steam.&lt;/p&gt;
&lt;p&gt;However there are many breakout tracks. &quot;Paranoid&quot;, &quot;Rich &amp;amp; Sad&quot;, &quot;rockstar&quot;...most of the first 8 tracks are all tremendous.&lt;/p&gt;
&lt;p&gt;A unqiue mix of rap and r&amp;amp;b, I love the unique sound of Post Malone. Except for that second half of the album. Too much.&lt;/p&gt;
&lt;h2&gt;7. Black Panther The Album Music From And Inspired By&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;An amazing movie backed by an amazing album. The artists that make up the tracks on this album are all at the top of their game: Kendrick Lamar, SZA, Khalid, Anderson .Paak, just to name a few.&lt;/p&gt;
&lt;p&gt;It&apos;s an eclectic album that contains many different type of songs but that makes sense given that it&apos;s a compendium of different artists.&lt;/p&gt;
&lt;p&gt;As far as movie albums go, this is one of the best I&apos;ve heard in a very long time.&lt;/p&gt;
&lt;h2&gt;6. The Weeknd &quot;My Dear Melancholy,&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I did not expect a new album from The Weekend. It was just only 2016 that he came out with a very strong album. To have another new album come out - so soon, and with such quality - was a very big surprise.&lt;/p&gt;
&lt;p&gt;In all honesty I&apos;d more accurately call this a long EP as it only has 6 tracks. However every track is very strong.&lt;/p&gt;
&lt;p&gt;Many of the songs had me easily dancing in my shoes, stretching along with all the high notes hit in the songs.&lt;/p&gt;
&lt;h2&gt;5. SiR &quot;November&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&apos;t remember how I found this album but I&apos;m so glad that I did. A wonderful R&amp;amp;B album, full of soul and feeling. It&apos;s an album that knows itself with a high degree of comfort and confidence.&lt;/p&gt;
&lt;p&gt;The songs sway with confidence and style, lulling the listener to sway along with its vibe as the tracks unfold, one after another.&lt;/p&gt;
&lt;p&gt;The songs tell a narrative without being repetitive, staying true to the artists intent, while exploring the range of what SiR has to say.&lt;/p&gt;
&lt;h2&gt;4. Arin Ray &quot;Platinum Fire&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another R&amp;amp;B album. It&apos;s definitely a new genre that I really enjoy vibing to.&lt;/p&gt;
&lt;p&gt;This album closely eked out the #4 spot over #5. Both albums are very solid R&amp;amp;B albums with an artist that knows themself well, however the differentiator for me was the slight increase in replayability that Arin Ray had for me.&lt;/p&gt;
&lt;p&gt;The tracks are just as strong as SiR, however Arin Ray has a slightly stronger charismatic pull. The songs reek of his charisma, which provide a strong lure to pull the listener in and get them to keep listening.&lt;/p&gt;
&lt;p&gt;I&apos;m curious if these rankings stay true after a year. However for this year Arin Ray takes the higher spot.&lt;/p&gt;
&lt;h2&gt;3. Khalid &quot;Suncity&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another artist I was surprised to hear new material from. It was only last year that Khalid released his debut album, and he&apos;s back this year with another tight follow up.&lt;/p&gt;
&lt;p&gt;Like The Weeknd this could also be considered an EP as it only has 7 tracks. However the quality of each track here is immense.&lt;/p&gt;
&lt;p&gt;It definitely seems as though Khalid took what he learned and experienced from his debut album and poured those experiences into this new solid creation.&lt;/p&gt;
&lt;p&gt;Great album.&lt;/p&gt;
&lt;h2&gt;2. H.E.R. &quot;I Used to Know Her: Part 2 - EP&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What&apos;s with artists that can&apos;t seem to stop creating? H.E.R.&apos;s debut album came out last year and this year she released two additional EPs. At least she&apos;s being honest about what these things are.&lt;/p&gt;
&lt;p&gt;Specifically this EP, Part 2, was a super strong R&amp;amp;B EP. The first track, &quot;Carried Away&quot;, was replayed so many times. Everytime I put it on my hips would sway no matter where I was - at work, on the subway, walking down the sidwalk.&lt;/p&gt;
&lt;p&gt;Gosh I love H.E.R.&apos;s voice and vibe.&lt;/p&gt;
&lt;h2&gt;1. The 1975 &quot;A Brief Inquiry Into Online Relationships&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A late release for 2018 however it very quickly shot to the top of my list. This is a true return to my indie-rock music roots, as this album is wonderfully indie. Yet danceable indie, and that&apos;s what I care about these days.&lt;/p&gt;
&lt;p&gt;I haven&apos;t really heard such a new type of sound in a long time, which was very refreshing. To hear something completely new, and done well, doesn&apos;t happen that often.&lt;/p&gt;
&lt;p&gt;However that would all be for naught if it wasn&apos;t also good tunes. And the songs on this album are indeed very good.&lt;/p&gt;
&lt;p&gt;My breakout song from this album is by far &quot;Love It If We Made It&quot;. I&apos;ve played that song so many times...I can&apos;t get over it. Somehow it sounds like the singer is both screaming into the mic and singing at the same time and I don&apos;t understand it but I still love it all the same.&lt;/p&gt;
</content:encoded></item><item><title>React Year in Review 2018</title><link>https://hswolff.com/blog/react-year-in-review-2018/</link><guid isPermaLink="true">https://hswolff.com/blog/react-year-in-review-2018/</guid><pubDate>Sat, 22 Dec 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Hello everyone! Welcome to my React Year in Review 2018!&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/pLh7LMghChE&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;React&apos;s 2018 was one of steady growth and doubling down on foundational concepts and principles. It was a year filled with a lot of thought and not as much action - a combination that I think will pay great dividends in the year to come.&lt;/p&gt;
&lt;p&gt;This was the year of Suspense, and Concurrency, and Hooks! All these high minded concepts were focused on filling in and smoothing down the rough edges of React. Which is a weird thing to say as you could easily look at React and for certain use cases it does everything you could ask for. However when the React community and core team started looking into some of the features that were a little awkward to do, they found room for improvement.&lt;/p&gt;
&lt;p&gt;That&apos;s what this year was about. Rather than expand React (albeit React did expand), the React core team rethought some core assumptions on how one can best use React and brought their solutions to light this year.&lt;/p&gt;
&lt;p&gt;Without further ado, let&apos;s get to the recap.&lt;/p&gt;
&lt;h1&gt;January&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/pull/12028&quot;&gt;React Lifecyle Hooks Changing&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This was one of the first hints of big things to come. Deprecating class lifecycle methods? Seemed outrageous at the time. But oh, to be that naive again.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/pull/11818&quot;&gt;New React Context API Merged&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For too long React had a Context API that was actively discouraged from use. It wasn&apos;t until January of 2018 that we finally got an officially supported Context API. The most exciting part of it? It used a community convention as its primary API - render props.&lt;/p&gt;
&lt;h1&gt;February&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://twitter.com/reactjs/status/964689022747475968&quot;&gt;React Native (including Fresco, Metro, and Yoga) relicensed under the MIT license to match React&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Big news for a lot of people. The fear of using React Native was removed when it was relicensed to use the MIT license. Bravo to Facebook.&lt;/p&gt;
&lt;h1&gt;March&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/03/01/sneak-peek-beyond-react-16.html&quot;&gt;React Suspense&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The demos heard around the React world. This was what started a whirlwind of thought and changes for 2018. Dan shows a version of React with two un-released features: time slicing and suspense. I think it took me the rest of 2018 to finally understand what the heck that meant.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html&quot;&gt;React Update on Async Rendering&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;That PR back in January about deprecating class lifecycle methods? Finally came home to roost in the form of a blog post officially announcing the upcoming changes.&lt;/p&gt;
&lt;p&gt;This blog post was quickly followed by another...&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/03/29/react-v-16-3.html&quot;&gt;React v16.3.0: New lifecycles and context API&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;...that actually released the lifecycle changes. Long live &lt;code&gt;getDerivedStateFromProps&lt;/code&gt;!&lt;/p&gt;
&lt;p&gt;Also just as exciting, the new Context API becomes available.&lt;/p&gt;
&lt;h1&gt;April&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/reactjs/redux/releases/tag/v4.0.0&quot;&gt;Redux 4&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Redux gets a nice version bump, rolling out some incremental changes to the community. Nothing earth-shaking here. Just a nice and easy new version.&lt;/p&gt;
&lt;h1&gt;May&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/commit/6565795377d1d2c79a7708766f1af9e1a87517de&quot;&gt;React Suspense Merged into Master&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;That demo that Dan showed in March finally gets merged into React master. In isolation its hard to see where it fits in, but seeing the steady forward progress of React was exciting.&lt;/p&gt;
&lt;p&gt;At this point the feature is still turned off as it&apos;s still under active development.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/tree/75897c2dcd1dd3a6ca46284dd37e13d22b4b16b4&quot;&gt;React turns 5 next week&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;React turned 5 in 2018! Happy birthday React! If you ever have a recruiter asking for 6+ years of React experience either: you&apos;re lying or you worked at Facebook.&lt;/p&gt;
&lt;h1&gt;June&lt;/h1&gt;
&lt;p&gt;Nothing happened. At least, nothing that I could find.&lt;/p&gt;
&lt;h1&gt;July&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/issues/13206&quot;&gt;Umbrella issue for releasing React Suspense to open source&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Things start to get a little more official for React Suspense. This GitHub Issue is opened to track its progress. It still seems to be somewhat maintained, with the last update coming at the end of November, however I&apos;m not sure if it&apos;s still a canonical source of truth.&lt;/p&gt;
&lt;h1&gt;August&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/pull/13398&quot;&gt;PR: React.lazy&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A wild new feature appears out of the blue! It&apos;s not really talked about nor understood until later in the year, but &lt;code&gt;React.lazy&lt;/code&gt; first shows itself in August.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/facebook/react/issues/13525&quot;&gt;React Fire: Modernizing React DOM&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of my personal favorite bits of news from the past year. Just as Fiber was to React so is Fire to React DOM.&lt;/p&gt;
&lt;p&gt;Essentially a rewrite of React DOM to address issues and learnings from the past five years of development.&lt;/p&gt;
&lt;p&gt;It&apos;s still very much in progress and I&apos;m excited to see how it matrues during 2019.&lt;/p&gt;
&lt;h1&gt;October&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/10/01/create-react-app-v2.html&quot;&gt;Create React App 2.0&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The officially supported scaffold tool gets a huge new release. Packed with many new and big features, it really brought a whole new level of maturity to the project.&lt;/p&gt;
&lt;p&gt;Personally I was very excited with version 2.1 which added opt-in support for TypeScript. Even less reasons to eject!&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/10/23/react-v-16-6.html&quot;&gt;React v16.6.0: lazy, memo and contextType&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The second and final major release of React in 2018. This releases &lt;code&gt;React.lazy&lt;/code&gt; coupled with a synchronous version of Suspense.&lt;/p&gt;
&lt;p&gt;It&apos;s kinda surprising that there were only two major React releases in 2018. 16.4.0 and 16.5.0 didn&apos;t contain any major new features, so this was the last one that most people are probably still using.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/docs/hooks-intro.html&quot;&gt;React Hooks&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The biggest event of 2018. React Hooks. If you don&apos;t already know what this is then &lt;a href=&quot;/blog/react-hooks/&quot;&gt;please read my blog post that will tell you everything you need to know.&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;November&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/reactjs/rfcs/commit/3826b8804f4795743a7c4c61d1caf6f41ba9607d&quot;&gt;Hooks RFC Merged&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The React Hooks RFC is merged, officially announcing it as approved and slated to be included in an upcoming version of React.&lt;/p&gt;
&lt;h1&gt;December&lt;/h1&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/reduxjs/react-redux/releases/tag/v6.0.0&quot;&gt;React-redux 6&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Major new version of react-redux. This one includes the new Context API - the same one that was released all the way back in March. Almost an entire year before that feature was incorporated.&lt;/p&gt;
&lt;p&gt;I&apos;m glad for that delay as it allowed the react-redux team to take their time and carefully find the best method for using new React features. Had they rushed they could have introduced churn, something that I very much don&apos;t want to see in react-redux.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/11/27/react-16-roadmap.html&quot;&gt;React 16.x Roadmap&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A semi-official &apos;state of React&apos; blogpost. It lays out the upcoming year of expected changes for React. It was a great post and did a great job of addressing the confusion that was floating around the React community.&lt;/p&gt;
&lt;p&gt;In some ways I wish it had come sooner in the year, but I don&apos;t think the React core team themselves even know what that blog post would have said in July.&lt;/p&gt;
&lt;p&gt;However like all good things, this came in time and delivered in a great fashion.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;What a year for React. I don&apos;t feel like a lot happened this year - I feel like 2019 is going to be the one that will be truly mind-boggling. When Concurrent React is delivered it&apos;s going to be a paradigm shift in how React applications behave.&lt;/p&gt;
&lt;p&gt;I&apos;m also so very excited to play with React Hooks more. From my brief experiments it brings a whole new level of joy back into React that I didn&apos;t realize I was missing.&lt;/p&gt;
&lt;p&gt;I&apos;ve told you my highlights. What were yours?&lt;/p&gt;
&lt;p&gt;Are you as hooked as I am on React Hooks? (I&apos;m so sorry I&apos;m not sorry for that joke.)&lt;/p&gt;
&lt;p&gt;Cheers to a great 2018 React! Looking forward to 2019!&lt;/p&gt;
</content:encoded></item><item><title>JavaScript Year in Review 2018</title><link>https://hswolff.com/blog/javascript-year-in-review-2018/</link><guid isPermaLink="true">https://hswolff.com/blog/javascript-year-in-review-2018/</guid><pubDate>Sun, 16 Dec 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Well that&apos;s it! 2018 is coming to a close! What a year it&apos;s been, eh? A lot of highs...maybe a few more lows than I wanted. However your year turned out I know we can all agree that it was another great year for JavaScript.&lt;/p&gt;
&lt;p&gt;There&apos;s a lot of 2018 recap posts and I would be remiss not to add my own into the mix. However for my 2018 recap I want to focus on some of the big JavaScript news and releases this past year.&lt;/p&gt;
&lt;p&gt;It was fun compiling this list. It had more than a few surprises. Mostly I was surprised at the even pace of new releases. Usually JavaScript gets a bad rep from moving too fast. However in looking at what happened in the past year I wouldn&apos;t say that is true at all. It&apos;s refreshing to see libraries that are heavily depended on take that responsibility seriously and be very careful in the cadence of their releases.&lt;/p&gt;
&lt;p&gt;There were also some great releases! Some libraries made some great improvements in the past year, making my life as a developer better and happier.&lt;/p&gt;
&lt;p&gt;With all that being said, let&apos;s get to reminiscing!&lt;/p&gt;
&lt;p&gt;If you&apos;re interested in watching this in video form I got you covered! Check out my YouTube video which is me telling you about the past year of releases rather than you doing the work and having to read all the following words.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/Ei_IJbZdPvA&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h1&gt;January&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://prettier.io/blog/2018/01/10/1.10.0.html&quot;&gt;Prettier 1.10&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Prettier, everyone&apos;s favorite JavaScript code formatter, started the year with their 1.10 release. This release introduced the Prettier plugin API allowing 3rd party devs to extend the functionality of Prettier.&lt;/p&gt;
&lt;p&gt;There were a couple of releases of Prettier this past year, culminating in 1.15, but you&apos;ll read more about that in November.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;http://blog.getbootstrap.com/2018/01/18/bootstrap-4/&quot;&gt;Bootstrap 4 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Big release from the Bootstrap team! One thing I love about Bootstrap is how careful they are with their upgrades. The amount of effort and care they put into every release is immense, and Bootstrap 4 was no exception.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/tc39/logo&quot;&gt;TC39 now has an official logo&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;TC39 has a logo! I think I was more excited about this than most people but what&apos;s not to get excited about? An official logo for the team that decides the future of JavaScript? Hell yeah they deserve their own logo.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/mweststrate/immer/releases/tag/1.0.0&quot;&gt;Immer goes 1.0.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Feels like Immer has been around forever at this point, but it was only in January that it went stable at version 1.0.0. I personally love Immer - it makes an otherwise cumbersome task (immutablitity) easy. So many other libraries either directly build on top of Immer or use its novel concept to inform their own APIs. What a great addition to the JavaScript landscape.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://webkit.org/blog/8084/release-notes-for-safari-technology-preview-48/&quot;&gt;Service Worker Support Added to Safari in iOS 11.3&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Finally, I can invest some of my team to learning and implementing Service Workers! Mobile Safari support was the last main blocker for me, and that blocker was erased in January. It&apos;s now been a year of widespread support for Service Workers across modern browsers on the desktop and on mobile. No more excuses! Get Servicing! Workers!&lt;/p&gt;
&lt;h1&gt;February&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://emberjs.com/blog/2018/02/14/ember-3-0-released.html&quot;&gt;Ember 3.0 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Major release of the Ember framework. They always do such a good job of bringing their community along with them during their upgrades. However a major version is a major version and the big change here was the drop of older browsers IE9 and IE10. And really, IE9 and IE10 shouldn&apos;t even be a consideration at all anymore. But alas...&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/webpack/webpack-4-released-today-6cdb994702d4&quot;&gt;webpack 4.0 final&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Heyooo! Webpack up in the house! Big release from the Webpack team, happened all the way back in February. The big improvement with Webpack 4 was the arrival of more sensible defaults which was a direct response to the 0-config movement started by ParcelJS and other tools.&lt;/p&gt;
&lt;p&gt;Also with Webpack 4 they&apos;ve begun to introduce support for more module types. No longer is JavaScript the only supported file, the changes made in Webpack 4 added support for WebAssembly, JSON, ES Modules, and promised future fist-class support for CSS and other asset types.&lt;/p&gt;
&lt;p&gt;I&apos;m excited for Webpack 5, which, wouldn&apos;t be too surprising to see it arrive in February 2019. Not bad for a year&apos;s worth of work.&lt;/p&gt;
&lt;h1&gt;March&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://blogs.msdn.microsoft.com/typescript/2018/03/27/announcing-typescript-2-8/&quot;&gt;TypeScript 2.8&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;TypeScript continued its steady and stable release cadence throughout the entire year. Started off the year with the introduction of conditional types which laid the groundwork for later features to build on top of.&lt;/p&gt;
&lt;p&gt;This year was definitely the year of TypeScript. It wasn&apos;t so much that TypeScript got amazingly better overnight, it was more that people started to enjoy all the features that TypeSciprt had accrued over the years.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/@mweststrate/mobx-4-better-simpler-faster-smaller-c1fbc08008da&quot;&gt;MobX 4 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;MobX 4 was released in March, a release mostly in preperation for MobX 5 which happened in June (sorry, spoilers!) MobX 4 provided an alternative API for using MobX decorators without the decorator syntax - a very needed update due to the dependency on the now outdated decorator proposal.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/d3/d3/blob/master/CHANGES.md#changes-in-d3-50&quot;&gt;D3 5.0 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Not a huge release but a right and proper semver major release! D3 5 updates the default API for async methods - to now use Promises! Welcome to the present D3!&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://twitter.com/isntitvacant/status/976567455890976769?s=12&quot;&gt;New npmjs website&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I didn&apos;t realize how...dated...the npm website was until the new version was released.&lt;/p&gt;
&lt;p&gt;Also I can&apos;t believe this happened all the back in February. I&apos;ve gotten to used to the new website it feels like it&apos;s been there for years.&lt;/p&gt;
&lt;h1&gt;April&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/npm-inc/announcing-npm-6-5d0b1799a905&quot;&gt;Announcing npm@6&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;npm 6 was released! Big new release for npm, and it&apos;s been the major release for npm throughout 2018.&lt;/p&gt;
&lt;p&gt;npm 6 introduces npm audit, a tool to check the security of every dependency in your node_modules folder.&lt;/p&gt;
&lt;p&gt;This new feature was quite prescient as 2018 had more than a handful of security scares. Having this feature at the ready was definitely a case of npm skating to where the puck was headed, not waiting for it to arrive.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/the-node-js-collection/the-node-js-project-introduces-latest-release-line-node-js-10-x-bf07abfa9076&quot;&gt;Node.js 10.0.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Node 10 was released! The latest and greatest LTS version of node (so far).&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/reactjs/redux/releases/tag/v4.0.0&quot;&gt;Redux 4&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Redux 4 was released. A few small breaking changes that would only affect you if you were using parts of redux that were already discouraged. This is one library that I&apos;m glad for the update but grateful for the slow pace of iteration.&lt;/p&gt;
&lt;p&gt;If Redux updated every 6 months I&apos;d be a little unhappy. How much could you even change?!&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://twitter.com/jashkenas/status/986678387325321216&quot;&gt;Underscore.js 1.9.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Finally. Seriously, finally. After 3 years a new version of Underscore was released. I can&apos;t tell you how many times I&apos;d look at the source code of Underscare in master, to see a feature exist there (&lt;em&gt;cough&lt;/em&gt; debounce.cancel()) only to find that it hadn&apos;t yet been published. So glad this one happened.&lt;/p&gt;
&lt;h1&gt;May&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://twitter.com/mathias/status/999101901697363969?s=12&quot;&gt;SmooshGate resolved: change flatten to flat in flatMap proposal&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;SmooshGate we hardly knew ye. You were big and loud and beautiful, and now you&apos;re just flat and a footnote for the history books of JavaScript versions past.&lt;/p&gt;
&lt;h1&gt;June&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://blogs.microsoft.com/blog/2018/06/04/microsoft-github-empowering-developers/&quot;&gt;Microsoft Buys GitHub for $7.5 Billion&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Biggest news of the month by far. Did you see this coming? I still don&apos;t believe it and it&apos;s been a reality for months now.&lt;/p&gt;
&lt;p&gt;Actually just reading this news item was a little bit of a shock for me, all over again.&lt;/p&gt;
&lt;p&gt;All I can say is I&apos;m glad I&apos;m not a betting man because if someone had given me this to bet on I would be out a handful of cash.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/@mweststrate/mobx-5-the-saga-continues-4852bce05572&quot;&gt;Mobx 5 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Big new feature here was MobX taking advantage of Proxy objects to power its functionality. Yes this limits its usage to modern and evergreen browsers, however that&apos;s why MobX 4 came out earlier this year - to provide a branch that would still support older browsers.&lt;/p&gt;
&lt;p&gt;Glad to see MobX embracing the future. Helps push us all closer to there as well.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://eslint.org/blog/2018/06/eslint-v5.0.0-released&quot;&gt;ESlint 5.0 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;ESLint always does a great job of helping users migrate to their newest version. Their migration guides and documentation around changes are always top of class. Truly the team that runs ESLint is admirable for the class and ease which they manage a wildly popular library.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://www.ecma-international.org/publications/standards/Ecma-262.htm&quot;&gt;ES2018 Approved&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;ES2018 is for real! Object Rest/Spread of properties gets official approval, as does Promise.finally. A pretty great year of features.&lt;/p&gt;
&lt;h1&gt;July&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/&quot;&gt;TypeScript 3.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;More TypeScript? More fun! TypeScript doesn&apos;t really follow semver that closely so while 3.0 looks big, it&apos;s really just the next feature release after 2.8. Still, a good release with many useful features that make typing projects more safe and more reliable.&lt;/p&gt;
&lt;h1&gt;August&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://github.com/graphql/graphql-js/releases/tag/v14.0.0&quot;&gt;GraphQL JS 14.0.0 Release&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is the reference implementation for GraphQL and this was over a year&apos;s worth of work since the last major version of GraphQL. This brought this implementation to conformace with the June 2018 version of GraphQL, bringing with it support for new schema features and extensions.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://babeljs.io/blog/2018/08/27/7.0.0&quot;&gt;Babel 7 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Major Babel versions always hit like a cannonball and Babel 7 was no exception. No matter how careful the Babel team is somehow Babel releases still always feel somewhat controversial. That being said, I think Babel 7 was the least controversial release of Babel in ages.&lt;/p&gt;
&lt;p&gt;Babel 7 did a great job of setting the stage for Babel to truly be the platform upon which developers of the JavaScript language itself will use to help push the lanaguage forward.&lt;/p&gt;
&lt;p&gt;The Babel team removed all yearly presets to encourage people to both use &lt;code&gt;present-env&lt;/code&gt; and to think of extensions of JavaScript they want to use on a per proposal basis. This puts the onus more on the end developer which is smart as it&apos;s hard to predict what every consumer of Babel expects.&lt;/p&gt;
&lt;p&gt;I&apos;d expect Babel 8 to be a major breaking change in API only, as I think Babel is now in a great position to help lead the way for JavaScript&apos;s continued evolution.&lt;/p&gt;
&lt;h1&gt;October&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://reactjs.org/blog/2018/10/01/create-react-app-v2.html&quot;&gt;Create React App 2.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I think one of the biggest releases of the month. Honestly brought about a huge backlog of features to an official release. If you click on the blog post link there&apos;s literally an almost page high bullet point list of upgrades that went into this release.&lt;/p&gt;
&lt;p&gt;Mostly what I was excited about was the increase in feature support such that the need to eject went down. Also Create React App 2.2 added opt-in support for TypeScript which is awesome!&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://blog.angular.io/version-7-of-angular-cli-prompts-virtual-scroll-drag-and-drop-and-more-c594e22e7b8c&quot;&gt;Angular 7 Released&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Big major release from the Angular team. This continues to see the Angular team work on performance of the framework as well as provide more built-in components that make writing applications easier and quicker.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/styled-components/styled-components-v4-new-final-finalest-for-real-final-final-psd-fa4d83398a77&quot;&gt;styled-components v4&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Very popular CSS-in-JS library. Gets smaller and smarter.&lt;/p&gt;
&lt;p&gt;The whole landscape for CSS-in-JS libraries is the fiercest its ever been so it has been great to see that competition push the quality of every library.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://nodejs.org/en/blog/release/v11.0.0/&quot;&gt;Node v11.0.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;New Node! The experimental branch. Gotta wait for Node 12 for LTS though.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/storybookjs/storybook-4-0-is-here-10b9857fc7de&quot;&gt;Storybook 4.0&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Adds support to other UI frameworks outside of React such as Ember, plain ol&apos; HtML, and others.&lt;/p&gt;
&lt;p&gt;Also upgraded to use Webpack 4.&lt;/p&gt;
&lt;p&gt;A nice release. Would have liked to see it come a little quicker after Webpack 4 came out though. But whose to complain when it comes for free.&lt;/p&gt;
&lt;h1&gt;November&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/@leeb/introducing-the-graphql-foundation-3235d8186d6d&quot;&gt;Introducing the GraphQL Foundation&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;An independent foundation to steward the future of GraphQL. A great sign of health for GraphQL as a whole, reducing its reliance on Facebook for its future success. I love seeing news like this.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://prettier.io/blog/2018/11/07/1.15.0.html&quot;&gt;Prettier 1.15: HTML, Vue, Angular and MDX Support&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Prettier ended the year at version 1.15 adding support for HTML, VUe, and Angular. I was honestly surprised Prettier didn&apos;t support these languages already but it&apos;s great to see it there. The more widespread Prettier can become the happier I will be. I want to be able to read every JavaScript code base ever with as much ease as possible because they&apos;re all formatted with Prettier.&lt;/p&gt;
&lt;h1&gt;December&lt;/h1&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/emotion-js/announcing-emotion-10-f1a4b17b8ccd&quot;&gt;Announcing Emotion 10!&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Another popular CSS-in-JS library. One of the fastest and smallest around. Did a really novel thing with creating their own JSX pragma function. A great release to see.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://blogs.msdn.microsoft.com/typescript/2018/11/29/announcing-typescript-3-2/&quot;&gt;Announcing TypeScript 3.2&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;And TypeScript ends the year at 3.2. Again, slow and steady wins the race and TypeScript nails that to a T.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://developers.googleblog.com/2018/12/flutter-10-googles-portable-ui-toolkit.html&quot;&gt;Flutter 1.0: Google’s Portable UI Toolkit&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Essentialy Google&apos;s answer to React Native. It&apos;ll be interesting to see how this grows in popularity over the upcoming months.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://wordpress.org/news/2018/12/bebo/&quot;&gt;WordPress 5.0 “Bebo”&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Why&apos;s this here? Well WordPress rewrote their editor entirely in React. A big bet on a bold future. Excited to play around with it and see how WordPress continues its foray into more usages of JavaScript.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;What a year, huh? Did you remember all these things happening? Can you still believe that Microsoft bought GitHub? Also are you shocked there was no major releases of React? Just minor ones (with new features, and no breaking changes). Good on React for keeping things stable.&lt;/p&gt;
&lt;p&gt;What does 2019 hold? I&apos;m personally very excited about Webpack 5 which is supposed to have persistent caching to the filesystem to make startup time even faster.&lt;/p&gt;
&lt;p&gt;I&apos;m also very excited about ReasonML. I&apos;m curious to see how its popularity and mindshare grow in 2019. It might be its year.&lt;/p&gt;
&lt;p&gt;What are you excited about for 2019? What are you hoping for?&lt;/p&gt;
&lt;p&gt;Oh, and before I forget - Happy New Year!&lt;/p&gt;
</content:encoded></item><item><title>Make Your Code Beautiful With Prettier</title><link>https://hswolff.com/blog/prettier/</link><guid isPermaLink="true">https://hswolff.com/blog/prettier/</guid><pubDate>Fri, 07 Dec 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;m a fan of cleanliness. I like a clean desk and a clean room. My desk at work is pretty sparse and minimal. I try and avoid clutter as it helps me find whatever it is I need at the moment I need it.&lt;/p&gt;
&lt;p&gt;One of my most disliked tasks is having to clean up my apartment. Inevitably my apartment gets messy - that&apos;s just the unhappy side effect of living there and using it every day.&lt;/p&gt;
&lt;p&gt;And as the clutter and disarray increases the need for me to take out the trash, and throw out the pile of mail grows as well.&lt;/p&gt;
&lt;p&gt;I won&apos;t lie - every so often I get my apartment professionally cleaned. At a certain point I have to throw in the towel and just outsource that work to someone who does it better.&lt;/p&gt;
&lt;p&gt;It&apos;s one of the best feelings in the world coming home to a freshly cleaned apartment. Aside from there being no mess, no dirt, no clutter - it was cleaned by someone else. That is what gives it that special touch of awesomeness that always keeps me coming back for more.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;At this point you may be asking yourself what in &lt;a href=&quot;https://en.wikipedia.org/wiki/Sam_Hill_(euphemism)&quot;&gt;Sam Hill&lt;/a&gt; does this have to do with &lt;a href=&quot;https://prettier.io/&quot;&gt;Prettier&lt;/a&gt;? Notwithstanding this being a blog post about code, I haven&apos;t even talked about code yet!&lt;/p&gt;
&lt;p&gt;You see, Prettier is a professional cleaner for your code. It reduces clutter, cleans up messes, and makes your editor feel like the coziest place on earth.&lt;/p&gt;
&lt;p&gt;Prettier helps me keep my code as clean as I keep my apartment.&lt;/p&gt;
&lt;h1&gt;Video&lt;/h1&gt;
&lt;p&gt;Before I go on with all the remaining words of this post I want to let you know that this is also in video form.&lt;/p&gt;
&lt;p&gt;So if you&apos;re the type of person who enjoys watching a human face teach you a new thing then enjoy the embedded video below.&lt;/p&gt;
&lt;p&gt;If not then, keep on reading!&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/sZI2v_6TN7E&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h1&gt;What is it?&lt;/h1&gt;
&lt;p&gt;Let&apos;s expand on what Prettier is a little bit more and leave that analogy alone for a little while. I love my analogies but sometimes I need to just write in plain english what the heck I&apos;m talking about.&lt;/p&gt;
&lt;p&gt;The most concise description of what Prettier is comes from its website:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An opinionated code formatter&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Prettier will take your code - JavaScript, CSS, HTML, JSX (&lt;a href=&quot;https://prettier.io/docs/en/index.html&quot;&gt;the list goes on&lt;/a&gt;) - and format it in a consistent and clean manner.&lt;/p&gt;
&lt;p&gt;Take for example this unformatted code that is uh, perhaps a little hard to read:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// prettier-ignore
function sayHello
(
    times
)
{
    const handler
    = () =&amp;gt; {console.log(
        &apos;Hello&apos;
    );

        const nextTimes = times - 1

                if (nextTimes &amp;gt; 0) { sayHello(nextTimes); } }



                    setTimeout(   handler,   1000
                );

}

sayHello(3);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This code works (try it), but reading it is pretty hard. At least for me it is. I mean, I tried to make it hard to read. I succeeded for myself at least.&lt;/p&gt;
&lt;p&gt;Now here&apos;s that same code after Prettier has formatted it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function sayHello(times) {
  const handler = () =&amp;gt; {
    console.log(&apos;Hello&apos;);

    const nextTimes = times - 1;

    if (nextTimes &amp;gt; 0) {
      sayHello(nextTimes);
    }
  };

  setTimeout(handler, 1000);
}

sayHello(3);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Prettier, no?&lt;/p&gt;
&lt;h1&gt;Opinionated&lt;/h1&gt;
&lt;p&gt;Prettier is opinionated by default. The reasoning behind this is to reduce the arguments that engineers have around code-style and formatting. If there&apos;s anything that coders love to argue about it&apos;s the &lt;a href=&quot;https://en.wikipedia.org/wiki/Law_of_triviality&quot;&gt;color of the bike shed&lt;/a&gt; and how many blank lines should be between two function calls.&lt;/p&gt;
&lt;p&gt;The less options Prettier has the less there is to argue about.&lt;/p&gt;
&lt;p&gt;Why there are any options at all is that there are a few points of contention that no amount of opinons will sway an engineer. For example tabs or spaces, or single vs double quotes. Rather than limit who would use Prettier, the door was opened a little wider to be more inclusive to the community at large.&lt;/p&gt;
&lt;h1&gt;Why should you use Prettier?&lt;/h1&gt;
&lt;p&gt;Prettier makes your code consistent and easy to read. This makes it so that you can open any file in your application and instantly know the style idioms such that you can spend more time reading the code and less time understanding the format.&lt;/p&gt;
&lt;p&gt;Take for example a book. You read books right? A book typically has one font. Every page is the same font, letting you focus on the words and stories and less time on the design and style of the print.&lt;/p&gt;
&lt;p&gt;Imagine that the first page of a book was written in Arial. The next page was written in Comic Sans. The next page in Helvetica. The next page in Papyrus.&lt;/p&gt;
&lt;p&gt;That would make for an extremely painful experience. Every page becomes adversarial - getting in the way of the content and preventing people from understanding what they&apos;re reading.&lt;/p&gt;
&lt;p&gt;That&apos;s why Prettier is important. It makes all your code the same &apos;font&apos; such that another engineer can spend more time on what the code is doing, and not where it shows up on the screen.&lt;/p&gt;
&lt;h2&gt;Teaching Tool&lt;/h2&gt;
&lt;p&gt;If you&apos;re a new programmer I doubly recommend using Prettier.&lt;/p&gt;
&lt;p&gt;Prettier&apos;s style conventions are defined by industry wide best practices and behaviors. Such that when you are learning how to code and you have Prettier installed, it&apos;s as if there&apos;s senior engineer over your shoulder constantly giving you tips and advice on how your code should look.&lt;/p&gt;
&lt;p&gt;This frees you up to worry about what you want your code to do. Letting you focus on more important things - like learning the language - and not learning its customs and conventions. Two things that are extremely hard to pick up in a vacuum.&lt;/p&gt;
&lt;h2&gt;Other reasons&lt;/h2&gt;
&lt;p&gt;Some other reasons why you should use Prettier:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Never have another argument with a co-worker about why their style is wrong and yours is right. Outsource that argument to Prettier and get back to making your app!&lt;/li&gt;
&lt;li&gt;Can clean up existing legacy codebases. This is an echo of the same reason of consistency. Legacy code is rarely touched and if it hasn&apos;t been touched in a while it may be tricky to read. Run Prettier over that code and now you&apos;re in business!&lt;/li&gt;
&lt;li&gt;Prettier stays up to date with community conventions. As style conventions evolve so does Prettier. And when Prettier makes a tweak to its format applying that change is as simple as re-running Prettier over your code.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I use it?&lt;/h1&gt;
&lt;p&gt;Prettier operates as a CLI tool. You install it into your local application and then run its CLI tool to format your code with Prettier.&lt;/p&gt;
&lt;p&gt;You can also install Prettier as an editor plugin, which is my recommended way of using Prettier. I&apos;m going to &lt;a href=&quot;https://prettier.io/docs/en/editors.html&quot;&gt;point you to the official Prettier editors page&lt;/a&gt; to read more information about how to get that setup, but once it&apos;s installed it makes for the best experience.&lt;/p&gt;
&lt;p&gt;You write some code, hit save, and Prettier makes your code...pretty. It&apos;s tremendous.&lt;/p&gt;
&lt;p&gt;If you want to get Prettier running via CLI it takes two steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install it: &lt;code&gt;npm install --save-dev prettier&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run it: &lt;code&gt;npx prettier [opts] [filenames]&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you want to customize Prettier then you have one more step:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make a &lt;code&gt;.prettierrc&lt;/code&gt; file and &lt;a href=&quot;https://prettier.io/docs/en/options.html&quot;&gt;set your options.&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Prettier has made me a better programmer by allowing me to focus on more important things like what my code is doing, not how it looks.&lt;/p&gt;
&lt;p&gt;I love that I can write sloppy code that may be somewhat illegible, and Prettier comes along and makes everything clean and tidy.&lt;/p&gt;
&lt;p&gt;Sometimes I have a lot of fun writing intentionally gross looking code (like above) and watching Prettier swoop in and make it look &lt;a href=&quot;https://www.youtube.com/watch?v=-JfEJq56IwI&quot;&gt;so fresh and so clean, clean&lt;/a&gt;.&lt;/p&gt;
</content:encoded></item><item><title>Use React.lazy and Suspense to Code-Split Your App</title><link>https://hswolff.com/blog/react-lazy-and-suspense/</link><guid isPermaLink="true">https://hswolff.com/blog/react-lazy-and-suspense/</guid><pubDate>Sun, 02 Dec 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The marquee feature of &lt;a href=&quot;https://reactjs.org/blog/2018/10/23/react-v-16-6.html&quot;&gt;React 16.6.0&lt;/a&gt; was the introduction of &lt;code&gt;React.lazy&lt;/code&gt;, a built in way to do code-splitting with React.&lt;/p&gt;
&lt;p&gt;In all honesty I was hoping to have had this article written about two weeks ago, but in an entirely ironic and unintentional sequence of events that didn&apos;t happen because I got lazy. Well that&apos;s not truly fair to say - more so that I ran out of time and rather than stay up till 2am one night I decided that getting a good night sleep would be in my best interest. Or put another way, I got lazy. Who needs sleep? (sarcasm)&lt;/p&gt;
&lt;p&gt;So back to the topic at hand: &lt;code&gt;React.lazy&lt;/code&gt; lets you lazily load components via code splitting in a React aware manner. Let&apos;s break down what each of those things mean.&lt;/p&gt;
&lt;p&gt;And before I delve into lines and lines of text, let me give you the fun option of watching me teach you in video form. I&apos;m entertaining, educational, and above all else it keeps with the spirit of this topic. You can be lazy and rest your mind and let me dance around your computer screen in video form.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/SGSAPfjOHBM&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h1&gt;Code-splitting&lt;/h1&gt;
&lt;p&gt;Back in the old days of web development people would concat their JavaScript files together and ship that off to the browser. It was the professional&apos;s solution towards shipping JavaScript applications to the browser and well...it was as good as it got back then.&lt;/p&gt;
&lt;p&gt;Nowadays people use module bundlers such as &lt;a href=&quot;https://webpack.js.org/&quot;&gt;Webpack&lt;/a&gt; or &lt;a href=&quot;https://parceljs.org/&quot;&gt;Parcel&lt;/a&gt; to do the same thing we used to just in a much more high brow manner. Instead of simple file concatenation we can now use module systems such as CommonJS (&lt;code&gt;require&lt;/code&gt;, &lt;code&gt;module.exports&lt;/code&gt;) or ES Modules (&lt;code&gt;import&lt;/code&gt;, &lt;code&gt;export&lt;/code&gt;) to define the dependencies between files.&lt;/p&gt;
&lt;p&gt;This is great however sometimes these web applications get mighty large and it gets mighty heavy to send all that JavaScript to a person&apos;s browser all at once. I&apos;ve seen some JS bundles north of 10MB - and that ain&apos;t no load that I want to lift on every page refresh.&lt;/p&gt;
&lt;p&gt;So the solution to that problem is to code-split an application. Rather than including all dependencies up front, we can actually tell our module bundler that in some places it&apos;s ok to be lazy, that we can chill, kick up our feet, rest a while. We effectively tell our module bundler that we have some parts of our application that is aggressively chill and can be sent to the browser lazily and barefoot (barefootedness, as you know, is the strongest display of laziness).&lt;/p&gt;
&lt;p&gt;Here&apos;s some code that sends everything to the browser at once:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import Description from &apos;./Description&apos;;

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Movie&amp;lt;/h1&amp;gt;
      &amp;lt;Description /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now how do we tell our module bundler to lazily load that module?&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/tc39/proposal-dynamic-import&quot;&gt;Dynamic import proposal&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This proposal adds a new feature to ES Modules that allows us to define our code dependencies asynchronously.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;import&lt;/code&gt; statement can now be used as a function which returns a Promise that resolves to the module that is being requested.&lt;/p&gt;
&lt;p&gt;To use that feature requires just a small change.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-import Description from &apos;./Description&apos;;
+const Description = import(&apos;./Description&apos;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What this change in dependency declaration tells Webpack or Parcel is that module, &lt;code&gt;Description&lt;/code&gt; is no longer needed right away - we can wait to load it at a point in time when the application needs it.&lt;/p&gt;
&lt;p&gt;And what that lets the module bundler do is create a separate &lt;code&gt;.js&lt;/code&gt; file that contains the lazily loaded module.&lt;/p&gt;
&lt;p&gt;And that&apos;s what we call &lt;em&gt;code-splitting&lt;/em&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What was once 1 file is now 2. It&apos;s been split, and that has made all the difference.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.poetryfoundation.org/poems/44272/the-road-not-taken&quot;&gt;&lt;em&gt;Robert Frost&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;However that story is just the beginning for us wanting to code-split React Components.&lt;/p&gt;
&lt;h1&gt;Lazy Loading React Components&lt;/h1&gt;
&lt;p&gt;Now that we&apos;ve defined our code-split location we now have some homework to do to properly render the component.&lt;/p&gt;
&lt;p&gt;We have to call the &lt;code&gt;import()&lt;/code&gt; function, wait for the &lt;code&gt;Promise&lt;/code&gt; to resolve, and then take that value and render that in our component.&lt;/p&gt;
&lt;p&gt;It&apos;s a lot of book-keeping which tends to be redundant and error prone.&lt;/p&gt;
&lt;p&gt;It looks more or less like this to fully lazily load that component.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// We make this a function so we don&apos;t start loading
// this lazily loaded module on page load.
// Which would kind of defeat the point of lazy loading.
const LoadDescription = () =&amp;gt; import(&apos;./Description&apos;);

class App extends React.Component {
  state = {
    Description: null,
  };

  componentDidMount() {
    LoadDescription.then(Description =&amp;gt; {
      this.setState({ Description: Description.default });
    });
  }

  render() {
    const { Description } = this.state;
    return (
      &amp;lt;div&amp;gt;
        &amp;lt;h1&amp;gt;My Movie&amp;lt;/h1&amp;gt;
        {Description ? &amp;lt;Description /&amp;gt; : &apos;Loading...&apos;}
      &amp;lt;/div&amp;gt;
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Luckly for us React developers there&apos;s a very popular and well maintained library that already does this for us called &lt;a href=&quot;https://github.com/jamiebuilds/react-loadable&quot;&gt;react-loadable&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It works, it&apos;s great, I use it, I recommend it.&lt;/p&gt;
&lt;p&gt;It removes all that boilerplate so all you have to write is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import Loadable from &apos;react-loadable&apos;;

const LoadableDescription = Loadable({
  loader: () =&amp;gt; import(&apos;./Description&apos;),
  loading() {
    return &amp;lt;div&amp;gt;Loading...&amp;lt;/div&amp;gt;;
  },
});

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Movie&amp;lt;/h1&amp;gt;
      &amp;lt;LoadableDescription /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Aaaaah...so much better.&lt;/p&gt;
&lt;p&gt;So then why are we talking about &lt;code&gt;React.lazy&lt;/code&gt;?&lt;/p&gt;
&lt;h1&gt;Suspense&lt;/h1&gt;
&lt;p&gt;One main drawback of &lt;code&gt;react-loadable&lt;/code&gt; is that it works on a per-component basis. What I mean by that is for every individual component that you may want to lazily load you have to define its own discrete loading state. Sure you can use a common component so that all your loading states look the same but that&apos;s the issue - you&apos;re going to see a loading state for every individual component that is lazily loading.&lt;/p&gt;
&lt;p&gt;So if I had multiple lazily loaded components it&apos;s possible I may see three, or four, or nine-thousand spinners on my page before all those extra JS bundles are downloaded, parsed, and executed.&lt;/p&gt;
&lt;p&gt;That&apos;s not the best user experience.&lt;/p&gt;
&lt;p&gt;That&apos;s also the bad user experience that &lt;code&gt;React.lazy&lt;/code&gt; solves.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;React.lazy&lt;/code&gt; is built to be used in tandem with a &lt;code&gt;Suspense&lt;/code&gt; component. &lt;code&gt;React.lazy&lt;/code&gt; is essentially the same thing as &lt;code&gt;react-loadable&lt;/code&gt;, however instead of defining all your loading states on every &lt;code&gt;React.lazy&lt;/code&gt; usage, you define it on the &lt;code&gt;Suspense&lt;/code&gt; component.&lt;/p&gt;
&lt;p&gt;What that means is you can have as many &lt;code&gt;React.lazy&lt;/code&gt; components as you want, but you&apos;ll only ever see the one loading state on the &lt;code&gt;Suspense&lt;/code&gt; component.&lt;/p&gt;
&lt;p&gt;Not only that, but your &lt;code&gt;React.lazy&lt;/code&gt; components can be placed at any depth in your React component tree. So any far removed, remote child component can be lazy and &lt;code&gt;Suspense&lt;/code&gt; will still handle that case in one nice and neat location.&lt;/p&gt;
&lt;p&gt;(If you&apos;re curious the way this works is similar to how the &lt;a href=&quot;https://reactjs.org/docs/error-boundaries.html&quot;&gt;Error Boundaries&lt;/a&gt; work in React, which itself is similar to how try/catch works in JavaScript. It&apos;s turtles, just &lt;a href=&quot;https://en.wikipedia.org/wiki/Turtles_all_the_way_down&quot;&gt;turtles all the way down.&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;So let&apos;s take a look at how we&apos;d use &lt;code&gt;React.lazy&lt;/code&gt; using our same super verbose and complex example (sarcasm (gosh I wish sarcasm translated better online (just like how I wish writing asides to my own writing worked better then just nesting parenthesis (what is this, Lisp?))))&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import React, { Suspense } from &apos;react&apos;;
const Description = React.lazy(() =&amp;gt; import(&apos;./Description&apos;));

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Movie&amp;lt;/h1&amp;gt;
      &amp;lt;Suspense fallback=&quot;Loading...&quot;&amp;gt;
        &amp;lt;Description /&amp;gt;
      &amp;lt;/Suspense&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🤓 Neat!&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Suspense&lt;/code&gt; component will catch any &lt;code&gt;React.lazy&lt;/code&gt; instances and then render just the one fallback component.&lt;/p&gt;
&lt;p&gt;So if we had the following, we&apos;d still only render one fallback component.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import React, { Suspense } from &apos;react&apos;;
const Description = React.lazy(() =&amp;gt; import(&apos;./Description&apos;));

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Movie&amp;lt;/h1&amp;gt;
      &amp;lt;Suspense fallback=&quot;Loading...&quot;&amp;gt;
        &amp;lt;Description /&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;span&amp;gt;Cast&amp;lt;/span&amp;gt;
          &amp;lt;AnotherLazyComponent /&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/Suspense&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

// AnotherLazyComponent.js (imagine in another file)
const AndYetAnotherLazyComponent = React.lazy(() =&amp;gt;
  import(&apos;./AndYetAnotherLazyComponent&apos;)
);

function AnotherLazyComponent() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;span&amp;gt;So...so..lazy..&amp;lt;/span&amp;gt;
      &amp;lt;AndYetAnotherLazyComponent /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But where things get &lt;em&gt;really&lt;/em&gt; neat is if we use additional &lt;code&gt;Suspense&lt;/code&gt; components to further customize how we want to show our loading state.&lt;/p&gt;
&lt;p&gt;Through the power of React and the sweet wonders of declarative programming the flexibility of UI behavior is put into our hands so that we can decide easily and without much effort where we want to handle and show fallback components.&lt;/p&gt;
&lt;p&gt;So let&apos;s say we want to highlight how lazy our &lt;code&gt;AnotherLazyComponent&lt;/code&gt; is. We can do that via:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Movie&amp;lt;/h1&amp;gt;
      &amp;lt;Suspense fallback=&quot;Loading...&quot;&amp;gt;
        &amp;lt;Description /&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;Suspense fallback=&quot;Sorry for our laziness&quot;&amp;gt;
            &amp;lt;span&amp;gt;Cast&amp;lt;/span&amp;gt;
            &amp;lt;AnotherLazyComponent /&amp;gt;
          &amp;lt;/Suspense&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/Suspense&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example we&apos;ve broken up our fallback handling into two separate &lt;code&gt;Susepense&lt;/code&gt; components. When our &lt;code&gt;AnotherLazyComponent&lt;/code&gt; starts to load we&apos;ll show our apologetic fallback message.&lt;/p&gt;
&lt;p&gt;What this also means, which is even more powerful and exciting, is if &lt;code&gt;AnotherLazyComponent&lt;/code&gt; takes a long time to load it will no longer affect the rest of the components being rendered. We&apos;ve essentially cordoned off &lt;code&gt;AnotherLazyComponent&lt;/code&gt; and all its children and prevented its lagginess and supreme laziness from slowing down the rest of our application.&lt;/p&gt;
&lt;p&gt;React will show &quot;Sorry for our laziness&quot; until &lt;code&gt;AnotherLazyComponent&lt;/code&gt; and its children have loaded and rendered, but React will show &lt;code&gt;Description&lt;/code&gt; as soon as it is loaded and rendered - and &lt;em&gt;not wait for &lt;code&gt;AnotherLazyComponent&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Compare this to the previous example without the second &lt;code&gt;Suspense&lt;/code&gt; component. In that scenario React would have waited for &lt;strong&gt;every&lt;/strong&gt; lazily loaded child component to load and render before showing anything.&lt;/p&gt;
&lt;p&gt;We&apos;ve decided which components we want to show as soon as we can, and which we&apos;re ok to show later.&lt;/p&gt;
&lt;p&gt;It&apos;s a hard concept to really understand in written word, so I would suggest you checking out my video posted above to get a feel for what I mean.&lt;/p&gt;
&lt;p&gt;If you don&apos;t then just take my word for it: it&apos;s cool to be lazy.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;React.lazy&lt;/code&gt; takes practices and libraries that have already existed in the ecosystem and codified them as a best practice by providing first-party support.&lt;/p&gt;
&lt;p&gt;This is a wonderful step forward for React and is an example of what it does best: make hard things simple and simple things...verbose. That&apos;s a joke. But it&apos;s a joke based on truth (those make the best types of jokes).&lt;/p&gt;
&lt;p&gt;I&apos;d be remiss not to mention Async or Concurrent React. Those two words have been bandied about with Suspense and make no bones about it, Concurrent React will leverage the &lt;code&gt;Suspense&lt;/code&gt; component but that&apos;s a blog post for another time. As in when it&apos;s done and released. But yes, you eagle eyed reader, &lt;code&gt;Suspense&lt;/code&gt; is an overture on bigger things to come. For now the React team is starting on a wonderfully lazy foot.&lt;/p&gt;
&lt;p&gt;If you&apos;re using React 16.6.0 or later you can start using &lt;code&gt;React.lazy&lt;/code&gt; and &lt;code&gt;Suspense&lt;/code&gt; now! And I&apos;d encourage you to do so if you&apos;re interested! It&apos;s definitely a power user feature and not something that every application developer will need right away. But it&apos;s there for you to use and play with.&lt;/p&gt;
&lt;p&gt;If you have played around with it I&apos;m curious to hear your thoughts.&lt;/p&gt;
&lt;p&gt;Or better yet, share your experiences with me in video form. Cuz that&apos;s the laziest way for me to consume that info, and I want to do my best to keep in the spirit of the feature at hand.&lt;/p&gt;
</content:encoded></item><item><title>Priorities</title><link>https://hswolff.com/blog/priorities/</link><guid isPermaLink="true">https://hswolff.com/blog/priorities/</guid><pubDate>Sun, 25 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This past weekend was Thanksgiving which meant that I spent the past couple of days with family. It was great to unplug and get away from the ridiculously fast paced world of tech and coding. However by virtue of unplugging it meant I wasn’t able to make anything. Instead I was able to focus on health and family, letting everything else I usually worry about fall to the wayside.&lt;/p&gt;
&lt;p&gt;I’m a firm believer in the following priorities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Health&lt;/li&gt;
&lt;li&gt;Family&lt;/li&gt;
&lt;li&gt;Everything else&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Health&lt;/h1&gt;
&lt;p&gt;Without your health you don’t have anything. If I’m feeling unhealthy then everything else that I’m preoccupied with immediately becomes de-prioritized.&lt;/p&gt;
&lt;p&gt;Health covers anything and everything related to your well-being. From the physical to the mental and everything in between.&lt;/p&gt;
&lt;p&gt;Health is what enables you to do everything else, and if you’re not taking care of yourself then you won’t be able to do anything else.&lt;/p&gt;
&lt;h1&gt;Family&lt;/h1&gt;
&lt;p&gt;I say family generically, in the spirit of those you love and trust.&lt;/p&gt;
&lt;p&gt;If you’re not maintaining and nurturing the relationships you have with your family then you’re going to be in for a lonely time, and life is hard enough when you try to go it alone.&lt;/p&gt;
&lt;p&gt;Family is there to nurture you back to health when you’re feeling unwell, and family is there to celebrate with you in your times of joy.&lt;/p&gt;
&lt;p&gt;Family is the backbone to all your endeavors, making tasks that may feel impossible, possible.&lt;/p&gt;
&lt;h1&gt;Everything else&lt;/h1&gt;
&lt;p&gt;If you have your health, and you have family, then you can start tackling whatever else tickles your fancy. Usually that means work or a hobby, but truly it’s up to you. Whatever it is should be rewarding and enriching.&lt;/p&gt;
&lt;p&gt;For me it’s work and all my side projects, such as this blog and making YouTube videos. They make me feel accomplished and productive, two feelings that I greatly enjoy.&lt;/p&gt;
&lt;h1&gt;Remember your priorities&lt;/h1&gt;
&lt;p&gt;It’s always important to remember your priorities.&lt;/p&gt;
&lt;p&gt;This weekend my priority was family. Then I made health my priority by not staying up too late to make a video and exhaust myself.&lt;/p&gt;
&lt;p&gt;After all that was done I was able to tackle everything else. Such as this blog. Cuz it makes me feel good to make something.&lt;/p&gt;
&lt;p&gt;What are your priorities?&lt;/p&gt;
</content:encoded></item><item><title>React Hooks</title><link>https://hswolff.com/blog/react-hooks/</link><guid isPermaLink="true">https://hswolff.com/blog/react-hooks/</guid><pubDate>Sun, 11 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;React Hooks! Hooks! Hooks! Hooks!&lt;/p&gt;
&lt;p&gt;Sorry, had to yell that a few times to get it out of my system.&lt;/p&gt;
&lt;p&gt;I definitely find React Hooks to be one of the most exciting new features that has hit React in a long time. I don&apos;t think I&apos;ve been this excited about a new feature since React Fragments and that was way back in the initial React v16.0.0 release...&lt;em&gt;last year&lt;/em&gt;. So I guess that means I haven&apos;t been excited about React for an entire year? That&apos;s not true, but if it gets you to read the rest of this post then let&apos;s say it is.&lt;/p&gt;
&lt;h1&gt;What is React Hooks?&lt;/h1&gt;
&lt;p&gt;Let&apos;s steal from the official docs as they say it best:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hooks are a new feature proposal that lets you use state and other React features without writing a class.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So what does that mean?&lt;/p&gt;
&lt;p&gt;Before React Hooks you had the following ways to write a React Component:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Class Component: This is everyone&apos;s tried and true, most favorite, most popular, way of writing a React Component. It is the most full featured way of writing a React Component as it gives you access to a render method, lifecycle methods so (you can plug into events of the React rendering lifecyle), and most importantly, they can have their own local state.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;class MyComponent extends React.Component
    state = {
        ofMind: &apos;Alica Keys&apos;,
    };

    componentDidUpdate() {
        console.log(&quot;I&apos;m the &apos;life&apos; of the party, and I &apos;cycle&apos; around.&quot;);
    }

    render() {
        render &amp;lt;h1&amp;gt;Oh Wowwwww&amp;lt;/h1&amp;gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Pure Class Component: Just like our favorite Class Component this has a built in optimization to only re-render your component if your state and props change.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;class MyComponent extends React.PureComponent
    state = {
        ofPurity: &apos;Purell for Clean Hands&apos;,
    };

    componentDidMount() {
        console.log(&quot;I still have lifecycle support!&quot;);
    }

    render() {
        render &amp;lt;h1&amp;gt;But now I only change if my `state` and `props` do!&amp;lt;/h1&amp;gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Function Component: Don&apos;t care about lifecycles? Not worried about local state? Only care about UI? This is your sweet spot, letting you create a nice and simple component that just renders UI. Best of all? It&apos;s just a function!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;function IAmAComponent() {
  return &amp;lt;h2&amp;gt;But I&apos;m just a function!&amp;lt;/h2&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Pure Function Components: &lt;a href=&quot;https://reactjs.org/blog/2018/10/23/react-v-16-6.html&quot;&gt;Fresh off the presses with React 16.6.0&lt;/a&gt; you can now use &lt;code&gt;React.memo&lt;/code&gt; to replicate the functionality of a Pure Class Component with a memoized Function Component. Before &lt;code&gt;React.memo&lt;/code&gt; you couldn&apos;t optimize the performance of a function component, and if you wanted to you&apos;d have to refactor the component into a Class Component. Well, no longer!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;React.memo(function IAmMemo() {
  return &amp;lt;h2&amp;gt;Ized, Ized, Baby&amp;lt;/h2&amp;gt;;
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I count 4 ways of writing a React Component, split into two camps.&lt;/p&gt;
&lt;p&gt;You can write a component as a Class or as a Function. However if you write a component as a function you&apos;re unable to have local state or access lifecycle methods. If you need those two features you have to refactor your component into a Class.&lt;/p&gt;
&lt;p&gt;That is, until now.&lt;/p&gt;
&lt;p&gt;React Hooks fills that hole. With React Hooks you can now have local state and access lifecycle behaviors in a function, letting you have the full expressive power of a React component and retain the nice brevity of a function.&lt;/p&gt;
&lt;p&gt;That alone is what I&apos;m most excited about. The fact I can now have local state in a Function Component is so lovely it makes me want to kiss my code editor. Not sure what good that&apos;ll do me, but well, just wanted to show you my level of affection.&lt;/p&gt;
&lt;h1&gt;Enough talk, show me the code!&lt;/h1&gt;
&lt;p&gt;Honestly I encourage you to read the &lt;a href=&quot;https://reactjs.org/docs/hooks-overview.html&quot;&gt;official React docs on Hooks&lt;/a&gt; as they&apos;ve done an incredible job refining and honing the concepts and ideas that you should know in order to learn and understand Hooks.&lt;/p&gt;
&lt;p&gt;However, you&apos;re on my blog, so I&apos;ll take a crack at explaining Hooks as well.&lt;/p&gt;
&lt;p&gt;And in fact, if you&apos;re tired of having to read words on a page, you can even go onto my YouTube channel and watch me explain Hooks in video form. Think of it as me shoving words into your brain rather than you pulling the words from my blog into your eyes. Weird way to describe that, sorry about that.&lt;/p&gt;
&lt;h2&gt;Learn Hooks with Video&lt;/h2&gt;
&lt;p&gt;I have three videos that give you a great introduction to learning about Hooks.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/jd8R0a2Ur8Q&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/fnT5b2u1PHE&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;videoWrapper&quot;&amp;gt;
&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/YKmiLcXiMMo&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;React Hooks are a set of primitive APIs that allow you to, uh, &lt;em&gt;hook into&lt;/em&gt; React from your Function Component.&lt;/p&gt;
&lt;p&gt;These APIs are plain functions that do what they are named. Which is something I always respect, when a function is named after what it does.&lt;/p&gt;
&lt;h2&gt;useState&lt;/h2&gt;
&lt;p&gt;If you want to use state in a Function Component you can do so via the &lt;code&gt;useState&lt;/code&gt; hook:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function CounterFunction() {
  const [count, incrementCount] = useState(0);

  return (
    &amp;lt;div&amp;gt;
      Current count: {count}
      &amp;lt;button onClick={() =&amp;gt; incrementCount(count + 1)}&amp;gt;Increment&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;useState&lt;/code&gt; takes one argument, which is the initial value for that state. Something to highlight here is that &lt;code&gt;useState&lt;/code&gt; can take any type of data - it can be a primitive, an object, or an array. This is a big difference to how state works on a Class Component. On a Class Component state is &lt;em&gt;always&lt;/em&gt; an object, and you put things on that object. If all you want to keep track of in a function is a number, you can just have state be an integer. This makes things so much simpler in my opinion as React is no longer prescribing how you should be desiging your application.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;useState&lt;/code&gt; returns an array with two items. The first is the current value stored in state, and the second is a function that lets you update the state. The convention being put forth by the React core team is to use &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Array_destructuring&quot;&gt;array destructuring&lt;/a&gt; to make the developer experience a little more pleasant.&lt;/p&gt;
&lt;p&gt;So instead of doing this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const state = useState(0);
const count = state[0];
const incrementCount = state[1];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You destructure the values in the array directly:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const [count, incrementCount] = useState(0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Makes for a much better time.&lt;/p&gt;
&lt;p&gt;Also what&apos;s nice about having the values be in an array is you can name them whatever is relevant to your function. So if you&apos;re storing text you can have it be:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const [name, setName] = useState(&apos;Harry&apos;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or whatever else makes sense.&lt;/p&gt;
&lt;p&gt;The updater function, which is the second item returned in the array (in our case &lt;code&gt;incrementCount&lt;/code&gt; and &lt;code&gt;setName&lt;/code&gt;) lets you update your state value. What I find interesting about this function is that you can update your state with whatever you want. So even though you may have begun your state as a number, there&apos;s nothing stopping you from setting it to a string, or an array, or an object. Nothing except the sanity of your co-workers, or yourself in six month time when you read your code and scratch your head wondering why you changed a number to a string and then tried to &lt;code&gt;Object.keys&lt;/code&gt; on the string and you&apos;re curious why you never had a bug show up in this piece of code and you start questioning if JavaScript even makes sense anymore.&lt;/p&gt;
&lt;p&gt;Woah, sorry, that got a little intense at the end there.&lt;/p&gt;
&lt;p&gt;But in any case, that&apos;s &lt;code&gt;useState&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;useEffect&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;useEffect&lt;/code&gt; is the Hooks&apos; answer to lifecycle methods. What I find personally super powerful about &lt;code&gt;useEffect&lt;/code&gt; is that it gives you the power of lifecycle methods without requiring you learn the internals of React.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;useEffect&lt;/code&gt; takes up to two arguments. The first argument is the effect you want to run. It&apos;s the piece of functionality that you would have normally put in &lt;code&gt;componentDidMount&lt;/code&gt; or &lt;code&gt;componentDidUpdate&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The second argument is optional. If present, it&apos;s an array of values that &lt;code&gt;useEffect&lt;/code&gt; uses to decide when to re-run the function given in the first argument.&lt;/p&gt;
&lt;p&gt;If you don&apos;t provide a second argument then &lt;code&gt;useEffect&lt;/code&gt; will re-run your effect after each render of your React Component. The React Core team decided on this default behavior after very careful consideration. By having it run on every render you can rely on behavior that is most intuitive and consistent.&lt;/p&gt;
&lt;p&gt;However it may not be the most performant. And that&apos;s where the second argument comes in.&lt;/p&gt;
&lt;p&gt;Let&apos;s look at an example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function MyComponent({ userId }) {
  const [repos, setRepos] = useState([]);

  useEffect(
    // This is our effect. It fetches data from the GitHub API
    // and then updates our local state when the Fetch resolves.
    () =&amp;gt; {
      fetchGitHubRepos(userId).then(repos =&amp;gt; {
        setRepos(repos);
      });
    },
    // This is the second argument to `useEffect`. We&apos;re passing
    // in the `userId` value which is a prop given to this component.
    // When that value changes, then we&apos;ll re-run our effect.
    // Without this value we would have refetched the GitHub API
    // everytime this component re-rendered. That would be no good.
    [userId]
  );

  return (
    &amp;lt;div&amp;gt;
      {repos.map(repo =&amp;gt; (
        &amp;lt;div&amp;gt;{repo.name}&amp;lt;/div&amp;gt;
      ))}
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&apos;s a third usage of &lt;code&gt;useEffect&lt;/code&gt; and it&apos;s bundled into the effect function.&lt;/p&gt;
&lt;p&gt;If you return a function from the effect function (the function given as the first argument) then React will call that function before it re-runs your effect, or when the Function Component is being removed from the page.&lt;/p&gt;
&lt;p&gt;This is basically the same functionality as &lt;code&gt;componentWillUnmount&lt;/code&gt; lifecycle method. But in Hook form.&lt;/p&gt;
&lt;h2&gt;More Hooks&lt;/h2&gt;
&lt;p&gt;There&apos;s many more Hooks that I&apos;m not going to delve into right now.&lt;/p&gt;
&lt;p&gt;I cover a few more in my &lt;a href=&quot;https://www.youtube.com/embed/YKmiLcXiMMo&quot;&gt;Advanced Hooks Video&lt;/a&gt;. So if you are interested then please check that video out.&lt;/p&gt;
&lt;p&gt;What other Hooks are there?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;useReducer&lt;/code&gt;: Did someone put Redux into React?&lt;/li&gt;
&lt;li&gt;&lt;code&gt;useContext&lt;/code&gt;: An easier-to-use API for consuming Context values.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;useMemo&lt;/code&gt;: To cache expensive values and not have to re-compute them every time. For example, an expensive client-side filter function.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;...and more!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://reactjs.org/docs/hooks-reference.html&quot;&gt;Check the Hooks API Reference Docs for the full list&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Custom Hooks&lt;/h2&gt;
&lt;p&gt;It would truly do you a disservice if I didn&apos;t talk about Custom Hooks. It&apos;s simultaneously the biggest strength of Hooks whilst having the most understated API.&lt;/p&gt;
&lt;p&gt;Custom Hooks, as described from the React docs page:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Building your own Hooks lets you extract component logic into reusable functions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So let&apos;s take our previous GitHub fetch example above and extract that functionality into a custom Hook.&lt;/p&gt;
&lt;p&gt;A Custom Hooks is just a function that starts with &lt;code&gt;use&lt;/code&gt; and contains other Hook calls. That&apos;s it. It&apos;s pretty sweet.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function useGitHubRepoAPI(userId) {
  const [repos, setRepos] = useState([]);

  useEffect(() =&amp;gt; {
    fetchGitHubRepos(userId).then(repos =&amp;gt; {
      setRepos(repos);
    });
  }, [userId]);

  return repos;
}

function MyComponent({ userId }) {
  const repos = useGitHubRepoAPI(userId);

  return (
    &amp;lt;div&amp;gt;
      {repos.map(repo =&amp;gt; (
        &amp;lt;div&amp;gt;{repo.name}&amp;lt;/div&amp;gt;
      ))}
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What this means is I can now fetch data from GitHub anywhere I want and all that logic and state is encapsulated within the Custom Hook.&lt;/p&gt;
&lt;p&gt;Think of other things that require lifecycle methods and use state.&lt;/p&gt;
&lt;p&gt;Such as &lt;a href=&quot;https://codesandbox.io/s/23jk7wlw4y&quot;&gt;&lt;code&gt;useOnClickOutside&lt;/code&gt;&lt;/a&gt;. Bind to global clicks and call a callback when a click occurs.&lt;/p&gt;
&lt;p&gt;Or &lt;a href=&quot;https://codesandbox.io/s/jj61r2w6z5&quot;&gt;&lt;code&gt;useWindowSize&lt;/code&gt;&lt;/a&gt;. Call it to get back the current size of the window and that value updates as the window updates.&lt;/p&gt;
&lt;p&gt;The possibilities are literally limitless.&lt;/p&gt;
&lt;p&gt;And they&apos;ll make writing applications so much easier.&lt;/p&gt;
&lt;h1&gt;Where can I use Hooks?&lt;/h1&gt;
&lt;p&gt;You can only use Hooks within a Function Component. Which is kind of an interesting move by the React core team. I&apos;m sure it wasn&apos;t intentional but it is funny that they provide some really great functionality via Hooks and restrict its usage to only Function components, a historically hobbled part of the React ecosystem.&lt;/p&gt;
&lt;p&gt;In this weird twist of fate Function Components have gone from the red-headed-step-child of React to now one of the most powerful and expressive parts of it.&lt;/p&gt;
&lt;p&gt;Funny how things change.&lt;/p&gt;
&lt;h1&gt;When can I use Hooks?&lt;/h1&gt;
&lt;p&gt;Today! They are officially released in React &lt;code&gt;v16.8.0&lt;/code&gt;. If you want to play around with them then install that version of React and React DOM: &lt;code&gt;npm install --save react@v16.8.0 react-dom@v16.8.0&lt;/code&gt; and you&apos;ll be on your merry way.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;React Hooks are very exciting.&lt;/p&gt;
&lt;p&gt;I believe I saw someone describe Hooks as a new primitive that exposes an entirely new way of writing React applications. I whole-heartedly agree with that description.&lt;/p&gt;
&lt;p&gt;Hooks opens up an entirely new way of writing React apps by letting you access core React functionality and being able to share that functionality via Custom Hooks.&lt;/p&gt;
&lt;p&gt;I&apos;m personally excited about the next new React app I work on. I think writing an entire React application using only Function Components and Hooks is going to unlock all new design patterns and new ways of code-reuse that should make the application both faster to develop, and easier to maintain.&lt;/p&gt;
&lt;p&gt;That&apos;s the holy grail isn&apos;t it? A developer experience that is fast and easy. Hard to obtain but us developers are always trying to get closer to that ideal.&lt;/p&gt;
&lt;p&gt;I think Hooks is a very strong step towards that ideal. At least it is within the context of React. I won&apos;t truly know until I play with Hooks more.&lt;/p&gt;
&lt;p&gt;For now, I know that I&apos;m...&lt;em&gt;hooked&lt;/em&gt;... on React Hooks. It had a great lure and I&apos;ve bitten right into what it&apos;s selling.&lt;/p&gt;
&lt;p&gt;Hopefully I got you interested as well. Or at the very least cleared up some confusions as to what the heck React Hooks is and why people can&apos;t stop making puns about the name.&lt;/p&gt;
&lt;p&gt;To that, I&apos;m guilty as all the rest.&lt;/p&gt;
</content:encoded></item><item><title>Fatherhood</title><link>https://hswolff.com/blog/fatherhood/</link><guid isPermaLink="true">https://hswolff.com/blog/fatherhood/</guid><pubDate>Mon, 07 May 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On April 7th, 2018, my son was born and I became a father.&lt;/p&gt;
&lt;p&gt;His birth turned me into a father. A dad. His daddy. Someone who will always be there for him, no matter what.&lt;/p&gt;
&lt;p&gt;I&apos;ve long wanted to be a father, to have a child. It&apos;s something I&apos;ve wanted for as long as I can remember. Some people grow up wanting to get married, or to buy their first car. I&apos;ve always wanted to be a father. On April 7th my wish came true.&lt;/p&gt;
&lt;p&gt;It takes an awfully long time for a baby to grow. Nine months of waiting around while my wife&apos;s stomach grew. Slow at first and then all of a sudden I was seeing my sons&apos; hand pushing from inside my wife&apos;s belly.&lt;/p&gt;
&lt;p&gt;It was nine months of waiting and stress, worried and anxious that all would turn out ok.&lt;/p&gt;
&lt;p&gt;Then we got near the due date and the anxiety kicked up a notch. We waited, and waited. When would he arrive? Was he ok? What would the birth be like?&lt;/p&gt;
&lt;p&gt;The due date came and went so we continued to wait. Each night we would go to sleep confident that tonight would be the night that he would come. He didn&apos;t come any of those nights.&lt;/p&gt;
&lt;p&gt;We set an induction date for a week past when he was due, a Friday. We were scheduled to come in to the hospital at midnight to start the induction. He was going to come whether he wanted to or not.&lt;/p&gt;
&lt;p&gt;So on the Friday of our scheduled induction my wife and I went out to dinner for our last meal as adults, not parents.&lt;/p&gt;
&lt;p&gt;Back home we settled down in front of the TV. Our bags were packed and we were ready to head into the hospital at midnight.&lt;/p&gt;
&lt;p&gt;Except our son had a different plan.&lt;/p&gt;
&lt;p&gt;At 7:58pm my wife&apos;s water broke. It was time to go to the hospital.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;That night in the hospital was one of the longest in our lives.&lt;/p&gt;
&lt;p&gt;We got to the hospital at 8:38pm and were admitted and given a delivery room. My wife was hooked up to monitors and I was given an oversized chair.&lt;/p&gt;
&lt;p&gt;And then we waited. We waited while counting the contractions. We waited until our son was ready to come out and say hello.&lt;/p&gt;
&lt;p&gt;We ended up waiting 17 hours. I slept maybe four hours that night, my wife slept maybe one or two.&lt;/p&gt;
&lt;p&gt;At noon it was decided we couldn&apos;t wait anymore so we began to push him out.&lt;/p&gt;
&lt;p&gt;So we began to push. And push. And push.&lt;/p&gt;
&lt;p&gt;My wife would push with the contraction as I crouched behind her back, pushing her as well, trying to support her in this life-changing task. The contraction would subside and we would all take a short breather until the next contraction, when we started all over again.&lt;/p&gt;
&lt;p&gt;For a little over an hour we pushed. Until...&lt;/p&gt;
&lt;p&gt;Until at 1:19pm on Saturday afternoon, April 7th, 2018, our son was born.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;The moment my wife and I saw our son emerge, crying and healthy, we were filled with the most sublime type of joy imaginable.&lt;/p&gt;
&lt;p&gt;He was plopped onto my wife&apos;s chest, the most beautiful sight I have ever seen. I began to cry uncontrollably, ultimately ruining my shirt as I was without access to tissues.&lt;/p&gt;
&lt;p&gt;My wife held our son on her chest, content beyond words, and she looked at me, with tears in her eyes, and asked with a serene smile, &quot;Does he look like a Miles?&quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</content:encoded></item><item><title>Top 10 Albums of 2017</title><link>https://hswolff.com/blog/top-10-albums-of-2017/</link><guid isPermaLink="true">https://hswolff.com/blog/top-10-albums-of-2017/</guid><pubDate>Wed, 27 Dec 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;2017 was a year in which many of my current favorite artists put out new albums. Going into the year I was super excited and impatient to get my hands on their newest creations. If I liked what they made before, surely I&apos;ll like what they make today? Sadly that didn&apos;t turn out to be the case.&lt;/p&gt;
&lt;p&gt;Most of the music that I listened to on repeat was from artists that I had never listened to before. Most of them were new artists as well. They breathed new life and sounds into a musical landscape that, without them, would have been pretty boring.&lt;/p&gt;
&lt;p&gt;One of my top dissapointments for the year was the new Grizzly Bear album which never grabbed my full attention. I can typically tell after the first few seconds of an album if I&apos;m going to enjoy it, and I knew - even from the early release of their single - that the new Grizzly Bear album would leave a, well, unbearable impression. That was super disapointing. I&apos;ve loved almost all the previous Grizzly Bear albums and to have one come out that left me with a solid &quot;meh&quot; impression wasn&apos;t fun. (Don&apos;t get me wrong, the album isn&apos;t bad. It&apos;s just not anywhere near as good as their previous works.)&lt;/p&gt;
&lt;p&gt;Also on my list of honorable mentions were follow-up albums from Spoon and The Xx. Spoon (unlike Grizzly Bear) has yet to disapoint me. They almost made it into my top 10 but they got beat out by other albums that were simply better. And The Xx&apos;s album was fine. Nothing will be as good as their first album, but at least this record wasn&apos;t as bad as their second album. But again, there was other music that was just better.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;honorable mentions&lt;/strong&gt; this year, in alphabetical order.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Amine - Good For You&lt;/li&gt;
&lt;li&gt;A Boogie wit Da Hoodie - The Bigger Artist&lt;/li&gt;
&lt;li&gt;Blackbear - digital druglord&lt;/li&gt;
&lt;li&gt;Dirty Projectors - Dirty Projectors&lt;/li&gt;
&lt;li&gt;dvsn - Morning After&lt;/li&gt;
&lt;li&gt;Father John Misty - Pure Comedy&lt;/li&gt;
&lt;li&gt;Four Tet - New Energy&lt;/li&gt;
&lt;li&gt;Grizzly Bear - Painted Ruins&lt;/li&gt;
&lt;li&gt;HAIM - Something To Tell You&lt;/li&gt;
&lt;li&gt;Iron &amp;amp; Wine - Beast Epic&lt;/li&gt;
&lt;li&gt;Jessie Reyez - Kiddo&lt;/li&gt;
&lt;li&gt;Lorde - Melodrama&lt;/li&gt;
&lt;li&gt;mansionz - Mansionz&lt;/li&gt;
&lt;li&gt;Maggie Rogers - Now That the Light Is Fading EP&lt;/li&gt;
&lt;li&gt;Spoon - Hot Thoughts&lt;/li&gt;
&lt;li&gt;St. Vincent - MASSEDUCTION&lt;/li&gt;
&lt;li&gt;The xx - I See You&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The overall trend of genre that I fell in love with this year has been R&amp;amp;B. I&apos;ve loved the crooning voices over grooving baselines that gets my head bobbing up and down while I ride the subway around New York. Getting into a chill groove was also the perfect antidote to an otherwise tumultuous and stressful year (2017, amirite?). My unconscious mind knew what it needed to set itself at ease. Without these albums, this year would have been a whole lot worse.&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;Top 10 Albums of 2017&lt;/h1&gt;
&lt;h2&gt;10. JAY-Z &quot;4:44&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4:44, as most popular music publications have already written, was a raw confessional album of Jay-Z dealing with his demons, insecurities, and bad behavior (namely, cheating on Beyonce). The raw and honest writing combined with Jay-Z&apos;s uncontested rapping prowess produced an album of strong individual tracks that - while very good - did not produce a cohesive album or message. Each track tackles a different subject matter, without any bleeding of subject matter between the songs. If it wasn&apos;t for the individual strength of each track I doubt I would have liked it as much, however it resulted in an album that was hard to listen to on repeat as each song demanded its own individual attention. In some ways this album would be better reviewed by looking at each song apart from the whole, however I usually listen to albums and as a result this one comes in at the bottom of my list.&lt;/p&gt;
&lt;h2&gt;9. Sam Smith &quot;The Thrill of It All&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can&apos;t get over Sam Smith&apos;s voice. Honestly, everytime I think he&apos;s going to miss a note or fall flat he just soars above all my expectations and leaves me dumbfounded at his effortless delivery.&lt;/p&gt;
&lt;p&gt;This is a slow album full of songs that Sam Smith croons over. In fact, you wouldn&apos;t be wrong to call this an adult contemporary album. The general pace of this album is much slower than the first and that&apos;s probably my biggest grievance. I would have loved some Disclosure-influenced songs however I think this record is a much more accurate depiction of who Sam Smith is and what type of music he enjoys creating.&lt;/p&gt;
&lt;h2&gt;8. Daughter &quot;Music From Before the Storm&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&apos;m a big fan of instrumental rock, however I haven&apos;t heard an instrumental rock album that has resonated with me in such a strong way until discovering this album. Truth be told I know nothing about this band or this album past what it sounds like, and I&apos;m more than content by just knowing this album.&lt;/p&gt;
&lt;p&gt;The only thing I enjoy more than instrumental rock is when there&apos;s a touch of vocals added into the mix as an additional instrument. This is done perfectly on this record. It reminds me of one of my favorite records of all time, &lt;a href=&quot;https://en.wikipedia.org/wiki/LP_(Ambulance_LTD_album)&quot;&gt;Ambulance LTD&lt;/a&gt; and that&apos;s probably one of the highest compliments I can give to an album.&lt;/p&gt;
&lt;p&gt;I don&apos;t drive anymore because I live in a city however if I did this would be a record that would keep me warm on a long dark ride into the country.&lt;/p&gt;
&lt;h2&gt;7. Nick Mulvey &quot;Wake Up Now&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&apos;m such a sucker for singer-songwriters. I&apos;ve been a fan of Nick Mulvey for a while now and this album came at just the right time. I&apos;ve sucked it down and listened to it on repeat, letting his acoustic guitar and soft croon pacify my nerves and calm my mind. If I were to ever make my own music this is the type of music I would love to create. Just a man and a guitar, making lovely music together.&lt;/p&gt;
&lt;h2&gt;6. Mount Kimbie &quot;Love What Survives&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I almost missed Mount Kimbie. A few years back I got a last minute invite to see a concert with a friend. The concert was for Mount Kimbie&apos;s second album, and I ended up going without having heard any songs. I was blown away by the concert and Mount Kimbie and I&apos;ve been a huge fan ever since.&lt;/p&gt;
&lt;p&gt;This is their third album and it is 100% just as solid as their first two albums. It is obviously a Mount Kimbie record, keeping their patented sound, however it also manages to branch out and explore new areas. That&apos;s always a hard feat for a band to accomplish and it was thrilling to hear it from Mount Kimbie. (In case you haven&apos;t heard Mount Kimbie before, they create electronic music with catchy drum beats and an otherwise dark feel, similar to the first Xx album. It has guest vocalists as well that round out individual songs.)&lt;/p&gt;
&lt;p&gt;Like all Mount Kimbie albums it has one fatal flaw. It&apos;s too short. Only 11 tracks. Sure, quality is better than quantity, but can&apos;t we get both for once?&lt;/p&gt;
&lt;h2&gt;5. SZA &quot;Ctrl&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&apos;m almost embarrassed to admit it, but I almost overlooked SZA. I had her singles playing on repeat however for some unknown reason I never took a listen to her entire album until December. Abashed at my neglect I started to devour this album, putting it on repeat to understand what I did and didn&apos;t like about the album. I started listening to make sure I hadn&apos;t missed something great, and by my third listen I knew I had indeed almost missed something great. This album has consumed December for me and I honestly didn&apos;t know where to put it on this list as I had to rush my listens. So I stuck it in the middle. Had I listened to it earlier in the year there is a very strong chance it could have made its way higher in the list but alas, you only get to listen to something for the first time once.&lt;/p&gt;
&lt;p&gt;That preamble aside, once I began listening to Ctrl I was unable to stop. The breakout song is undoubtedly &lt;em&gt;The Weekend&lt;/em&gt; but really the entire vibe to this album is wonderful. SZA croons and prowls around every song, ensnaring the listener into her world with effortless ease. The album gives me &lt;a href=&quot;https://en.wikipedia.org/wiki/Autonomous_sensory_meridian_response&quot;&gt;tingles&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;4. Khalid &quot;American Teen&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Remember how I mentioned R&amp;amp;B was a big trend for me this year? Khalid continues that trend, coming up just after SZA.&lt;/p&gt;
&lt;p&gt;I think the best way to describe Khalid is to provide some context. He&apos;s a normal 19 year old kid who has dreams just like everyone else. When he was 14 he &lt;a href=&quot;https://twitter.com/thegreatkhalid/status/427634191329542144&quot;&gt;tweeted that he would love to go the Grammys one day&lt;/a&gt;. &lt;a href=&quot;https://twitter.com/thegreatkhalid/status/935510535482654721&quot;&gt;Five years later it happened&lt;/a&gt;. Those two tweets are probably among my favorite tweets from this year.&lt;/p&gt;
&lt;p&gt;There are so many catchy songs that I keep forgetting they all come from the same album. It&apos;s rare for an album to have standalone hits that still make the sum bigger than its parts but that is what Khalid was able to do with this album.&lt;/p&gt;
&lt;p&gt;Listen to the songs by themselves or in the flow of the album, you&apos;ll be delighted either way.&lt;/p&gt;
&lt;h2&gt;3. Kendrick Lamar &quot;DAMN&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kendrick Lamar is a pretty damn good rapper, isn&apos;t he? I mean, if you didn&apos;t already know that then you have some things to catch up on. But if you are just getting to know Kendrick Lamar off of DAMN then that is a very fine place to start.&lt;/p&gt;
&lt;p&gt;DAMN continues Kendrick Lamar&apos;s place at the top of the rap game. He&apos;s just so &lt;em&gt;damn&lt;/em&gt; good. He knows he&apos;s good but he doesn&apos;t take it for granted. He still puts in the work to make sure every song is just as good as every other.&lt;/p&gt;
&lt;h2&gt;2. Daniel Caesar &quot;Freudian&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you haven&apos;t listened to the breakout track from this record, &lt;a href=&quot;https://www.youtube.com/watch?v=s3GKxnBDu2g&quot;&gt;We Find Love&lt;/a&gt; please do so now. It&apos;s the single song that gave me the most feels out of any other song this entire year. I played it so often I was worried I would wear it out. However I was so grateful when that never happened. When the entire backing choir comes into the song I just get transported away to a place that makes me feel happy and safe. It&apos;s a perfect song.&lt;/p&gt;
&lt;p&gt;The rest of the album isn&apos;t as good as that perfection but if that song is an 11 then everything else varies between a 7 and a 9. The smooth voice of Daniel Caesar combined with his ernest words made this an album full of honest and true emotions and feelings.&lt;/p&gt;
&lt;h2&gt;1. Future &quot;HNDRXX&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think this was my most listened to album of 2017. While the album itself is a little sprawling at 18 tracks, the first 8 tracks are all standouts. I did not expect to like this album as much as I did but more often then not I&apos;d find myself putting this album on while I went out about my day.&lt;/p&gt;
&lt;p&gt;Tracks 3-6 I can play on loop again and again. The groove and song-rap of Future imbued the songs with such a strong vibe that to this day I find myself unable to dance along.&lt;/p&gt;
&lt;p&gt;I don&apos;t think this album will be to everyone&apos;s liking as much as it was to mine but there&apos;s a certain mood and vibe that carries throughout that made this my number one album of 2017.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Small addendum. Here&apos;s my top 20 most played songs from 2017 as well. This is just generated from iTunes.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We Find Love by Daniel Caesar from Freudian with 32&lt;/li&gt;
&lt;li&gt;Young Dumb &amp;amp; Broke by Khalid from American Teen with 27&lt;/li&gt;
&lt;li&gt;Four Years and One Day by Mount Kimbie from Love What Survives with 24&lt;/li&gt;
&lt;li&gt;Supermodel by SZA from Ctrl with 21&lt;/li&gt;
&lt;li&gt;Blue Train Lines (feat. King Krule) by Mount Kimbie from Love What Survives with 20&lt;/li&gt;
&lt;li&gt;Passionfruit by Drake from More Life with 19&lt;/li&gt;
&lt;li&gt;Say Something Loving by The xx from I See You with 19&lt;/li&gt;
&lt;li&gt;Blessed by Daniel Caesar from Freudian with 18&lt;/li&gt;
&lt;li&gt;Love Galore (feat. Travis Scott) by SZA from Ctrl with 18&lt;/li&gt;
&lt;li&gt;Dangerous by The xx from I See You with 18&lt;/li&gt;
&lt;li&gt;Best Part (feat. H.E.R.) by Daniel Caesar from Freudian with 17&lt;/li&gt;
&lt;li&gt;Mourning Sound by Grizzly Bear from Painted Ruins with 17&lt;/li&gt;
&lt;li&gt;Too Good at Goodbyes by Sam Smith from The Thrill of It All (Special Edition) with 17&lt;/li&gt;
&lt;li&gt;Keep Running by Tei Shi from Crawl Space with 17&lt;/li&gt;
&lt;li&gt;No Promises by A Boogie wit da Hoodie from The Bigger Artist with 16&lt;/li&gt;
&lt;li&gt;Glass by Daughter from Music From Before the Storm with 16&lt;/li&gt;
&lt;li&gt;My Collection by Future from HNDRXX with 16&lt;/li&gt;
&lt;li&gt;American Teen by Khalid from American Teen with 16&lt;/li&gt;
&lt;li&gt;Saved by Khalid from American Teen with 16&lt;/li&gt;
&lt;li&gt;Lips by The xx from I See You with 16&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>Experiences With GraphQL</title><link>https://hswolff.com/blog/experiences-with-graphql/</link><guid isPermaLink="true">https://hswolff.com/blog/experiences-with-graphql/</guid><pubDate>Sun, 13 Aug 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A couple of months ago I started working on a side project called TV Chat. My goal with this project was to create a website where people online could come together to chat about tv shows as they were airing live on TV. I&apos;m a big tv watcher, and I like watching TV shows with friends and family. However my tastes don&apos;t always align with theirs. So my hope was to create TV Chat so that I could chat with other fans of the show as it was airing!&lt;/p&gt;
&lt;p&gt;Alas, the project did not come to complete fruition. As I started thinking about the cost to maintain the chatrooms and worrying about how to monetize the site so it could pay for itself, I got a little overwhelmed with the prospect of actually releasing it as a finished product and decided it would be best to put it so hard on the back burner that it&apos;s for all intents and purposes dead.&lt;/p&gt;
&lt;p&gt;However I did code a lot when writing this app. I used it as a learning experience to create a &lt;a href=&quot;http://graphql.org/&quot;&gt;GraphQL&lt;/a&gt; server with &lt;a href=&quot;http://dev.apollodata.com/&quot;&gt;Apollo&lt;/a&gt;, and I even went so far to use their &lt;a href=&quot;https://dev-blog.apollodata.com/graphql-subscriptions-in-apollo-client-9a2457f015fb&quot;&gt;experimental support for GraphQL subscriptions&lt;/a&gt; (which turned out to be a mistake, more on that later). I learned a lot about GraphQL in this process. Things that I found worked great, and areas of difficulty I didn&apos;t expect.&lt;/p&gt;
&lt;p&gt;Rather than have all that code go stale sitting on my laptop I figured it&apos;d be better for it to grow old on my GitHub profile. Perhaps mature like a fine wine. Or even better, uphold the motto of &apos;one man&apos;s trash is another man&apos;s treasure&apos; and maybe someone picks up development and actually polishes it into a finished product!&lt;/p&gt;
&lt;p&gt;Enough jibber jabber. &lt;a href=&quot;https://github.com/hswolff/tvchat&quot;&gt;The source code is available here.&lt;/a&gt; &lt;a href=&quot;http://tv.hswolff.com/&quot;&gt;An online working example is available here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What follows are my experiences while creating a GraphQL powered React application.&lt;/p&gt;
&lt;h1&gt;GraphQL&lt;/h1&gt;
&lt;p&gt;The sad conclusion I arrived at when writing my GraphQL server was that GraphQL is not the panacea I thought it was. Before actually implementing my own GraphQL server I had just done a lot of reading about it. All the features it advertised sounded incredible, especially its ability to format responses in a way that is immediately consumable by a front-end. I wanted the ability to create a server whose schema mirrored the way in which it will be used in the front-end, and this promise was one that made me positively giddy with excitement.&lt;/p&gt;
&lt;p&gt;For the most part that worked out fine. Learning the schema language of GraphQL was not difficult. It&apos;s fairly small, and after you learn &lt;a href=&quot;http://graphql.org/learn/schema/#object-types-and-fields&quot;&gt;object types&lt;/a&gt; and what a query and mutation is you&apos;ve learned enough to immediately begin using your GraphQL server. That was pretty exciting to me, as it fulfilled the promise I was hoping for.&lt;/p&gt;
&lt;p&gt;Things get a little more tricky when you delve into some more advanced GraphQL schema types like &lt;a href=&quot;http://graphql.org/learn/schema/#enumeration-types&quot;&gt;enums&lt;/a&gt; and &lt;a href=&quot;http://graphql.org/learn/schema/#union-types&quot;&gt;union types&lt;/a&gt;. I think something that made it trickier for me to understand how to take advantage of these features was by using the &lt;a href=&quot;https://github.com/apollographql/graphql-tag&quot;&gt;graphql-tag&lt;/a&gt; package that let me directly write schema without having to manually write the underlying code that was being auto-generated by that package. Had I started more low level I think I would have been a little less lost.&lt;/p&gt;
&lt;p&gt;The biggest gotchya that I experienced when writing my GraphQL server was being unaware of the cascade of DB hits that can occur if you don&apos;t use use a caching layer such as &lt;a href=&quot;https://github.com/facebook/dataloader&quot;&gt;DataLoader&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let me try and explain what I mean by that.&lt;/p&gt;
&lt;p&gt;For the TV Chat app I have a &lt;a href=&quot;https://github.com/hswolff/tvchat/blob/master/server/src/models/chat-message.js&quot;&gt;mongo collection called &lt;code&gt;chatMessages&lt;/code&gt;&lt;/a&gt;. This collection contains all the messages that are created in a chat room. The schema for the items in this collection is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;user&quot;: ObjectId(),
  &quot;show&quot;: ObjectId(),
  &quot;message&quot;: string,
  &quot;timestamp&quot;: Date
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So when a user loads a chatroom, I fetch down the last 50 items in the &lt;code&gt;chatMessages&lt;/code&gt; collection, doing additional lookups to get the full &lt;code&gt;user&lt;/code&gt; object so I can display a user&apos;s username.&lt;/p&gt;
&lt;p&gt;However in a chatroom an individual user may have written more than one chat message (surprising, no?), which means that &lt;a href=&quot;https://github.com/hswolff/tvchat/blob/master/server/src/graphql/schema.js#L60-L70&quot;&gt;my naive implementation of this GraphQL server looked up each user every time they occur in the collection.&lt;/a&gt; That&apos;s not exactly web scale.&lt;/p&gt;
&lt;p&gt;For all I could tell the main suggested way to fix this was to use &lt;a href=&quot;https://github.com/facebook/dataloader&quot;&gt;DataLoader&lt;/a&gt; as an intermediary between schema resolvers and requests to the database.&lt;/p&gt;
&lt;p&gt;I didn&apos;t take the time to delve into DataLoader but this gotchya was one that soured me a little to GraphQL.&lt;/p&gt;
&lt;p&gt;Don&apos;t get me wrong, I still think GraphQL has a lot of advantages over REST. However this example did illustrate a way in which GraphQL can be a little tricker to implement than a REST server.&lt;/p&gt;
&lt;p&gt;All that is to say that it gave me a renewed apprehension to GraphQL and enforced the notion of noble old Ben that &apos;with great power comes great responsibility&apos;.&lt;/p&gt;
&lt;p&gt;However if you were to ask me, would I use GraphQL again? I would without a doubt.&lt;/p&gt;
&lt;h1&gt;Subscriptions&lt;/h1&gt;
&lt;p&gt;Since this was a chatroom application I needed to support real time updates in the UI. The best way to support real time is via WebSockets. Luckily for me experimental support for &lt;a href=&quot;https://dev-blog.apollodata.com/graphql-subscriptions-in-apollo-client-9a2457f015fb&quot;&gt;subscriptions in GraphQL had just been released&lt;/a&gt;, adding a way to synchronize data with a GraphQL server via WebSockets. Hurray!&lt;/p&gt;
&lt;p&gt;However that&apos;s about where the fun stopped for me. No fault to the Apollo team, but I had a heck of a time getting my GraphQL Subscriptions working in a way that I liked. It took a lot of time reading the source code and looking at examples before I was able to piece together a solution that worked the way I wanted. However &lt;a href=&quot;https://github.com/hswolff/tvchat/blob/master/client/src/chat-room/chat-room.js#L55-L113&quot;&gt;I find the resulting code to be very brittle and not intuitive at all&lt;/a&gt;, two things that I had not come to expect with GraphQL.&lt;/p&gt;
&lt;p&gt;I think I would have been better served if I had just went with a vanilla WebSocket solution. Adding the higher abstractions of GraphQL was fun but difficult. It&apos;s code that every time I look at, it takes me a while to get my head back into understanding what is going on.&lt;/p&gt;
&lt;h1&gt;React&lt;/h1&gt;
&lt;p&gt;Using React with &lt;a href=&quot;https://github.com/apollographql/react-apollo&quot;&gt;React Apollo&lt;/a&gt; was a lot of fun.&lt;/p&gt;
&lt;p&gt;I found it very easy to attach my components to GraphQL requests. However I did have to learn to let go a little bit. I&apos;m used to having explicit control over what HTTP requests are being made, but with React Apollo I had to let go. I had to trust the framework to make the requests that I wanted, when I wanted, and let go of my typical desire to control every facet of the stack. That was a little bit unnerving but I found React Apollo to behave as intuitively as I could expect.&lt;/p&gt;
&lt;p&gt;I also found it great that the &lt;a href=&quot;https://github.com/apollographql/apollo-client&quot;&gt;Apollo Client&lt;/a&gt; uses Redux underneath the hood. I love Redux and having that familiarity there gave me a sense of security and stability that was very welcomed. Using the Redux dev tools to inspect what was going on was fun to peek at, but ultimately something that I didn&apos;t find myself doing that often as most of the time Apollo just worked.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I had a lot of fun building my first full stack GraphQL implementation.&lt;/p&gt;
&lt;p&gt;The server was definitely tricker to implement than the client. I don&apos;t think I&apos;ve found a server implementation that I&apos;m fully happy with yet. I need a few iterations to fully explore the full feature-set of GraphQL but having this as a first introduction was a great experience.&lt;/p&gt;
&lt;p&gt;On the client GraphQL lived up to most of my expectations. It works great with React and React Apollo makes it a joy to integrate throughout my application. Even more exciting for me was seeing that it would be pretty easy to incrementally adopt GraphQL on the client.&lt;/p&gt;
&lt;p&gt;GraphQL is a really cool piece of technology. I think we&apos;re at the height of hype right now and there are some deeper learnings that need to be experienced and shared before I&apos;d expect to see it get wide adoption. But after playing around with it for a couple of months consider me a fan.&lt;/p&gt;
</content:encoded></item><item><title>Vlog: Deep Dish Pizza and MongoDB World 2017</title><link>https://hswolff.com/blog/vlog-deep-dish-pizza-and-mongodb-world-2017/</link><guid isPermaLink="true">https://hswolff.com/blog/vlog-deep-dish-pizza-and-mongodb-world-2017/</guid><pubDate>Sun, 23 Jul 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Last month I had the pleasure to attend MongoDB World 2017. It was my first time attending a conference as an organizer rather than an attendee. It was a lot of fun seeing behind the scenes. Getting a feel for all the work that is required to run a successful conference was a great experience. I always knew it was hard work to run a conference, but to actually see it and live it was an amazing opportunity.&lt;/p&gt;
&lt;p&gt;Continuing my recent trend of making vlogs, I filmed one of my time in Chicago and attending MongoDB World 2017. Please enjoy.&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/b1WqCqf_QkY&quot; frameborder=&quot;0&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Creating My First Atom Package: tree-view-extended</title><link>https://hswolff.com/blog/atom-package-tree-view-extended/</link><guid isPermaLink="true">https://hswolff.com/blog/atom-package-tree-view-extended/</guid><pubDate>Tue, 18 Apr 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A little while ago I decided to play with Facebook&apos;s &lt;a href=&quot;https://nuclide.io/&quot;&gt;Nuclide&lt;/a&gt; project. I was curious what enhancements it added to Atom and if any of them would increase my workflow. I found the project altogether nice, bringing in some nice additions to Atom. However it also adds a lot of other functionality that I will never use. So I ended up disabling Nuclide, with the added features not outweighing the other cruft it added.&lt;/p&gt;
&lt;p&gt;However there was one feature that Nuclide provides that I found a little hard to live without. They added two pieces of functionality to Atom&apos;s &lt;a href=&quot;https://github.com/atom/tree-view&quot;&gt;tree-view&lt;/a&gt; (the list of files on the left of your editor). The first was it would show another tree-view of all your open tabs in a horizontal list. This I found immensely useful when I had many files open, and my tabs started overflowing my editor. Browsing the list of files in a list was vastly easier.&lt;/p&gt;
&lt;p&gt;The second feature was another tree-view that lists all your files that are under version control that are modified. This makes for a great overview of all the files that you&apos;re editing, helping you skip around your git working tree to see all the changes that are going into your next commit.&lt;/p&gt;
&lt;p&gt;Since I missed these features so much I took the plunge and created my first Atom package, &lt;a href=&quot;https://atom.io/packages/tree-view-extended&quot;&gt;tree-view-extended&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Introducing &lt;a href=&quot;https://atom.io/packages/tree-view-extended&quot;&gt;tree-view-extended&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://atom.io/packages/tree-view-extended&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This package adds both of the features that Nuclide provides without the extra weight of Nuclide. You can add a list of all your open files and a list of all your git modified files.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Since this was my first time making an Atom package I had to start at the very beginning (a very good place to start). I started off reading the &lt;a href=&quot;http://flight-manual.atom.io/&quot;&gt;Atom Flight Manual&lt;/a&gt; to get an overview of how Atom works and how packages interact with Atom.&lt;/p&gt;
&lt;p&gt;I found the information presented in the manual to be clearly written and easy to follow. Where I ran into real problems was after finishing the manual. I wasn&apos;t really clear on what to do next. I was able to do everything the manual laid out but after that I had to start diving into the &lt;a href=&quot;https://atom.io/docs/api/AtomEnvironment&quot;&gt;Atom API documentation&lt;/a&gt; and start poking around. I had to hunt and peck to see if what I wanted to accomplish was exposed by the API.&lt;/p&gt;
&lt;p&gt;This was hard because API documentation is dry and only presents the discrete information that you&apos;re looking up. It doesn&apos;t provide any examples or how things interact with one another.&lt;/p&gt;
&lt;p&gt;To solve that issue I looked at projects that were already doing things similar to what I wanted to accomplish. This was the real trick I used to figure out how to create my Atom package. I looked at the &lt;a href=&quot;https://github.com/postcasio/tree-view-open-files&quot;&gt;tree-view-open-files&lt;/a&gt; package and the &lt;a href=&quot;https://github.com/rjaviervega/tree-view-git-modified&quot;&gt;tree-view-git-modified&lt;/a&gt; package to see what they were doing.&lt;/p&gt;
&lt;p&gt;I learn best by example and having these two projects to base my package on were invaluable. It would have taken 10 times as long without having these projects to reference, and I doubt I would have persevered.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Another thing I found difficult about developing an Atom package was the development experience. It&apos;s not nearly as pleasant as creating a web app.&lt;/p&gt;
&lt;p&gt;Setting up my environment to develop the package was not intuitive.&lt;/p&gt;
&lt;p&gt;As far as I could tell I had to symlink my development folder into Atom&apos;s package folder via &lt;code&gt;apm link&lt;/code&gt;. This makes it so that my package is loaded into Atom, however the source folder is pointed to my own project.&lt;/p&gt;
&lt;p&gt;The second pain point was that I had to refresh Atom every time I wanted to see my changes. I&apos;m used to that from web development, however it takes a solid ~5 seconds for my Atom editor to reload (I may have too many packages installed). That lag of 5s to see any change was exhausting. It made the entire experience altogether unpleasant.&lt;/p&gt;
&lt;p&gt;In fact it&apos;s that fact alone that largely dissuades me from continuing development on the Atom package. The development experience is highly unpleasant.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I&apos;m happy to have created an Atom package that I and others are getting value from. It was a fun little side project to hack on in a weekend.&lt;/p&gt;
&lt;p&gt;In point of fact I&apos;d love for this to be merged upstream into tree-view as I think this is a worthwhile feature that would benefit the community at large. Until that happens we have this package.&lt;/p&gt;
&lt;p&gt;For me, that&apos;s the magic of Atom. If it doesn&apos;t do what you want you can change it. So I did.&lt;/p&gt;
</content:encoded></item><item><title>The Bridge to Teaching Redux</title><link>https://hswolff.com/blog/the-bridge-to-teaching-redux/</link><guid isPermaLink="true">https://hswolff.com/blog/the-bridge-to-teaching-redux/</guid><pubDate>Thu, 30 Mar 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve long struggled with teaching Redux. It&apos;s such a fundamental different way of thinking. When I search for comparisons to ease the concepts I always find myself sputtering words that never quite bridge that gap.&lt;/p&gt;
&lt;p&gt;I&apos;ve realized the reason I struggle with teaching Redux is because there is no easy bridge that can be used to get to the island that is Redux Comprehension. A learner is typically going from Object Oriented (OO) Land to Redux’s Functional Programming (FP) Land. On FP-Land things are done differently. Not better or worse, just differently. There’s a slight mental shift in how people go about their lives on FP-Land which can be a little weird and off-putting when first encountered. If you attempt to make sense of FP-Land from OO-Land you might end up making judgements and decisions that are not correct or fair until you’ve tried to live like a native resident of FP-Land.&lt;/p&gt;
&lt;p&gt;Getting over this initial hurdle of understanding that things are done differently in FP-Land - which is where you’ll find Redux - is the first great hurdle to becoming a native.&lt;/p&gt;
&lt;p&gt;The next great hurdle is actually making the journey from OO-Land to FP-Land.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When learning and discovering the vastness of OO-Land you’ll occasionally have to take bridges to different parts. Learning about Singletons or Factories or other OO programming styles require bridges of comprehension that you must walk over before you can use those styles of OO correctly. These bridges remain in OO-Land so there’s no great fear of anything going wrong. If the bridge starts to creak a little too loudly you can turn around and walk back to the area of OO-Land that you already know and find comfortable.&lt;/p&gt;
&lt;p&gt;Unfortunately the journey to FP-Land is harder. It’s harder because there is no bridge to get there. Instead you have to swim across a channel of water that separates OO-Land from FP-Land. Swimming is harder than walking.&lt;/p&gt;
&lt;p&gt;During this swim you’re performing double duty: not only do you have to keep your head above water and remain afloat but you also have to learn all the different ways that people do things on FP-Land, where Redux resides. While you’re swimming you’re also learning about reducers. While you’re holding your breath you’re learning about action creators. While you’re kicking your feet you’re learning about immutability.&lt;/p&gt;
&lt;p&gt;During the swim it’s common to reminisce of happier, dryer times. Times on OO-Land where things made sense and you weren’t constantly out of breath. It’s common to try and use what you already know from OO-Land to make the swim easier. It’s fine to take short breaks and reflect on the differences between these two lands, however refrain from judging FP-Land from an OO-Land perspective. It will only make the swim harder.&lt;/p&gt;
&lt;p&gt;Once you’ve finally made the journey across, congrats! Take a breath on FP-Land and reflect on your journey. All the new skills and ideas you picked up along the way. The benefits immutable data structures can provide. The expressiveness of composing functions. The joy of reducers!&lt;/p&gt;
&lt;p&gt;Take some time to explore FP-Land and indulge your curiosities. You’ve made the difficult initial trek and now there’s a wealth of information that is much easier to access. You’ll encounter a couple of bridges of comprehension on FP-Land but that’ll be no sweat compared to the swim you just took.&lt;/p&gt;
&lt;p&gt;Just don’t get too comfortable on FP-Land. You’ll want and need to visit OO-Land again. Unfortunately you’ll have to make that swim again. However each time you make that swim it’ll get easier. Then one day you won’t even notice the water. You’ll be a native on every land.&lt;/p&gt;
</content:encoded></item><item><title>React Native NYC Meetup</title><link>https://hswolff.com/blog/react-native-nyc-meetup/</link><guid isPermaLink="true">https://hswolff.com/blog/react-native-nyc-meetup/</guid><pubDate>Wed, 25 Jan 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I gave my presentation on React Native ART and D3 at the &lt;a href=&quot;https://www.meetup.com/React-Native-NYC/events/235604127/&quot;&gt;React Native NYC Meetup&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe width=&quot;640&quot; height=&quot;360&quot; src=&quot;https://www.youtube.com/embed/_OWsWNICfy4?rel=0&amp;amp;t=39m7s&quot; frameborder=&quot;0&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>ForwardJS Course</title><link>https://hswolff.com/blog/forwardjs-course/</link><guid isPermaLink="true">https://hswolff.com/blog/forwardjs-course/</guid><pubDate>Thu, 19 Jan 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I gave &lt;a href=&quot;https://forwardcourses.com/workshops/116&quot;&gt;a workshop for ForwardJS 2017.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&quot;https://forwardcourses.com/workshops/116&quot;&amp;gt;
&amp;lt;img width=&quot;640&quot; src=&quot;/images/forwardjs-conference.jpg&quot; /&amp;gt;
&amp;lt;/a&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Top 10 Albums of 2016</title><link>https://hswolff.com/blog/top-10-albums-of-2016/</link><guid isPermaLink="true">https://hswolff.com/blog/top-10-albums-of-2016/</guid><pubDate>Sat, 31 Dec 2016 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;2016 was a damn good year for music. Great albums were released by established and new artists alike. My favorite moments this year were when I tried a new album from an established artist and found myself appreciating their new sound and style.&lt;/p&gt;
&lt;p&gt;Two marquee moments this year were when The Avalanches and Frank Ocean released their sophomore albums. They were years in the making, and while they didn&apos;t fully live up to the cachet of their debut albums, they were welcome additions to the musical landscape.&lt;/p&gt;
&lt;p&gt;I enjoy writing these posts every year as they force me to reflect. I&apos;m a big music listener. Sometimes I can get caught up on always focusing on what&apos;s coming, rather than what&apos;s already arrived. I almost forgot how many big albums were released this year. It made creating this list particularly difficult. I had to revise and shuffle around my choices until I finally arrived at an order I was happy with.&lt;/p&gt;
&lt;p&gt;Naturally there were a couple of albums that were really good, but not good enough to make my top 10 list. Those are, naturally, my list of &lt;strong&gt;honorable mentions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;J. Cole &quot;4 Your Eyez Only&quot;&lt;/li&gt;
&lt;li&gt;Hamilton Leithauser and Rostam Batmanglij &quot;I Had a Dream That You Were Mine&quot;&lt;/li&gt;
&lt;li&gt;Flume &quot;Skin&quot;&lt;/li&gt;
&lt;li&gt;Mac Miller &quot;The Divine Feminine&quot;&lt;/li&gt;
&lt;li&gt;Phantogram &quot;Three&quot;&lt;/li&gt;
&lt;li&gt;Kanye West &quot;The Life of Pablo&quot;&lt;/li&gt;
&lt;li&gt;Radiohead &quot;A Moon Shaped Pool&quot;&lt;/li&gt;
&lt;li&gt;Solange &quot;A Seat at the Table&quot;&lt;/li&gt;
&lt;li&gt;Yuck &quot;Stranger Things&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h1&gt;Top 10 Albums of 2016&lt;/h1&gt;
&lt;h2&gt;10. The Weeknd &quot;Starboy&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Following up on the break-out success of his previous album, The Weeknd tries to replicate that past success to mixed results. While there are more than a handful of poppy and danceable tracks the album slightly smells of trying a little hard. That&apos;s an impressive note because despite that tinge of rancor the tracks that make up the album are very strong. I was definitely playing this album on loop for a while as the songs were just so good.&lt;/p&gt;
&lt;h2&gt;9. Drake &quot;Views&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Drake&apos;s first true album since 2013. Surprising, since he always manages to stay on the airwaves, with either a guest spot or a single getting pushed out. Yet there&apos;s something uniquely exciting about a Drake album. They always have a vibe and flow that stays consistent from track to track. This album continues that tradition, making every listen enjoyable and fluid.&lt;/p&gt;
&lt;h2&gt;8. Whitney &quot;Light Upon the Lake&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This album evokes emotions of relaxing, freewheeling, and hanging out with all your favorite buds. It brings me back to younger days when the days were long and the nights were longer. I can&apos;t get enough. If I&apos;m having a bad day I can hit play and let &quot;Light Upon the Lake&quot; remind me of all the times that were good.&lt;/p&gt;
&lt;h2&gt;7. Kendrick Lamar &quot;Untitled Unmastered&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This album effortlessly puts to rest any doubts anyone may have had of Kendrick Lamar&apos;s talent. A compilation of unreleased demos from his previous album, this album is stronger than the focused efforts of other artists. I must have played track 3 more times than I can remember. The groove and lyrics on that track resonate so strong.&lt;/p&gt;
&lt;h2&gt;6. Childish Gambino &quot;Awaken, My Love!&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I was not a Childish Gambino fan until this album. That makes sense as this album is unlike all of his previous releases. More avant-garde R&amp;amp;B than mainstream rap, this album sways with such confidence and eccentricities that I immediately fell in love. It almost seems as if this album was plucked from the 1970s, a lost relic from that time. This album is unique and a welcome addition to the musical landscape of 2016.&lt;/p&gt;
&lt;h2&gt;5. The Avalanches &quot;Wildflower&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I was so excited for this album&apos;s release, along with everyone else. A 16 year gap between album releases is unheard of but that&apos;s The Avalanches for you. Their debut album was such a smash hit that I think literally anything released after was going to be a bit of a let down. Yes, &quot;Wildflower&quot; is not as good as their debut. It does not flow as effortlessly as &quot;Since I Left You&quot;, however the individual tracks are just as strong. I think that&apos;s the major detractor to &quot;Wildflower&quot;, as an album it&apos;s not as good as &quot;Since I Left You&quot;, yet its tracks are just as eccentric and catchy. &quot;The Noisy Eater&quot; and &quot;Subways&quot; are my top two listened tracks.&lt;/p&gt;
&lt;h2&gt;4. Chance the Rapper &quot;Coloring Book&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One of the most popular artists that has yet to release a true album. If this is what a mixtape sounds like then I literally can&apos;t wait to hear Chance&apos;s first studio album. This album is brimming with hits and standouts, spanning a variety of genres, from upbeat hip-hop to soothing R&amp;amp;B. The tracks are catchy yet deep, mixing genres with ease. Hearing a saxophone and a church choir soar over Chance&apos;s rap sends chills down my spine.&lt;/p&gt;
&lt;h2&gt;3. Bon Iver &quot;22, A Million&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As the going gets tough the tough get going; as Bon Iver gets weird, the weird get weirder. Part human, part machine, this album manages to remain completely accessible despite its android-esque accompaniment. Bon Iver grinds his otherwise angelic voice through a computer meat shredder and it manages to remain beautiful. An album that would not work if attempted by any other artist. I&apos;m just so curious to hear what comes next.&lt;/p&gt;
&lt;h2&gt;2. Frank Ocean &quot;Blonde&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Like The Avalanches, Frank Ocean is another artist whose sophomore release was eagerly anticipated. Thankfully the gap between his debut and &quot;Blonde&quot; was only four years. On first listen of &quot;Blonde&quot; I came away disappointed as I was hoping for more of &quot;channel ORANGE&quot;. Yet that was misguided. Artists should grow and evolve, and that is &quot;Blonde&quot;. Always beautiful, and often sad, &quot;Blonde&quot; is an album that Frank Ocean needed to break his creative paralysis. The result is a collection of songs that are less immediately accessible, yet ones that blossom on repeat listens. After giving each track their due time you&apos;ll find the beauty hidden within. Most surprising was the deep melancholy and sorrow that tinges most tracks. There&apos;s heartache hidden within &quot;Blonde&quot;, shown and explored with courage and talent.&lt;/p&gt;
&lt;h2&gt;1. Jack Garratt &quot;Phase&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This album was my most played during 2016. Part Disclosure, part Sam Smith, Jack Garratt set himself apart from all other artists in 2016. Each track ebbs and flows, erupting from whisper to growl in the space of a breath. I was fortunate enough to see Jack Garratt live and it remains one of my top live shows. It&apos;s easy to see the love and care he puts into every song. The talent required is also impressive as he is a one man band. Performing live he switches from keyboard, to drum machine, to guitar all within the span of a song. Each song on this album is strong and contagious. Even now while giving &quot;Phase&quot; a re-listen, I find myself dancing and singing along. Give &quot;Phase&quot; a listen. You will not regret it.&lt;/p&gt;
</content:encoded></item><item><title>React Native ART Presentation</title><link>https://hswolff.com/blog/react-native-art-presentation/</link><guid isPermaLink="true">https://hswolff.com/blog/react-native-art-presentation/</guid><pubDate>Mon, 19 Dec 2016 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Earlier this year I had the great opportunity to be a speaker at the &lt;a href=&quot;https://conf.crater.io/&quot;&gt;Crater Remote Conference&lt;/a&gt;. I presented about my experiences with using &lt;a href=&quot;/blog/react-native-art-and-d3/&quot;&gt;React Native ART and D3&lt;/a&gt;, giving a complete walkthrough and explanation of my example application &lt;a href=&quot;https://github.com/hswolff/BetterWeather&quot;&gt;BetterWeather&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.youtube.com/watch?v=gEHyyd9RU3s&quot;&gt;recording of this talk was recently posted online&lt;/a&gt; and I wanted to share it with you all.&lt;/p&gt;
&lt;p&gt;There&apos;s a slight technical snafu that happens in the first 5 minutes but after that it&apos;s smooth sailing.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe width=&quot;640&quot; height=&quot;360&quot; src=&quot;https://www.youtube.com/embed/gEHyyd9RU3s?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Introducing Reptar 2.0.0</title><link>https://hswolff.com/blog/introducing-reptar/</link><guid isPermaLink="true">https://hswolff.com/blog/introducing-reptar/</guid><pubDate>Fri, 21 Oct 2016 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Introducing Reptar 2.0.0!&lt;/p&gt;
&lt;p&gt;It is with great pride that I announce the release Reptar 2.0.0, a static site generator that roars. Install it now!&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install -g reptar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://reptar.github.io/&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now hold on a second, you might be asking yourself, What happened to Reptar 1.0.0? Well Reptar is actually the &lt;a href=&quot;/blog/introducing-yarn/&quot;&gt;static site generator formerly known as Yarn&lt;/a&gt;. Yarn was renamed to Reptar because &lt;a href=&quot;https://yarnpkg.com/&quot;&gt;another NPM module was recently released&lt;/a&gt; that chose Yarn as its name. It has become wildly popular in a short amount of time, in large thanks to the people and organizations that helped create it. Rather than fight for market or mind share I chose to rename Yarn to the new and ever more rawsome Reptar.&lt;/p&gt;
&lt;p&gt;Reptar 2.0.0 comes with a very exciting list of new features and bug fixes.&lt;/p&gt;
&lt;p&gt;One of the most exciting new features is the super charged watch mode. Watch mode creates a local web server of your site that is able to reflect any changes you make instantly and without having to rebuild every static file. This is accomplished by lazily rendering only the page that is requested, allowing Reptar to quickly sync with the file system and render the latest changes immediately. This makes for a great workflow when writing a new post or updating your theme - those changes are immediately visible. You can start watch mode via &lt;code&gt;reptar watch&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Some other exciting new features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reptar now has &lt;code&gt;_config.yml&lt;/code&gt; validation. If Reptar notices that you have misconfigured your site it will immediately tell you where and why it is misconfigured.&lt;/li&gt;
&lt;li&gt;Data files are now supported! &lt;a href=&quot;https://github.com/reptar/reptar/issues/32&quot;&gt;This was a requested feature&lt;/a&gt; and I am happy that Reptar now supports data files of &lt;code&gt;.yaml&lt;/code&gt; or &lt;code&gt;json&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/reptar/reptar/blob/master/CHANGELOG.md#200-2016-10-19&quot;&gt;See the full list of changes in the CHANGELOG.&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Upgrading&lt;/h1&gt;
&lt;p&gt;If you were using Yarn 1.x then there are two steps required to upgrading to Reptar.&lt;/p&gt;
&lt;p&gt;The first is to install Reptar &lt;code&gt;npm install -g reptar&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The second is updating your &lt;code&gt;_config.yml&lt;/code&gt; file as there were breaking changes.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;_config.yml&lt;/code&gt; validation will tell you what is wrong but it is easier to see the changes by looking at a diff of the changes. Explanations are inline as comments.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;path:
  source:      ./
  destination: ./_site
  plugins:     ./_plugins
  themes:      ./_themes
# Reptar now has support for data files!
+  data:        ./_data

file:
   # Support for File defaults has been added!
   # These are optional settings however it&apos;s mostly moving
   # configuration that was on the `collections` field before.
+  defaults:
+    -
+      scope:
+         # Any file in this path will have the default values applied.
+         path: ./
+      values:
+        template: page
+        permalink: /:title/
+    -
+      scope:
+         # Any file in this path will have the default values applied.
+         # Because this path is more specific it will over-write the previous
+         # defaults.
+         path: ./_posts
+      values:
+        template: post
+        permalink: /:title/
+    -
+      scope:
+         # Any file with this matching metadata will have the default values applied.
+         metadata:
+           draft: true
+      values:
+        template: draft
   # Filter settings were moved to under `file`.
+  filters:
+    metadata:
+      draft: true
+    future_date:
+      key: date

collections:
   # These settings are now better handled as a File default.
-  default:
-    path: ./
-    template: page
   # Static collections no longer exist.
-  images:
-    static: true
  post:
    path: ./_posts
     # Moved from being under `pagination`.
+    template: index
     # Moved from being under `pagination`.
+    page_size: 6
     # Permalink is removed.
-    permalink: /:title/
     # Filter is moved to `file`.
-    filter:
-      metadata:
-        draft: true
-      future_date:
-        key: date
     # Renamed.
-    pagination:
+    permalink:
       # Moved up one level.
-      template: index
-      size: 6
       # Renamed
-      permalink_index: /
+      index: /
       # Renamed
-      permalink_page:  /page/:page/
+      page:  /page/:page/

# Moved the follow top level properties to new top level `markdown`.
-markdown_extension:
-  - md
-markdown:    remarkable
-highlighter: highlight.js
-remarkable:
-  preset:       &apos;commonmark&apos;
-  highlight:    true

+markdown:
+  extensions:
+    - md
+  options:
+    preset:       &apos;commonmark&apos;
+    highlight:    true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Thank You&lt;/h1&gt;
&lt;p&gt;I want to thank everyone for their support of Reptar. It&apos;s been so much fun building Reptar and using it daily for my own site.&lt;/p&gt;
&lt;p&gt;One of the big new upcoming features I have planned for Reptar is to create an &lt;a href=&quot;https://github.com/reptar/reptar/issues/12&quot;&gt;admin dashboard&lt;/a&gt; so you can edit your Reptar site as easily as if it was a WordPress site - except it&apos;s still a static site! If that sounds exciting and fun then &lt;a href=&quot;https://github.com/reptar/reptar/blob/master/CONTRIBUTING.md&quot;&gt;please join and help code&lt;/a&gt;!&lt;/p&gt;
</content:encoded></item><item><title>React Native ART and D3</title><link>https://hswolff.com/blog/react-native-art-and-d3/</link><guid isPermaLink="true">https://hswolff.com/blog/react-native-art-and-d3/</guid><pubDate>Fri, 05 Aug 2016 03:59:27 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;This is a follow up to my previous article about &lt;a href=&quot;/blog/react-native/&quot;&gt;my experiences using React Native&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I gave a talk on this topic which &lt;a href=&quot;/blog/react-native-art-presentation/&quot;&gt;you can watch&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The most powerful feature of React Native is that it lets you write your native application using React and JavaScript. React is certainly powerful as it greatly simplifies the mental model required when constructing your UI. However what&apos;s even more powerful is the ability to use JavaScript. There&apos;s a huge ecosystem of JavaScript packages available. There&apos;s a package for almost anything that you might need for your web application. And thanks to React Native almost all of them can be used in your mobile application.&lt;/p&gt;
&lt;p&gt;One of the most powerful JavaScript package available for graphing is &lt;a href=&quot;https://d3js.org/&quot;&gt;d3.js&lt;/a&gt;. It is battle tested and robust, and the de facto library to use to create a graph on your website. To get a feeling for how expressive you can be with d3 just &lt;a href=&quot;https://github.com/d3/d3/wiki/Gallery&quot;&gt;check out its example gallery&lt;/a&gt;. I&apos;m always in awe at some of the things you can create with the simple primitives that d3 provides.&lt;/p&gt;
&lt;p&gt;For a project I worked on I had to create graphs in a React Native application. To achieve this goal I used D3 within React Native. In this article I&apos;m going to introduce you to how to create D3 graphs in a React Native application.&lt;/p&gt;
&lt;p&gt;This article is also based on a talk I gave for &lt;a href=&quot;http://conf.crater.io/&quot;&gt;Crater Remote Conference&lt;/a&gt;. The &lt;a href=&quot;https://speakerdeck.com/hswolff/react-native-and-d3js&quot;&gt;slides are accessible here&lt;/a&gt; and I will link to the video as soon as it&apos;s available.&lt;/p&gt;
&lt;p&gt;This article assumes you are already familiar with React Native. If you&apos;re not please &lt;a href=&quot;http://facebook.github.io/react-native/docs/tutorial.html&quot;&gt;read the tutorial on React Native&apos;s webpage&lt;/a&gt; to get up to speed.&lt;/p&gt;
&lt;p&gt;There&apos;s a few pre-requisites I need to explain before I can get to how to integrate D3 into React Native. Bear with me as I provide some helpful background information before we delve into the meat of things.&lt;/p&gt;
&lt;h1&gt;D3&lt;/h1&gt;
&lt;p&gt;Hopefully if you&apos;re reading this you have a vague understanding of what D3 is, and what it can do. In brief D3 provides primitive functions that let you easily convert data into graphs. It &lt;a href=&quot;https://github.com/d3/d3/blob/master/API.md&quot;&gt;provides a suite of modules&lt;/a&gt; that you can use to construct the graphs you want to build.&lt;/p&gt;
&lt;p&gt;For our purposes we&apos;re going to focus on two modules, &lt;a href=&quot;https://github.com/d3/d3-scale&quot;&gt;d3-scale&lt;/a&gt; and &lt;a href=&quot;https://github.com/d3/d3-shape&quot;&gt;d3-shape&lt;/a&gt;. These are the only two modules we need to learn to create a graph in our React Native application.&lt;/p&gt;
&lt;h2&gt;d3-scale&lt;/h2&gt;
&lt;p&gt;Scales are the building blocks for every graph you&apos;ll ever create. They are the glue that let you take data of any shape and size and convert it into a graph.&lt;/p&gt;
&lt;p&gt;d3-scales provides a few different scale types, but for now we&apos;re going to focus just on continuous scales.&lt;/p&gt;
&lt;p&gt;As &lt;a href=&quot;https://github.com/d3/d3-scale#continuous-scales&quot;&gt;explained in the documentation&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Continuous scales map a continuous, quantitative input domain to a continuous output range.
Given a value from the domain, returns the corresponding value from the range.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So let&apos;s say we wanted to map an array of test scores to a graph. The test scores are between 0-100 and we want to graph the height of each test score on our screen, which has a height of 640 pixels.&lt;/p&gt;
&lt;p&gt;To graph that with d3-scale we create a continuous linear scale:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Create a new linear scale instance, which we&apos;ll use as your y-scale.
const y = d3
  .scaleLinear()
  // Set our domain, which is our input data, which is our test scores,
  // which can be between 0 and 100.
  .domain([0, 100])
  // Set our range, which is our output data, which is the height of our
  // screen, which is 640 pixels.
  .range([0, 640]);

// Now if we want to know how high a test score of 50 is on our screen
// we pass the value from our domain and get our range of 320.
y(50); // 320
// Same thing here with 80.
y(80); // 512
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&apos;s a variant of linear scales that we&apos;re also going to use called &lt;a href=&quot;https://github.com/d3/d3-scale#time-scales&quot;&gt;time scales&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Time scales are a variant of linear scales that have a temporal domain: domain values are coerced to dates rather than numbers&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Meaning, that instead of just using numbers for our domain we&apos;re going to use dates. This is useful when trying to show how data changes over time.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Create our x-scale.
const x = d3
  .scaleTime()
  // Our domain is now a week of time.
  .domain([new Date(2000, 0, 1), new Date(2000, 0, 8)])
  // That we&apos;re going to show on our screen which is also 640 pixels wide.
  .range([0, 640]);

// We can then get the x position for the second day of the week.
x(new Date(2000, 0, 2)); // 91.42857142857142
// And the seventh day!
x(new Date(2000, 0, 7)); // 548.5714285714286
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;d3-shape&lt;/h2&gt;
&lt;p&gt;The d3-shape module &quot;provides a variety of shape generators for your convenience&quot; which you use to actually draw your data to a graph. For now d3-shape can render to either SVG or Canvas. For our use case we&apos;re going to focus on the SVG rendering capabilities.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/d3/d3-shape&quot;&gt;d3-shape&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The only shape we&apos;re going to use is the line generator which is &quot;used to compute the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d&quot;&gt;d attribute&lt;/a&gt; of an &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths&quot;&gt;SVG path&lt;/a&gt; element&quot;&lt;/p&gt;
&lt;p&gt;So let&apos;s say we wanted to graph the weather forecast for a week. After we create our x and y-scales we can then use the line generator to create the d attribute for the SVG Path element:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Our array of data we&apos;re graphing.
const data = [
  {date: new Date(2000, 1, 1), value: 83.24},
  {date: new Date(2000, 1, 2), value: 85.35},
  {date: new Date(2000, 1, 3), value: 98.84},
  {date: new Date(2000, 1, 4), value: 79.92},
  {date: new Date(2000, 1, 5), value: 83.80},
  {date: new Date(2000, 1, 6), value: 88.47},
  {date: new Date(2000, 1, 7), value: 94.47},
  …
];

// Create our line generator.
const line = d3.line()
  // For every x value create the x accessor,
  // which uses our x scale function.
  .x(function(d) { return x(d.date); })
  // Make our y accessor.
  .y(function(d) { return y(d.value); });

// Given the data create the d path value!
line(data);
// M10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The x and y accessor&apos;s that we use are &lt;a href=&quot;https://github.com/d3/d3-shape#line_x&quot;&gt;discussed more in-depth on the documentation&lt;/a&gt;, however the point of them is that D3 uses those functions to compute where to plot every data point on the graph.&lt;/p&gt;
&lt;h1&gt;How does D3 work with React Native?&lt;/h1&gt;
&lt;p&gt;React Native has a library called &lt;a href=&quot;https://github.com/facebook/react-native/tree/master/Libraries/ART&quot;&gt;React Native ART&lt;/a&gt; which can render SVG shapes and paths. By using D3 to create the &lt;code&gt;d&lt;/code&gt; attribute and giving that to React Native ART we can render any graph that is produced by D3.&lt;/p&gt;
&lt;p&gt;React Native ART is derived from &lt;a href=&quot;https://github.com/reactjs/react-art&quot;&gt;React ART&lt;/a&gt;. React ART provides a React components that can be used to control the &lt;a href=&quot;https://github.com/sebmarkbage/art&quot;&gt;ART&lt;/a&gt; library.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ART is a retained mode vector drawing API&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So that means that instead of having to write an SVG image by hand like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;svg&amp;gt;
  &amp;lt;g&amp;gt;
    &amp;lt;rect width=&quot;100&quot; height=&quot;100&quot; x=&quot;10&quot; y=&quot;10&quot; fill=&quot;blue&quot; /&amp;gt;
  &amp;lt;/g&amp;gt;
&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can use ART&apos;s API.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const art = ART.Surface(1000, 600);

const group = ART.Group().inject(art);

const blue = ART.Rectangle(100, 100);
  .move(10, 10)
  .fill(&apos;blue&apos;)
  .inject(group);
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;React ART is a JavaScript library for drawing vector graphics using React.
It provides declarative and reactive bindings to the ART library.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With React ART you can write your ART commands as React components.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function ReactART() {
  return (
    &amp;lt;Surface width={1000} height={600}&amp;gt;
      &amp;lt;Group&amp;gt;
        &amp;lt;Rectangle width={100} height={100} x={10} y={10} fill=&quot;blue&quot; /&amp;gt;
      &amp;lt;/Group&amp;gt;
    &amp;lt;/Surface&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then with React Native ART you can do the same but in your React Native application.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import React from &apos;react&apos;;
import {
  ART,
  View,
} from &apos;react-native&apos;;
const {
  Surface,
  Group,
  Shape,
} = ART;

function ReactNativeART() {
  return (
    &amp;lt;View&amp;gt;
      &amp;lt;Surface width={500} height={500}&amp;gt;
        &amp;lt;Group x={100} y={0}&amp;gt;
          &amp;lt;Shape
            d=&quot;M10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80&quot;
            stroke=&quot;#000&quot;
            strokeWidth={1}
        &amp;lt;/Group&amp;gt;
      &amp;lt;/Surface&amp;gt;
    &amp;lt;/View&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;React Native ART is not included by default in React Native. Most applications don&apos;t need to render SVG shapes, so the React Native team felt it was better to exclude it by default, saving file size of your application.&lt;/p&gt;
&lt;p&gt;Before you can use React Native ART you need to link the native library. React Native&apos;s website has a &lt;a href=&quot;http://facebook.github.io/react-native/docs/linking-libraries-ios.html&quot;&gt;guide on how to link libraries&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also follow this &lt;a href=&quot;http://browniefed.com/blog/getting-react-art-running-on-react-native/&quot;&gt;excellent guide on getting started with React Native ART&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;Example Application&lt;/h1&gt;
&lt;p&gt;To help show off what we can make with React Native and D3 I created an example application called &lt;a href=&quot;https://github.com/hswolff/BetterWeather&quot;&gt;BetterWeather&lt;/a&gt;. It&apos;s hosted on my GitHub account. Each commit is composed so you can read them from start to finish and see what was done to get to the next iteration of the application. I strongly encourage you to read through the source code as its well documented and meant for reading.&lt;/p&gt;
&lt;p&gt;BetterWeather is a simple weather forecast application. It graphs the upcoming week of weather. It also animates between the temperature min and max for the next week. It uses the &lt;a href=&quot;https://developer.forecast.io/&quot;&gt;Forecast.io&lt;/a&gt; API as its data source.&lt;/p&gt;
&lt;h1&gt;Code&lt;/h1&gt;
&lt;p&gt;There&apos;s two sides to creating a D3 graph in a React Native application.&lt;/p&gt;
&lt;p&gt;The first is using React Native ART.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://facebook.github.io/react-native/docs/linking-libraries-ios.html&quot;&gt;After you&apos;ve linked the native code for React Native ART&lt;/a&gt; you can start to use it in your code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Snippet based on https://github.com/hswolff/BetterWeather/blob/master/js/weather/WeatherGraph.js
import React, { Component } from &apos;react&apos;;
import { ART } from &apos;react-native&apos;;

const { Group, Shape, Surface } = ART;

class WeatherGraph extends Component {
  render() {
    return (
      &amp;lt;Surface width={200} height={100}&amp;gt;
        &amp;lt;Group x={0} y={0}&amp;gt;
          &amp;lt;Shape d={this.props.linePath} stroke=&quot;#000&quot; strokeWidth={1} /&amp;gt;
        &amp;lt;/Group&amp;gt;
      &amp;lt;/Surface&amp;gt;
    );
  }
}

// Used via:
// &amp;lt;WeatherGraph lineGraph={...} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This uses the React Native ART components to render to the screen. It should look just like any other React components and that&apos;s because it is. This creates an ART &lt;code&gt;&amp;lt;Surface /&amp;gt;&lt;/code&gt;, which we can think of as the &lt;code&gt;&amp;lt;svg /&amp;gt;&lt;/code&gt; tag, which houses the &lt;code&gt;&amp;lt;Group /&amp;gt;&lt;/code&gt; which is akin to an SVG&apos;s &lt;code&gt;&amp;lt;g /&amp;gt;&lt;/code&gt; element, which finally houses the &lt;code&gt;&amp;lt;Shape /&amp;gt;&lt;/code&gt; component which is akin to an SVG&apos;s &lt;code&gt;&amp;lt;path /&amp;gt;&lt;/code&gt; element. The &lt;code&gt;&amp;lt;Shape /&amp;gt;&lt;/code&gt;&apos;s &lt;code&gt;d={}&lt;/code&gt; attribute is just like the &lt;code&gt;&amp;lt;path /&amp;gt;&lt;/code&gt; &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d&quot;&gt;d attribute&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is where the second side comes in - D3.&lt;/p&gt;
&lt;p&gt;We&apos;re going to use D3 to create the value that will go inside the &lt;code&gt;d={}&lt;/code&gt; attribute.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Snippet based on https://github.com/hswolff/BetterWeather/blob/master/js/weather/graph-utils.js
import * as scale from &apos;d3-scale&apos;;
import * as shape from &apos;d3-shape&apos;;
import * as d3Array from &apos;d3-array&apos;;
const d3 = {
  scale,
  shape,
};

export function createLineGraph({
  // This is the data that we get from the API.
  data,
  width,
  height,
}) {
  // Get last item in the array.
  const lastDatum = data[data.length - 1];

  // Create our x-scale.
  const scaleX = createScaleX(data[0].time, lastDatum.time, width);

  // Collect all y values.
  const allYValues = data.reduce((all, datum) =&amp;gt; {
    all.push(datum.temperatureMax);
    return all;
  }, []);

  // Get the min and max y value.
  const extentY = d3Array.extent(allYValues);

  // Create our y-scale.
  const scaleY = createScaleY(extentY[0], extentY[1], height);

  // Use the d3-shape line generator to create the `d={}` attribute value.
  const lineShape = d3.shape
    .line()
    // For every x and y-point in our line shape we are given an item from our
    // array which we pass through our scale function so we map the domain value
    // to the range value.
    .x(d =&amp;gt; scaleX(d.time))
    .y(d =&amp;gt; scaleY(d.temperatureMax));

  return {
    // Pass in our array of data to our line generator to produce the `d={}`
    // attribute value that will go into our `&amp;lt;Shape /&amp;gt;` component.
    path: lineShape(data),
  };
}

// Used via:
// const dAttribute = createLineGraph({
//   data, // From API.
//   width: 200,
//   height: 100,
// });
// &amp;lt;WeatherGraph lineGraph={dAttribute} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So what you see here is us using D3 to create our x and y scales so we can map our data from its domain (the original values) to the range which we want to output it (our app screen).&lt;/p&gt;
&lt;p&gt;We then use the line generator to create the &lt;code&gt;d={}&lt;/code&gt; attribute that we need for our &lt;code&gt;&amp;lt;Shape /&amp;gt;&lt;/code&gt; component.&lt;/p&gt;
&lt;p&gt;From there the React Native ART component has enough information to render the shape in our app!&lt;/p&gt;
&lt;p&gt;What you saw above was an abridged version of the &lt;a href=&quot;https://github.com/hswolff/BetterWeather/commit/a05e3ae87929f94e5564732cf2c352b0bee576a7&quot;&gt;work that was done in this commit in the BetterWeather repo&lt;/a&gt;. To see a more rich example I strongly encourage you to check out that commit and leave any comments you may have so I can address any confusions directly.&lt;/p&gt;
&lt;h1&gt;Axis&lt;/h1&gt;
&lt;p&gt;The next step you should take to make a richer graph is to add axis. This does not require any special React Native ART knowledge as you can create graphs using regular React Native &lt;code&gt;&amp;lt;View /&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;Text /&amp;gt;&lt;/code&gt; components. The main trick is to leverage D3 so you have enough information to lay out your components correctly.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Extend what is returned from createLineGraph
export function createLineGraph() {
  // ... previous content omitted.
  return {
    ticks: data.map((datum) =&amp;gt; {
      const time = datum.time;
      const value = datum.temperatureMax;

      return {
        x: scaleX(time),
        y: scaleY(value),
        datum,
      };
    }),
  };
}

// Extend our WeatherGraph component.
// Within its render() function:
class WeatherGraph extends Component {
  render() {
    return (
      // ...previous content omitted.
      &amp;lt;View key={&apos;ticksX&apos;}&amp;gt;
        {this.props.ticks.map((tick, index) =&amp;gt; {
          const tickStyles = {};
          tickStyles.left = tick.x;

          return (
            &amp;lt;Text key={index} style={[styles.tickLabelX, tickStyles]}&amp;gt;
              {new Date(tick.datum.time * 1000)}
            &amp;lt;/Text&amp;gt;
          );
        })}
      &amp;lt;/View&amp;gt;

      &amp;lt;View key={&apos;ticksY&apos;}&amp;gt;
        {this.props.ticks.map((tick, index) =&amp;gt; {
          const value = tick.datum.temperatureMax;

          const tickStyles = {};
          tickStyles.left = tick.x;
          tickStyles.top = tick.y;

          return (
            &amp;lt;View key={index} style={[styles.tickLabelY, tickStyles]}&amp;gt;
              &amp;lt;Text style={styles.tickLabelYText}&amp;gt;
                {value}&amp;amp;deg;
              &amp;lt;/Text&amp;gt;
            &amp;lt;/View&amp;gt;
          );
        })}
      &amp;lt;/View&amp;gt;
    )
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After getting the x and y values for every position of the line we just use &lt;code&gt;position: absolute&lt;/code&gt; to layout the &lt;code&gt;&amp;lt;View /&amp;gt;&lt;/code&gt; components for our axis!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hswolff/BetterWeather/commit/07a5e42a15923eb17472102b993938aa5fe573e3&quot;&gt;For the full implementation example please consult the commit on the BetterWeather repo.&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Animate&lt;/h1&gt;
&lt;p&gt;The only thing cooler than creating graphs in our React Native application is animating them.&lt;/p&gt;
&lt;p&gt;The main trick to animating graphs is to use the ART library&apos;s &lt;code&gt;Morph&lt;/code&gt; module. The &lt;code&gt;Morph&lt;/code&gt; module allows you to &lt;a href=&quot;https://en.wikipedia.org/wiki/Inbetweening&quot;&gt;tween&lt;/a&gt; from one &lt;code&gt;d={}&lt;/code&gt; attribute value to another. It handles all the tricky calculations required to create the shapes that exist in-between one path and another.&lt;/p&gt;
&lt;p&gt;We then use a standard &lt;code&gt;requestAnimationFrame&lt;/code&gt; loop along with &lt;code&gt;this.setState&lt;/code&gt; to render our animations.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import Morph from &apos;art/morph/path&apos;;

// Extending WeatherGraph some more...
class WeatherGraph extends Component {
  componentWillReceiveProps(nextProps) {
    if (this.props.data !== nextProps.data) {
      const nextLinePath = createLineGraph({
        data: nextProps.data,
        width: 200,
        height: 100,
      });

      this.setState(
        {
          // Create the ART Morph.Tween instance.
          linePath: Morph.Tween(this.previousGraph, nextLinePath),
        },
        () =&amp;gt; {
          // Kick off our animations!
          this.animate();
        }
      );
    }
  }

  animate(start) {
    this.animating = requestAnimationFrame(timestamp =&amp;gt; {
      if (!start) {
        start = timestamp;
      }

      // Get the delta on how far long in our animation we are.
      const delta = (timestamp - start) / AnimationDurationMs;

      // If we&apos;re above 1 then our animation should be complete.
      if (delta &amp;gt; 1) {
        this.animating = null;
        // Just to be safe set our final value to the new graph path.
        this.setState({
          linePath: this.previousGraph.path,
        });

        // Stop our animation loop.
        return;
      }

      // Tween the SVG path value according to what delta we&apos;re currently at.
      this.state.linePath.tween(delta);

      // Update our state with the new tween value and then jump back into
      // this loop.
      this.setState(this.state, () =&amp;gt; {
        this.animate(start);
      });
    });
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here we calculate the nextLinePath when we see that our data changes. We then use the &lt;code&gt;Morph&lt;/code&gt; module to create the beginning of our tween, and then begin our requestAnimationFrame loop to animate each point in our tween animation.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hswolff/BetterWeather/commit/6a51bce269c58f14f59e6f00dd362ce281a2b19f&quot;&gt;I strongly encourage you to check out the full commit on the BetterWeather repo to see the full implementation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also I strongly encourage you to &lt;a href=&quot;http://browniefed.com/blog/react-native-morphing-svg-paths-with-react-art/&quot;&gt;read this excellent blog post on using the Morph module&lt;/a&gt;. It&apos;s where I took my original inspiration from.&lt;/p&gt;
&lt;h1&gt;Wrapping Up&lt;/h1&gt;
&lt;p&gt;Hopefully by this point you should know a lot more than you did before you read this blog post.&lt;/p&gt;
&lt;p&gt;Using D3 with React Native opens up a world of opportunities for what you can do with your React Native applications. D3 is so powerful and flexible that the possibilities of what you can create are far to great for me to even imagine.&lt;/p&gt;
&lt;p&gt;I&apos;m very curious to see what people come up with and how they manage to use these two technologies. Please leave a reply with any cool examples you may find, and please let me know if anything I explained above was not clear.&lt;/p&gt;
&lt;p&gt;Thanks so much for reading!&lt;/p&gt;
</content:encoded></item><item><title>React Native</title><link>https://hswolff.com/blog/react-native/</link><guid isPermaLink="true">https://hswolff.com/blog/react-native/</guid><pubDate>Wed, 29 Jun 2016 01:14:36 GMT</pubDate><content:encoded>&lt;p&gt;A couple of months ago I wrote a &lt;a href=&quot;http://facebook.github.io/react-native/&quot;&gt;React Native&lt;/a&gt; application, the new &lt;a href=&quot;http://blog.chartbeat.com/2016/04/07/say-hello-to-the-all-new-chartbeat-ios-app/&quot;&gt;Chartbeat iOS App&lt;/a&gt;. It was a great experience. I got to learn a lot about React Native and was able to create and launch an app. If there&apos;s anything I like more than writing software, it&apos;s releasing it.&lt;/p&gt;
&lt;p&gt;I was able to give a talk recently at &lt;a href=&quot;https://2016.syntaxcon.com/&quot;&gt;SyntaxCon&lt;/a&gt; about getting started with React Native. I named the talk &lt;a href=&quot;https://2016.syntaxcon.com/session/going-mobile-with-react-native/&quot;&gt;Going Native with React Native&lt;/a&gt; and you can &lt;a href=&quot;https://speakerdeck.com/hswolff/going-native-with-react-native&quot;&gt;check out the slides&lt;/a&gt; at your leisure. As soon as the video is up I&apos;ll link to it.&lt;/p&gt;
&lt;p&gt;I&apos;ve wanted to write about my experience with React Native for a long time but haven&apos;t had the opportunity to do so until now. A lot of the content for my talk was derived from my experiences working on React Native while developing the Chartbeat iOS app. That&apos;ll be true for this post as well. I&apos;m considering this post the written form of that talk.&lt;/p&gt;
&lt;h1&gt;Picking React Native&lt;/h1&gt;
&lt;p&gt;I started working with React Native way back in September 2015. At this point in time React Native was at version &lt;code&gt;0.11.0-rc&lt;/code&gt; and Android support was not yet released. Before we even decided to use React Native as the foundation for the new mobile app I looked around at the various options available on the market.&lt;/p&gt;
&lt;p&gt;There is &lt;a href=&quot;https://cordova.apache.org/&quot;&gt;Cordova&lt;/a&gt; (Phonegap) which I&apos;ve used before. At a previous job I helped create a Phonegap application and did not have the greatest experience. For all of its benefits there are a fair amount of short comings. Looking into Phonegap after more than two years away showed that not much had changed. You still needed to re-implement every native control using web technologies and web is still slower than native.&lt;/p&gt;
&lt;p&gt;There are a couple of compile to native platforms still available. &lt;a href=&quot;https://www.xamarin.com/&quot;&gt;Xamarin&lt;/a&gt; wasn&apos;t considered as I&apos;m not a fluent C# engineer and I didn&apos;t want to learn Xamarin and C# at the same time. I&apos;ve used &lt;a href=&quot;http://www.appcelerator.com/&quot;&gt;Appcelerator&lt;/a&gt; at a previous job as well and had very negative experiences.&lt;/p&gt;
&lt;p&gt;Ultimately the decision came down to writing the application 100% natively or use React Native. We wanted to write an Android app as well and the promise of React Native to support both platforms with the same codebase pushed us to pick it. The fact that React Native was built on top of React gave me an immediate edge as I already knew how to use React, giving me a jump start.&lt;/p&gt;
&lt;p&gt;It also didn&apos;t hurt that picking React Native meant I got to play with an exciting new piece of technology. That&apos;s not a sound technical reason but it makes for a powerful motivational reason. That meant working late nights and weekends were a pleasure as I was able to work on something that I was genuinely excited about.&lt;/p&gt;
&lt;h1&gt;Built on React&lt;/h1&gt;
&lt;p&gt;It&apos;s hard to understate how powerful it is that React Native is built on top of React. This gives you an immediate advantage when writing a React Native application as you already have a solid understanding of how things work.&lt;/p&gt;
&lt;p&gt;We all know and love React&apos;s declarative nature, and React Native continues that tradition. Feel free to declaratively write your components as you would with React. The main difference is the base components you use.&lt;/p&gt;
&lt;p&gt;Instead of &lt;code&gt;&amp;lt;div /&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;span /&amp;gt;&lt;/code&gt; you use &lt;code&gt;&amp;lt;View /&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;Text /&amp;gt;&lt;/code&gt;. React Native provides a suite of base UI components that you can use, and for almost all cases you can find ways to make those components do whatever it is your application needs.&lt;/p&gt;
&lt;p&gt;This simple sidestep, of just providing additional base UI components is what allows projects such as &lt;a href=&quot;https://github.com/necolas/react-native-web&quot;&gt;react-native-web&lt;/a&gt; to exist as they&apos;re just a re-implementation of these components, targeted towards the web.&lt;/p&gt;
&lt;h1&gt;JavaScript Ecosystem&lt;/h1&gt;
&lt;p&gt;Since React Native application-level code is written in JavaScript and ran by a JavaScript engine at runtime this means one glorious thing: you can use pretty much the entire npm ecosystem in your React Native application.&lt;/p&gt;
&lt;p&gt;The only restriction is the npm package can&apos;t touch the DOM, because well, there is no DOM in a React Native application.&lt;/p&gt;
&lt;p&gt;That means that you&apos;re able to use all your old favorites such as lodash or Redux. It also gives you the feeling of being completely empowered as you have thousands upon thousands of npm packages ready for inclusion in your React Native application.&lt;/p&gt;
&lt;h1&gt;CSS in JavaScript&lt;/h1&gt;
&lt;p&gt;Before I started using React Native I knew that its approach to layout and styles was not conventional, at least not in the web sense. React Native &lt;a href=&quot;http://facebook.github.io/react-native/docs/style.html&quot;&gt;leverages JavaScript to style your app&lt;/a&gt;, meaning that all layout and style is written in a &lt;code&gt;.js&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;This sounded heretical when I first came across it. It flew in the face of so many conventions and practices that I had instilled into every fiber of my developer body.&lt;/p&gt;
&lt;p&gt;Yet after I started writing styles in JavaScript I realized one unexpected truth:&lt;/p&gt;
&lt;p&gt;I loved it.&lt;/p&gt;
&lt;p&gt;As I&apos;ve said to countless people I have drank the Kool-Aid hard and I am now a firm believer in the power of writing your styles in JavaScript.&lt;/p&gt;
&lt;p&gt;It provides so many niceties.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have the full expressive power of JavaScript at your disposal when writing your styles.&lt;/li&gt;
&lt;li&gt;You can treat shared styles as a regular old JavaScript object, sharing them between modules as you would anything else.&lt;/li&gt;
&lt;li&gt;When you open a component to see what it does you also get all of its styles in the same file. That means that you know everything you want about a component by just looking at one file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&apos;m looking for the smoking-gun solution for styles in JavaScript for the web, and as soon as I find it I&apos;m immediately switching to it. I absolutely loved writing my CSS this way.&lt;/p&gt;
&lt;h1&gt;Developer Experience&lt;/h1&gt;
&lt;p&gt;The development workflow used when writing a React Native application has more in common with the web than it does with a native iOS or Android application.&lt;/p&gt;
&lt;p&gt;React Native supports live reloading and hot reloading out of the box. You make a change to a file and see the changes almost instantly applied to the screen. This immediate feedback loop allows you to experiment without fear. It also makes the pixel-perfecting process a breeze as you can easily live-tweak with a designer.&lt;/p&gt;
&lt;p&gt;You can also hook up React Native to a Chrome Developer Console, giving you access to poke around the application as it&apos;s running, just as you would a web app. You can set breakpoints, log out to the console, and even start poking around the code via the REPL provided by Chrome Dev tools.&lt;/p&gt;
&lt;p&gt;I&apos;ve written native applications in the past and the developer experience that React Native provides is unparalleled. You get all the tools a web developer gets, yet it gets rendered into a native application.&lt;/p&gt;
&lt;h1&gt;Easy Escape Hatches&lt;/h1&gt;
&lt;p&gt;While React Native provides a lot out of the box it&apos;s easy to drop down to native land. React Native was built to be extended and you can easily add your own custom &lt;a href=&quot;http://facebook.github.io/react-native/docs/native-components-ios.html&quot;&gt;UI components&lt;/a&gt; or &lt;a href=&quot;http://facebook.github.io/react-native/docs/native-modules-ios.html&quot;&gt;native modules&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This gives you the freedom to write as much custom code as you need without having to worry about React Native prescribing what you can or cannot do.&lt;/p&gt;
&lt;h1&gt;React Native Moves Fast&lt;/h1&gt;
&lt;p&gt;When I started using React Native in September 2015 it was at version &lt;code&gt;0.11.0-rc&lt;/code&gt;. At the time this post was written, June 2016, React Native is now at &lt;code&gt;0.29.0-rc&lt;/code&gt;. There&apos;s been 18 releases in under a year, and there doesn&apos;t seem to be any signs of that release pace slowing down.&lt;/p&gt;
&lt;p&gt;Coming from native iOS and Android that pace of development is unthinkable. In those native platforms you&apos;re used to one major release a year. React Native is going the opposite path, choosing to release frequently and with smaller changes.&lt;/p&gt;
&lt;p&gt;Yet some of those version bumps contained some pretty big changes. When Android support was added in fall of 2015 that was just a version bump but that&apos;s one hefty changeset.&lt;/p&gt;
&lt;p&gt;And from version &lt;code&gt;0.11.0&lt;/code&gt; till around &lt;code&gt;0.19.0&lt;/code&gt; almost every release held some pretty big changes. I haven&apos;t used recent versions but from reading the &lt;a href=&quot;https://github.com/facebook/react-native/releases&quot;&gt;release notes&lt;/a&gt; it seems like the amount of breaking changes is subsiding, making for a less volatile upgrade process.&lt;/p&gt;
&lt;h1&gt;Native Knowledge Not Required&lt;/h1&gt;
&lt;p&gt;People always ask me, &apos;Do I need to know the native platform to use React Native?&apos;&lt;/p&gt;
&lt;p&gt;The short answer is no.&lt;/p&gt;
&lt;p&gt;You can go a very long way just skating between the lines that React Native provides for you. The base UI components and built-in native modules provide an incredible amount of flexibility when it comes to writing your React Native application that for almost all apps you will never have to worry about writing custom Swift or Java code.&lt;/p&gt;
&lt;p&gt;That being said, you should know the UI and UX patterns that are used by your native platform. What that means is you should understand how and why the dedicated Android back button exists. Or you should understand what is a ShareSheet on iOS.&lt;/p&gt;
&lt;p&gt;If you want your app to feel truly native you need to understand how the native platform performs certain tasks so your app feels truly native to the platform.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I&apos;m dying to write my next React Native application. I had some of the most fun I&apos;ve had in a long time writing the Chartbeat iOS app. The React Native framework provides an awesome developer experience in an environment that is historically a cumbersome to develop for.&lt;/p&gt;
&lt;p&gt;Not only am I itching to write my next React Native application I&apos;m also looking to see if I can obtain the holy grail of write once and have the code work on iOS, Android, and the web (using react-native-web). If that can be accomplished then I&apos;ll be as pleased as a peach.&lt;/p&gt;
</content:encoded></item><item><title>Introducing Yarn</title><link>https://hswolff.com/blog/introducing-yarn/</link><guid isPermaLink="true">https://hswolff.com/blog/introducing-yarn/</guid><pubDate>Sun, 10 Apr 2016 21:34:46 GMT</pubDate><content:encoded>&lt;h4&gt;&lt;em&gt;Note! Yarn has been renamed to &lt;a href=&quot;/blog/introducing-reptar/&quot;&gt;Reptar&lt;/a&gt;&lt;/em&gt;&lt;/h4&gt;
&lt;p&gt;Hello everyone! I want to introduce you to my newest creation, &lt;a href=&quot;http://yarnjs.github.io/&quot;&gt;Yarn&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Yarn is a static site generator that I wrote. It was built due to my frustrations with the current static site generators available. I figured, &quot;Hey, it can&apos;t be that hard to write my own static site generator!&quot; So I started working on Yarn. Seven months later and I&apos;m now proud to introduce the first stable version of Yarn, 1.0.0.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://yarnjs.github.io/&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If I had known it would take me over half a year to complete this project I probably wouldn&apos;t have even bothered, but that&apos;s the benefit of forgoing thorough forethought.&lt;/p&gt;
&lt;p&gt;This &lt;a href=&quot;https://github.com/hswolff/blog&quot;&gt;blog is now proudly created with Yarn&lt;/a&gt; as well!&lt;/p&gt;
&lt;p&gt;Why did I even want to start using a static site generator? To answer that I have to take you back to 2010.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;And if you&apos;re just curious about hearing about Yarn then scroll down to the Yarn section&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;The Beginning&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://hswolff.com/blog/hello-world/&quot;&gt;Back in 2010&lt;/a&gt; I started blogging. I thought it would be a good way to build my brand as well as give myself a creative outlet. I was coding most of the time during my day job, but I very much enjoy writing, and wanted to have somewhere to put my words. So my blog began.&lt;/p&gt;
&lt;p&gt;In 2010 the de facto way to blog was with &lt;a href=&quot;http://wordpress.com/&quot;&gt;WordPress&lt;/a&gt;. So that&apos;s what I started out on. I set up my own self-hosted WordPress installation and went on my merry way.&lt;/p&gt;
&lt;p&gt;For three years I was fine blogging with WordPress. It was easy to use, easy to maintain. I had no real complaints.&lt;/p&gt;
&lt;p&gt;Except at some point in 2014 I started getting bored of WordPress. Not only bored but a little annoyed at the sluggishness of the WordPress admin. Also I didn&apos;t enjoy having to delve into PHP to make any meaningful change to how my blog worked. Making a new theme required learning the WordPress template language, something that I did not want to bother with.&lt;/p&gt;
&lt;p&gt;So I decided I need a change.&lt;/p&gt;
&lt;h2&gt;A Ghoulish Diversion&lt;/h2&gt;
&lt;p&gt;As luck would have it &lt;a href=&quot;https://ghost.org/&quot;&gt;Ghost&lt;/a&gt; had just come onto the scene. It billed itself as a streamlined WordPress, focused only on blogging. And the best part? It was written in Node.js. Hallelujah!&lt;/p&gt;
&lt;p&gt;So I &lt;a href=&quot;http://hswolff.com/blog/why-i-switched-my-blog-to-ghost/&quot;&gt;ported my blog&lt;/a&gt; to Ghost. And for a year I used Ghost to run my blog.&lt;/p&gt;
&lt;p&gt;I also began contributing to the Ghost project. I was a core contributor to the project for around six months, lending my hand to improve Ghost in any way that I could.&lt;/p&gt;
&lt;p&gt;Ghost was harder to deploy than WordPress as it is a Node.js application. I didn&apos;t have much experience deploying Node.js applications so I had to learn. It wasn&apos;t terrible, but it was definitely an adoption cost that I hadn&apos;t expected.&lt;/p&gt;
&lt;p&gt;Everything was going well. Until one day when it wasn&apos;t.&lt;/p&gt;
&lt;p&gt;Upgrading Ghost was a mild chore. I wasn&apos;t using Ghost in the #blessed manner and as such had an extra cost whenever I had to upgrade. Sometimes my Ghost process had a memory leak that would cause my hosting provider to kill the process to prevent it from affecting the shared host it was on.&lt;/p&gt;
&lt;p&gt;Also at some point I stopped contributing to the Ghost project.&lt;/p&gt;
&lt;p&gt;All these things combined pushed me to migrate away from Ghost.&lt;/p&gt;
&lt;h2&gt;Static Electricity&lt;/h2&gt;
&lt;p&gt;After Ghost I finally told myself that enough was enough and that it was time to pare my blog down to its barest essentials.&lt;/p&gt;
&lt;p&gt;That&apos;s right. It was time to go &lt;a href=&quot;https://www.smashingmagazine.com/2015/11/modern-static-website-generators-next-big-thing/&quot;&gt;static site generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Being a JavaScript man I looked at what static site generators were written in JavaScript.&lt;/p&gt;
&lt;p&gt;I eventually ended up going with &lt;a href=&quot;http://www.metalsmith.io/&quot;&gt;metalsmith&lt;/a&gt;. I liked its minimalistic approach and its customizability.&lt;/p&gt;
&lt;p&gt;However when I sat down to actually port my Ghost (which was ported from WordPress) blog to metalsmith I found myself needing to turn to the myriad of metalsmith plug-ins. To get my metalsmith blog to feature parity with my Ghost blog I had to write &lt;a href=&quot;https://github.com/hswolff/blog/blob/metalsmith/gulpfile.js#L97-L226&quot;&gt;a mountain of configuration.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So I got it working, and it was good, but holy shit was that a lot of work.&lt;/p&gt;
&lt;p&gt;I thought to myself, &quot;Surely there&apos;s something better?&quot;&lt;/p&gt;
&lt;h2&gt;Do It Yourself&lt;/h2&gt;
&lt;p&gt;I found that mountain of configuration quite brittle. Sometimes my blog wouldn&apos;t compile for reasons that I never cared enough to track down. I knew that I needed to move (again!) to something new.&lt;/p&gt;
&lt;p&gt;The most popular static site generator written in JavaScript (remember: I&apos;m a JS dev!) is &lt;a href=&quot;http://hexo.io/&quot;&gt;hexo&lt;/a&gt;. And while it&apos;s certainly mature and powerful it didn&apos;t provide all the features that I wanted my blog to have. Primarily I wanted easy pagination support and support for tag pages.&lt;/p&gt;
&lt;p&gt;Even when I looked at &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; it didn&apos;t provide the features I wanted. If I wanted that functionality I either had to hack in support or turn to a plug-in.&lt;/p&gt;
&lt;p&gt;At this point I thought, &quot;Enough is enough.&quot; And so, Yarn was born.&lt;/p&gt;
&lt;h2&gt;Yarn&lt;/h2&gt;
&lt;p&gt;Yarn was created to have feature parity with Ghost, which had feature parity with (the blogging aspect) of WordPress. The only twist was that Yarn would be a static site generator. No need to run a server process or have to worry about maintaining a node.js application on your web host.&lt;/p&gt;
&lt;p&gt;All you needed was the ability to &lt;code&gt;rsync&lt;/code&gt; your compiled code, and you&apos;d be good to go!&lt;/p&gt;
&lt;p&gt;Yarn has built-in support for pagination of files, along with support for tag pages. It&apos;s capable of this behavior due to sensible primitive constructs.&lt;/p&gt;
&lt;p&gt;The basic building block of &lt;a href=&quot;http://yarnjs.github.io/docs/collections/&quot;&gt;Yarn is that of collections&lt;/a&gt;. Yarn inspects your local files and organizes them into collections based upon either their location in the file system or the meta data that is contained in the file.&lt;/p&gt;
&lt;p&gt;Through this simple abstraction Yarn is able to derive a great deal of information. It allows Yarn to be expressive and flexible as all it needs is to be told how to construct its collections.&lt;/p&gt;
&lt;p&gt;Also Yarn was built using the latest JavaScript specification, specifically ES2015+. While I could lie and say this was to move the JavaScript community forward I would be lying. I enjoy writing ES2015+ JavaScript. It&apos;s more pleasurable to write JavaScript that way and it allows for more expressive and easier to understand code.&lt;/p&gt;
&lt;p&gt;Yarn was also built to be easy to build upon. I&apos;m hoping contributors present themselves and provide a strong future for Yarn.&lt;/p&gt;
&lt;h2&gt;The Future&lt;/h2&gt;
&lt;p&gt;I&apos;m very proud to have shipped a version 1.0.0. I struggled about when to push Yarn to 1.0.0 as I still have many ideas on what Yarn should be able to do. It was hard deciding when to pull the trigger and declare Yarn feature complete and ready for an initial release.&lt;/p&gt;
&lt;p&gt;I want to add API to Yarn to allow for the creation of a dashboard to administer a Yarn site. I&apos;d like to see more collection types added to Yarn. There&apos;s so much more I want to do!&lt;/p&gt;
&lt;p&gt;But at some point you have to stop yourself and just be ok with what you have.&lt;/p&gt;
&lt;p&gt;I&apos;m very proud of how far Yarn has come since its beginning. I hope the community finds it worthwhile and fun to hack on. And I can&apos;t wait for my first dedicated contributor.&lt;/p&gt;
&lt;p&gt;I hope you enjoy Yarn. Here&apos;s to 1.0.0 and many more versions to come!&lt;/p&gt;
</content:encoded></item><item><title>Top 10 Albums of 2015</title><link>https://hswolff.com/blog/top-10-albums-of-2015/</link><guid isPermaLink="true">https://hswolff.com/blog/top-10-albums-of-2015/</guid><pubDate>Wed, 06 Jan 2016 14:07:21 GMT</pubDate><content:encoded>&lt;p&gt;For a long time the main way I listened to music was as an album. I would get an album and listen to it in its entirety, from start to finish. All my opinions and feelings about those tracks would be heavily shaped within the context of the album.&lt;/p&gt;
&lt;p&gt;Occasionally I&apos;d hear a song on the radio before hearing it on the album and it would warp my attachment to that song, and by extension the album. If the track was particularly strong it might cast a shadow over album. This would then cause a lower appreciation for the album as a whole, as there was an uneven distribution of quality.&lt;/p&gt;
&lt;p&gt;By and large the album was the unit of measure I used to evaluate music. This made it pretty easy to look back at a year of album releases and sort them by best to worst. It&apos;s what I&apos;ve done for a &lt;a href=&quot;http://blog.hswolff.com/tag/music/&quot;&gt;couple of years now&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Yet this year my listening habits changed. I started listening to more singles. This is largely thanks to &lt;a href=&quot;http://hypem.com/&quot;&gt;Hype Machine&lt;/a&gt;, Spotify, and Apple Music (in that order). As a result it was much harder figuring out what were my top albums of 2015.&lt;/p&gt;
&lt;p&gt;Nevertheless I&apos;ve prevailed. It took almost a month to figure out the order, but I have my list sorted and ready for your reading enjoyment.&lt;/p&gt;
&lt;p&gt;What I found interesting about 2015&apos;s list of top albums was that finding the top 5 albums was much easier than finding albums 6-10. I have a sneaking suspicion that albums 1-5 will live on for years to come, however albums 6-10 won&apos;t get many additional listens past 2015.&lt;/p&gt;
&lt;p&gt;Before we get to the list let&apos;s start things off with a list of honorable mentions. These are albums that were in the running for ranking, but did not make the cut. They are albums that I did enjoy but were not good enough to get into the top 10.&lt;/p&gt;
&lt;p&gt;In no particular order, my list of &lt;strong&gt;honorable mentions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Foals &quot;What Went Down&quot;&lt;/li&gt;
&lt;li&gt;Disclosure &quot;Caracal&quot;&lt;/li&gt;
&lt;li&gt;Thundercat &quot;The Beyond / Where the Giants Roam&quot;&lt;/li&gt;
&lt;li&gt;Seryn &quot;Shadow Shows&quot;&lt;/li&gt;
&lt;li&gt;Matt &amp;amp; Kim &quot;New Glow&quot;&lt;/li&gt;
&lt;li&gt;Lord Huron &quot;Strange Trails&quot;&lt;/li&gt;
&lt;li&gt;Beirut &quot;No No No&quot;&lt;/li&gt;
&lt;li&gt;CHVRCHES &quot;Every Open Eye&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h1&gt;Top 10 Albums of 2015&lt;/h1&gt;
&lt;h2&gt;10. Alabama Shakes &quot;Sound &amp;amp; Color&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I really need more blues in my life. The growl from Alabama Shakes lead singer carries this album. She is a powerhouse. My only wish for this album was for the quality of the tracks to be more even. Some are super catchy whereas others are forgettable.&lt;/p&gt;
&lt;h2&gt;9. Mac DeMarco &quot;Another One&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This was my first Mac DeMarco album I&apos;ve listened to and I found it hugely relaxing. If I found myself wound up I would stick this album on and let the sway of his songs mellow me out. You can almost smell the reefer wafting off of the tracks.&lt;/p&gt;
&lt;h2&gt;8. Father John Misty &quot;I Love You Honeybear&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What a character this guy is. &quot;I Love You Honeybear&quot; continues Father John Misty&apos;s crusade of sarcasm and glibness. Dare I say there&apos;s even more?&lt;/p&gt;
&lt;p&gt;He still holds true to his folk roots. The songs rollick along and the lyrics are always a laugh.&lt;/p&gt;
&lt;h2&gt;7. Panda Bear &quot;Panda Bear Meets The Grim Reaper&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&apos;ve always loved the Animal Collective crew. An experimental team that easily pulls from the pop world. Their songs slip in and out of comprehension, teasing the mind and filling it with lush musical landscapes.&lt;/p&gt;
&lt;p&gt;I haven&apos;t listened to a good Animal Collective-esque album in a long time so &quot;Panda Bear Meets The Grim Reaper&quot; was very welcome.&lt;/p&gt;
&lt;p&gt;If you&apos;ve ever listened to a Panda Bear or Animal Collective album before you know what to expect, as this is more of the same here. What I liked most about this album was that it shied away from the avant-garde that Panda Bear loves and embraced tracks that were more accessible. Completely appreciated and enjoyable.&lt;/p&gt;
&lt;h2&gt;6. The Weeknd &quot;Beauty Behind The Madness&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The Weeknd still has some growing to do. While good, this album is a little uneven. Some tracks are easy 10/10 whereas others are 6/10. I think it&apos;s because The Weeknd is an artist in transition. His last album consisted of slow jams, with nary a pop track. This album has a smattering of pop tracks, yet there still remain a healthy dose of slower songs.&lt;/p&gt;
&lt;p&gt;The pop tracks that do exist are excellent. They&apos;ve already been played across every radio station and in every mall, yet they manage to retain their replay-ability. A true testament to the success of those tracks.&lt;/p&gt;
&lt;p&gt;I&apos;m looking forward to the subsequent album. I hope to hear a stronger devotion to pop with an even warmer embrace of Michael Jackson. Not many artists can sing like that, but The Weeknd can.&lt;/p&gt;
&lt;h2&gt;5. Grimes &quot;Art Angels&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Grimes is a hard band to classify. They&apos;re definitely indie however they sometimes heavily lean experimental. That&apos;s their charm.&lt;/p&gt;
&lt;p&gt;&quot;Art Angels&quot; carries on this tradition. The second track is poppy yet it is followed by the third track which is half rambling, half screaming, yet entirely in Japanese. From Grimes, I&apos;m not surprised. And it works.&lt;/p&gt;
&lt;p&gt;The pop-inspired tracks definitely outweigh anything else. Rather the experimental urges Grimes has is funneled into these tracks, adding an addictive umami taste that left me coming back for many repeat listens.&lt;/p&gt;
&lt;h2&gt;4. Adele &quot;25&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This was the first Adele album I listened to. Sure, I&apos;ve heard all of Adele&apos;s singles over the years, however I never listened to her music in the context of an album. I used to not like this genre of music. I found it dull and boring. Now I find it relaxing and accessible. Maybe that means I&apos;ve expanded my tastes.&lt;/p&gt;
&lt;p&gt;Or maybe I&apos;m just older.&lt;/p&gt;
&lt;p&gt;Adele&apos;s &quot;25&quot; is a great adult contemporary album. There are beautiful ballads along with uplifting chants. The album has a great flow to the songs. It correctly mixes up the pace between the slow and the quick. I won&apos;t say fast, Adele always takes her time. Yet there are some songs on here that had me clapping along to the beat.&lt;/p&gt;
&lt;p&gt;And man, she can sing, can&apos;t she?&lt;/p&gt;
&lt;h2&gt;3. Kendrick Lamar &quot;To Pimp A Butterfly&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Everyone loved Kendrick Lamar&apos;s debut album &quot;good kid, m.A.A.d city&quot;. It had catchy beats with raps that were excruciatingly good. This left big shoes to fill for the sophomore effort. &quot;To Pimp A Butterfly&quot; handled that pressure easily.&lt;/p&gt;
&lt;p&gt;&quot;To Pimp A Butterfly&quot; is not what people expected. Whereas Kendrick Lamar&apos;s first album was lush with singles ready to play on the radio, &quot;To Pimp A Butterfly&quot; was unabashedly an album meant to be listened to in its entirety.&lt;/p&gt;
&lt;p&gt;The entire album was less mainstream. This made it harder for me to listen to at first as I was expected a rap-pop album. Yet getting past that initial confusion uncovers an album with complex messages and avant-garde beats that show a musical prowess that leaves me curious and hunger for more.&lt;/p&gt;
&lt;h2&gt;2. Jamie xx &quot;In Colour&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I always knew Jamie xx was a real talent. When every article written about The Xx&apos;s debut album mentioned he produced the album I knew there was something special about him. So when I heard news that he was releasing a solo album I was pretty excited. I expected it to be good.&lt;/p&gt;
&lt;p&gt;I didn&apos;t expect it to be this good.&lt;/p&gt;
&lt;p&gt;One of the best reviews of &quot;In Colour&quot; I&apos;ve read pointed out that this is a minimalistic dance album. Despite a somewhat calm that permeates the tracks on the album the music remains danceable. It&apos;s an uncommon quality of the album. The track is upbeat yet also laid back. It&apos;s a beautiful dance of contrasts that adds up to a sum that is far greater than the parts.&lt;/p&gt;
&lt;h2&gt;1. Carly Rae Jepsen &quot;Emotion&quot;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I never expected for this album to be good. After her break-out single last year &quot;Call Me Maybe&quot;, like everyone else I safely assumed she was going to be a one-hit wonder. A song to play in 10 years as a funny callback to hits long past.&lt;/p&gt;
&lt;p&gt;Holy hell was I wrong.&lt;/p&gt;
&lt;p&gt;This album, which got widespread critical acclaim, is perfect from start to back. It&apos;s a loving echo of the electronic moods from the 80s recast for present times in a package that begs for repeat listens.&lt;/p&gt;
&lt;p&gt;I listened to this album when I walked to work, I sat on the subway, or exercised while running. The album improved every scenario.&lt;/p&gt;
&lt;p&gt;I&apos;d often catch myself singing along to the songs out loud and not care. The songs are just pure, beautiful, wonderful pop. Catchy yet not obnoxious and filled with simple lyrics of love and loss that are easy to connect to.&lt;/p&gt;
&lt;p&gt;I&apos;ll be playing this album for years to come.&lt;/p&gt;
</content:encoded></item><item><title>Technical Debt, Organizational Debt</title><link>https://hswolff.com/blog/technical-debt-organizational-debt/</link><guid isPermaLink="true">https://hswolff.com/blog/technical-debt-organizational-debt/</guid><pubDate>Fri, 19 Jun 2015 01:02:06 GMT</pubDate><content:encoded>&lt;p&gt;Debt, in the context of a company, takes on many forms. From the quite literal of owing money to the more abstract concept of &lt;a href=&quot;https://en.wikipedia.org/wiki/Technical_debt&quot;&gt;technical debt&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Technical debt is, to use Wikipedia&apos;s tidy definition:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The [technical] debt can be thought of as work that needs to be done before a particular job can be considered complete or proper. If the debt is not repaid, then it will keep on accumulating interest, making it hard to implement changes later on.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The idea of technical debt was devised as a shield: a way for engineers to protect themselves from the never-ending demands of their company. As a company grows and expands it creates new things. These new things are built on top of existing things. Sometimes the existing things do not provide adequate support for what is going to be built on top of them. Here a choice is faced: do you fix what exists so it properly supports something new, or do you get some gum and glue and force things together? The latter method creates technical debt.&lt;/p&gt;
&lt;p&gt;Sure it&apos;ll work - for now. Yet if you build on top of that new thing a couple of times you&apos;ll eventually come to a point where things start to fall apart. No one wants that. So instead the idea of technical debt is thrown up like a flare, warning everyone that short-term gains can be accomplished at the cost of long-term stability.&lt;/p&gt;
&lt;p&gt;Yet to never take on technical debt is equally foolish. For starters it&apos;s impossible to plan for the future. Trying to devise a foundation upon which all future things can be built on is not possible - for all you know the analytics platform that you created to support your company becomes completely useless when your company pivots into a freemium game production studio. Further, if you&apos;re constantly doubling back to tidy up your existing things to make space for your new things you can end up doubling your workload. It may be that the thing you changed for one new thing needs to be undone for a new new thing.&lt;/p&gt;
&lt;p&gt;As a software engineer I&apos;m always weighing the cost of my engineering decisions. Will this new thing I&apos;m building create so much debt that it pushes us too close to bankruptcy? If so then I need to directly address the debt I already have before making anything new. Or perhaps this new thing that I&apos;m creating can be used to address some existing debt while it is created? Those type of things are my favorite. It allows me to create a new thing while fixing an existing thing, making everything better once it&apos;s done.&lt;/p&gt;
&lt;p&gt;Debt is good. It allows for speedy progress. What isn&apos;t good is accruing too much debt. As the saying goes, too much of anything is bad.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;There&apos;s another type of debt a company accrues that is obvious in hindsight. I only tuned into its existence thanks to an excellent blog post by Steve Blank, &lt;a href=&quot;http://steveblank.com/2015/05/19/organizational-debt-is-like-technical-debt-but-worse/&quot;&gt;&apos;Organizational Debt is like Technical debt – but worse&apos;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Steve Blank explains:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Organizational debt is all the people/culture compromises made to “just get it done” in the early stages of a startup.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;He uses as an example a recent conversation he had with a startup founder entering a new round of funding. While the founder was excited about the future Blank expressed his concern for the organizational debt that had accrued:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;While the company had a great plan for keeping the top executives, and had all the startup perks like free food and dogs at work, they had spent little time thinking about the organization debt accruing with first 100 employees who had built the company underneath them. These were the employees that had the institutional knowledge and hard-earned skills. Originally they had been attracted by the lure of being part of a new media company that was disrupting the old, and were working for low salaries with minimal stock. And while that had been enough to keep their heads-down and focused on their jobs, the new funding round and onslaught of new employees at much higher salaries had them looking around and updating their resumes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Organizational debt results in a company&apos;s quick death if it is never addressed. Technical debt will hurt like hell, but it won&apos;t kill a company overnight - organizational debt will.&lt;/p&gt;
&lt;p&gt;Companies are the sum of their employees. Organizational debt is created when you delay addressing people issues. People issues such as never attending to company culture or company processes. People want to do their work in a healthy and fulfilling way, and if the company gets in the way of those desires then it will result in a loss of people.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;In truth there&apos;s limitless types of debt. Anything you put off till tomorrow won&apos;t disappear. At some point you will have to circle back and address it or else face the consequences.&lt;/p&gt;
&lt;p&gt;The easiest way to address debt is to be aware of its existence. So long as you know that at some point in the future you&apos;ll have to double back to fix some of the shortcuts you took today, then you&apos;ll be ok.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thanks to &lt;a href=&quot;https://twitter.com/JemYoung&quot;&gt;Jem Young&lt;/a&gt; for reviewing this post.&lt;/em&gt;&lt;/p&gt;
</content:encoded></item><item><title>Airbnb&apos;s Management Style</title><link>https://hswolff.com/blog/airbnb-s-management-style/</link><guid isPermaLink="true">https://hswolff.com/blog/airbnb-s-management-style/</guid><pubDate>Thu, 28 May 2015 02:23:57 GMT</pubDate><content:encoded>&lt;p&gt;It&apos;s always interesting to hear how other companies are managed. It gives greater context for what I experience every day at work and broadens my idea for what people are doing to improve their company.&lt;/p&gt;
&lt;p&gt;I&apos;ve been reading &lt;a href=&quot;http://firstround.com/review/&quot;&gt;First Round&apos;s The Review magazine&lt;/a&gt; for a couple of weeks now. Some of the articles are pure recruiting fluff but a couple have some real interesting tidbits.&lt;/p&gt;
&lt;p&gt;I found the &lt;a href=&quot;http://firstround.com/review/bureaucracy-isnt-inevitable-heres-how-airbnb-beat-it/&quot;&gt;recent article about Airbnb&lt;/a&gt; quite interesting. Two interesting points were made.&lt;/p&gt;
&lt;p&gt;The first is about removing policies and replacing them with principles:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What It Means to Replace Policies with Principles&lt;/p&gt;
&lt;p&gt;OLD POLICY: All expenses require pre-approval.&lt;/p&gt;
&lt;p&gt;NEW PRINCIPLE: If you would think twice about spending this much from your own account, gut-check it with your manager.&lt;/p&gt;
&lt;p&gt;“I can&apos;t tell you how much pain in my life has come from expense reports,” Curtis says. Airbnb’s old policy was a cumbersome one: Charges big and small required approval before they could be submitted. So Curtis tried replacing it with a principle, simple good judgment, using $500 as a rule of thumb for when to get a gut-check. The result? No increase in discretionary spending (but a whole lot of time saved).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than create a rule for every type of behavior desired Airbnb created guiding principles that afforded individuals the freedom to use their own judgement and not becoming bogged down by endless rule minutiae.&lt;/p&gt;
&lt;p&gt;You try to hire people that you trust and think are smart, so giving them a general idea of what you expect them should be enough. In Airbnb&apos;s case it is.&lt;/p&gt;
&lt;p&gt;The other thing I loved was how Airbnb managed to enact change through a change in behavior as opposed to an edict:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Getting Changes to Stick&lt;/p&gt;
&lt;p&gt;I have a theory that the only way you can affect cultural change on an organization is through positive reinforcement and social pressure.&lt;/p&gt;
&lt;p&gt;A few years ago at Airbnb, pretty much none of the code being pushed to production was peer reviewed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create positive examples.&lt;/strong&gt; Enlist a group of well-respected engineers to lead by example. In Airbnb’s case, Curtis asked a handful of senior engineers to start requesting reviews. “It created a whole bunch of examples of great code reviews that we could draw from to set examples for the team.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In roughly two months, Curtis had made peer code reviews the overwhelming norm without establishing a single policy. “This is the power of positive reinforcement and social pressure to bring about cultural change in an organization. I didn&apos;t hand down any edicts, I didn&apos;t say ‘It has to be done this way from now on,’ I didn&apos;t put any formal policy in place,” he says. In fact, code reviews still aren’t enforced in any way; an engineer could still go straight to production anytime — but no one does it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Lead by example. Or in Airbnb&apos;s case, get a group of people to lead by example and everyone else follows.&lt;/p&gt;
&lt;p&gt;You can never underestimate the power of social pressure. Doesn&apos;t hurt that the underlying change was positive.&lt;/p&gt;
&lt;p&gt;Try changing a company from having free lunches to having employees pay for their lunch through social pressure. That sure as hell won&apos;t work.&lt;/p&gt;
</content:encoded></item><item><title>First Impressions of AngularJS 2.0</title><link>https://hswolff.com/blog/first-impressions-of-angularjs-2-0/</link><guid isPermaLink="true">https://hswolff.com/blog/first-impressions-of-angularjs-2-0/</guid><pubDate>Tue, 21 Apr 2015 13:28:54 GMT</pubDate><content:encoded>&lt;p&gt;Over the weekend I created a &lt;a href=&quot;http://hswolff.github.io/hn-ng2/&quot;&gt;clone of Hacker News with Angular2&lt;/a&gt;. I&apos;ve read a lot about the changes Angular 2 will have and I wanted to see for myself what it would be like to create an app. What would it be like? How will it be better than Angular 1? Will I enjoy writing an Angular 2 app?&lt;/p&gt;
&lt;p&gt;Before I delve into my impressions let me preface everything that follows with the obvious: Angular 2.0 is not done. At the time of this writing it&apos;s marked as an alpha release, so please keep that in mind when reading. Things are going to change and improve, but I just wanted to share with you my initial impressions on what it&apos;s like to create an app with Angular 2.&lt;/p&gt;
&lt;h1&gt;No Documentation, but Excellent Comments&lt;/h1&gt;
&lt;p&gt;I say there&apos;s no documentation mostly as a joke because, as I&apos;ve said before, Angular 2 is not done. However what I&apos;m always impressed by is the level and quality of comments by the Angular team in the source code. This is a great tradition that the Angular team is carrying over from Angular 1, and I would not have been able to create my app if it hadn&apos;t been for the source code comments. It&apos;s not surprising the Angular team takes such time and care to make sure their code is exhaustively commented. They actually run the source code through the &lt;a href=&quot;https://github.com/angular/dgeni&quot;&gt;dgeni documentation generator&lt;/a&gt; to produce their API docs. So while it was less pretty than browsing a webpage, all the documentation that will exist there is already accessible.&lt;/p&gt;
&lt;p&gt;When I wanted to understand the additional properties that could be set with the &lt;code&gt;@Component&lt;/code&gt; decorator, I was able to easily &lt;a href=&quot;https://github.com/angular/angular/blob/master/modules/angular2/src/core/annotations/annotations.js#L488-523&quot;&gt;delve into the source code and read the comments&lt;/a&gt; that contained all the documentation that I could ever need for that particular decorator. This was great when I was curious about the API for a specific object. However the type of documentation that is still very much a work in progress is &apos;integration&apos; or guide documentation. This is documentation that takes a high level look at how multiple objects work together to create an application, showing you how the &lt;code&gt;@Component&lt;/code&gt; directive makes use of the &lt;code&gt;DI&lt;/code&gt; module when you instantiate a class. &lt;a href=&quot;https://github.com/angular/angular/tree/master/modules/angular2/docs/core&quot;&gt;There is already a good amount of progress on this type of documentation&lt;/a&gt; but there is still a lot left to do.&lt;/p&gt;
&lt;h1&gt;Explicit&lt;/h1&gt;
&lt;p&gt;Angular 2 is an incredibly explicit framework. This is even starker when compared against Angular 1.&lt;/p&gt;
&lt;p&gt;In Angular 1 you&apos;re able to willy nilly use any directive that you want in any template. If you want to add a &lt;code&gt;ng-repeat&lt;/code&gt; go right ahead, Angular will happily compile that template.&lt;/p&gt;
&lt;p&gt;With Angular 2 you must declare what directives are used in your component. I spent a good ten minutes when making my HN app trying to figure out why my list of HN items were not being expanded by the for loop I had created (&lt;code&gt;&amp;lt;div *for=&quot;&quot;/&amp;gt;&lt;/code&gt; is the new &lt;code&gt;&amp;lt;div ng-repeat=&quot;&quot;/&amp;gt;&lt;/code&gt;). It was only after scratching my head and wondering if I had broken Angular that I realized I &lt;a href=&quot;https://github.com/hswolff/hn-ng2/blob/f77f24e3d56637445fce75c115136853a709f2d8/src/pages/item/index.js#L14&quot;&gt;hadn&apos;t declared that the &lt;code&gt;For&lt;/code&gt; directive was being used in my template.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;While being explicit is great I found the boiler-plating of having to declare &lt;code&gt;For, If, Switch, SwitchWhen, SwitchDefault&lt;/code&gt; for every component to be quite monotonous. I&apos;m not used to having to declare what my component is using and I found that change to be a little tricky to get used to. This is definitely due to the mental switch from Angular 1 where every directive is always available, so it&apos;s just going to be something that takes some time for adjustment.&lt;/p&gt;
&lt;h1&gt;Tools&lt;/h1&gt;
&lt;p&gt;Angular 2 already seems to be shaping up to be a very tooling friendly - and heavy - framework.&lt;/p&gt;
&lt;p&gt;It was recently announced that Angular 2 is written with &lt;a href=&quot;http://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt; which is great as it allows you to take advantage of all of TypeScript&apos;s features, most importantly types. However I was little let down to see that internally Angular 2 is still being compiled with Traceur. I can only imagine this is a work in progress but I was sad I couldn&apos;t start using TypeScript with Angular today.&lt;/p&gt;
&lt;p&gt;Along with TypeScript Angular includes a &lt;a href=&quot;https://github.com/angular/angular/tree/master/modules/rtts_assert&quot;&gt;run-time type assertion library&lt;/a&gt; so that you can continue to take advantage of your type definitions when your app is running in the browser.&lt;/p&gt;
&lt;p&gt;On top of types Angular &lt;a href=&quot;https://github.com/angular/angular/blob/master/modules/angular2/package.json#L12&quot;&gt;also includes&lt;/a&gt; the entire &lt;a href=&quot;https://github.com/Reactive-Extensions/RxJS&quot;&gt;Rx library&lt;/a&gt; so you can work with the reactive programming paradigm.&lt;/p&gt;
&lt;p&gt;All of these are great to have included however they do come with a cost.&lt;/p&gt;
&lt;p&gt;In my Angular 1 Hacker News app the JavaScript file size of the final application code is 194.9kb. This includes a number of external libraries: angular-animate, ui-router, lodash, firebase, and momentjs.&lt;/p&gt;
&lt;p&gt;In my Angular 2 Hacker News app the JavaScript file size of the final application is 250kb. That only includes the firebase library as a dependency.&lt;/p&gt;
&lt;p&gt;Due to Angular 2 being so large it takes a while to parse all the contained JavaScript code. When I created a simple &apos;Hello World&apos; app before creating the HN app it seemed to take between 2-3 seconds before any content was rendered on the page. There were some moans on &lt;a href=&quot;https://news.ycombinator.com/item?id=9405142&quot;&gt;the Hacker News thread&lt;/a&gt; that the application was slow. As far as I can tell, this is why.&lt;/p&gt;
&lt;p&gt;I&apos;d be happy to hear from the Angular team about this. I know a lot of work has been done to make sure Angular is performant once its on the page - an entire &lt;a href=&quot;https://github.com/angular/angular/tree/master/modules/benchmarks&quot;&gt;benchmarks&lt;/a&gt; module has been created for this explicit purpose - but I haven&apos;t seen any mention of start-up time.&lt;/p&gt;
&lt;h1&gt;Closing Thoughts&lt;/h1&gt;
&lt;p&gt;Overall I&apos;m extremely impressed with the progress of Angular 2. Despite being an alpha it seems to be rapidly racing towards beta status. Many of its primitive objects are already in place which is exciting. With primitives in hand it&apos;ll allow for the creation of higher-level components which I imagine is what Angular 2 developers will spend most of their time interfacing with.&lt;/p&gt;
&lt;p&gt;As I&apos;ve shown it&apos;s already possible to create a fully featured application with Angular 2. There were some instances where I found Angular 2 was not quite ready and I enumerated all of these &lt;a href=&quot;https://github.com/hswolff/hn-ng2#todo&quot;&gt;gaps in my Todo list&lt;/a&gt;. The two things I&apos;m most looking forward to is being able to use TypeScript directly with Angular and also playing around with reactive coding through the Rx library.&lt;/p&gt;
&lt;p&gt;I&apos;m not exactly sure when the Angular team hopes to release Angular 2 but I wouldn&apos;t be surprised if it was later this year - sometime in the fall. It&apos;s already way further along than I expected. If this is the alpha, I can&apos;t wait to see the first stable release.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thanks to Justin Poliey (&lt;a href=&quot;https://twitter.com/justinpoliey&quot;&gt;@justinpoliey&lt;/a&gt;) and Xavier López (&lt;a href=&quot;https://twitter.com/xavierelopez&quot;&gt;@xavierelopez&lt;/a&gt;) for reading drafts of this post.&lt;/em&gt;&lt;/p&gt;
</content:encoded></item><item><title>Essential Atom Packages</title><link>https://hswolff.com/blog/essential-atom-packages/</link><guid isPermaLink="true">https://hswolff.com/blog/essential-atom-packages/</guid><pubDate>Wed, 25 Feb 2015 04:30:16 GMT</pubDate><content:encoded>&lt;p&gt;&lt;a href=&quot;https://atom.io/&quot;&gt;Atom&lt;/a&gt; is a hackable code editor from the fine folks at GitHub. It&apos;s written entirely in JavaScript (specifically CoffeeScript) and runs in a self contained Chromium environment. It&apos;s new and young, yet slowly growing in popularity and features.&lt;/p&gt;
&lt;p&gt;After using Sublime Text for the past three years I found myself experiencing some growing pains. ST doesn&apos;t seem to be actively maintained, communications with its sole developer are non-existent and intermittent. The package community, while large, isn&apos;t holistic. Packages support isn&apos;t built into ST and as such I&apos;ve had some unsatisfactory experiences. I&apos;ve had packages randomly break, either from updates or installing a new package that conflicts with already installed packages. Sometimes packages just never work, or require obscure settings with non-existent documentation.&lt;/p&gt;
&lt;p&gt;And if I&apos;m being completely honest ST just isn&apos;t exciting anymore. I&apos;m bored and Atom presents a welcome change.&lt;/p&gt;
&lt;p&gt;I&apos;ve been using Atom as my primary editor for the past month. Overall I&apos;ve been very happy with my experience. I tried using Atom when it was first released but found it completely unusable as my primary editor. It was slow and its feature set (compared to ST) was woefully inadequate. Since then it&apos;s come a long way. While it&apos;s still missing some features in its core set of packages, I was able to find a community package that filled my need.&lt;/p&gt;
&lt;p&gt;The one true point where Atom is truly lacking compared to ST is in the time it takes from opening the application and being able to code. I know that is a focus of the Atom team, and for now it&apos;s tolerable. I&apos;m definitely looking forward to all future speed increases.&lt;/p&gt;
&lt;p&gt;So in the vein of my previous post on &lt;a href=&quot;/my-favorite-sublime-text-2-plugins-aka-packages/&quot;&gt;my favorite Sublime Text packages&lt;/a&gt;. I present to you this follow up. My favorite and essential Atom packages.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/mpeterson2/save-session&quot;&gt;save-session&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Without this package I would not have been able to switch to Atom. This package brings to Atom the most excellent feature of Sublime Text wherein you can have an un-saved file open, quit, re-open Atom, and find that file just as you left it, completely unchanged.&lt;/p&gt;
&lt;p&gt;I can&apos;t begin to tell you how many times this feature has saved my ass. I no longer have to worry about not saving a file if my computer freezes - I know I&apos;m saved.&lt;/p&gt;
&lt;p&gt;It also acts as a wonderful light-weight scratch pad. Just open a new tab, jot down some notes and keep it open for as long as you need that information. Quit Atom, restart your computer, that file isn&apos;t going anywhere until you explicitly close that tab.&lt;/p&gt;
&lt;p&gt;A must have.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/danielbrodin/atom-project-manager&quot;&gt;project-manager&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This package allows you to easily save and switch between projects. It&apos;s a real time saver when you&apos;re working on multiple projects at once. Rather than having to manually find the folder where the code exists and opening it, you can simply activate the Project Switcher menu via ctrl+cmd+p and easily open an existing project.&lt;/p&gt;
&lt;p&gt;This brings Atom to parity with ST&apos;s project switcher, so it&apos;s a real must have if you use that feature in ST.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/atom-community/autocomplete-plus&quot;&gt;autocomplete-plus&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The built-in Atom autocomplete package is a little lame. It isn&apos;t eager in its suggestions and doesn&apos;t seem to know that much about your code that it&apos;s actually helpful. This package makes autocomplete in Atom much more usable, with plenty more customization, and a better capacity for finding suggestions.&lt;/p&gt;
&lt;p&gt;I have one recommendation that in autocomplete-plus&apos; settings you turn on its &lt;code&gt;Use Strict Matching For Built-In Provider&lt;/code&gt;. This causes the package to more closely match ST&apos;s autocomplete, which I find produces better and more reliable results.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/tststs/atom-ternjs&quot;&gt;atom-ternjs&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://ternjs.net/&quot;&gt;Tern&lt;/a&gt; is a code-analysis engine for JavaScript. This package brings its analysis to autocomplete-plus, which means even &lt;em&gt;better&lt;/em&gt; autocomplete suggestions. Not only that it also adds context to your JavaScript code such that you can jump to the definition of a function from its usage, a feature you&apos;d normally only see in full IDEs like IntelliJ. Makes developing much easier and pleasant, a definite performance boost.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/richrace/highlight-line&quot;&gt;highlight-line&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Simple plug-in but one that I was sorely missing from ST. It does what it says on the tin: the line you currently have selected is given a highlight so you can easily find your place in your file.&lt;/p&gt;
&lt;p&gt;This is a personal preference package, but one I can&apos;t live without.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/richrace/highlight-selected&quot;&gt;highlight-selected&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another personal preference, this package adds the ST feature of highlighting the current word that is selected. So if you were to select the word &apos;hello&apos; then all other occurrences of the word &apos;hello&apos; would be highlighted. Makes for much easier navigation through code.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/AtomLinter/Linter&quot;&gt;linter&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The essential linter package. Gives you linting feedback in real-time, letting you know when you&apos;ve written code that doesn&apos;t pass your current linter configurations.&lt;/p&gt;
&lt;p&gt;This package relies on plug-in packages to be useful, the one I use daily is &lt;a href=&quot;https://github.com/AtomLinter/linter-jshint&quot;&gt;linter-jshint&lt;/a&gt; but there are &lt;a href=&quot;https://github.com/AtomLinter/Linter#available-linters&quot;&gt;many linters available&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/nikhilkalige/docblockr&quot;&gt;docblockr&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A nifty little package that makes it easier to write documentation. Since documentation isn&apos;t exactly the most exciting part of the developer workflow I&apos;m always looking to find something to make the task faster and easier. This package helps in both those regards. With it there&apos;s almost no excuse to skip documenting your code.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/bigfive/atom-sublime-select&quot;&gt;Sublime-Style-Column-Selection&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is another package that brings Atom to parity with ST. With this package you can now hold &lt;code&gt;alt&lt;/code&gt; while you select text to create multiple cursor selections, allowing you to quickly edit multiple lines from the same same location. It&apos;s a little productivity trick I use daily.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/mattberkowitz/autoclose-html&quot;&gt;autoclose-html&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You wrote an opening &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element? This handles automagically creating the ending tag for you. That was easy.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;https://github.com/emmetio/emmet-atom&quot;&gt;emmet&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://emmet.io/&quot;&gt;Emmet&lt;/a&gt; is a topic for an entire blog post but to make a long story short this package brings Emmet to Atom. Super useful for scaffolding HTML and CSS.&lt;/p&gt;
&lt;h1&gt;Listing Your Packages&lt;/h1&gt;
&lt;p&gt;I wrote a little script to help me get the list of packages I have installed. It&apos;s a quick and dirty little node script, but I figured &quot;Hey, I&apos;m a developer. Developer automate their tasks. Let&apos;s automate this!&quot;&lt;/p&gt;
&lt;p&gt;The script just reads in your Atom packages directory and then prints the name and description from each &lt;code&gt;package.json&lt;/code&gt; to stdout.&lt;/p&gt;
&lt;p&gt;Figured I&apos;d save it incase I had to run it again. Or if you were curious.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var fs = require(&apos;fs&apos;);
var path = require(&apos;path&apos;);

var atomPackagesPath = path.join(process.env.HOME, &apos;.atom/packages&apos;);

fs.readdirSync(atomPackagesPath).forEach(function(current) {
  var packagePath = path.join(atomPackagesPath, current);

  if (fs.statSync(packagePath).isDirectory()) {
    var p = require(packagePath + &apos;/package.json&apos;);
    process.stdout.write(&apos;[&apos; + p.name + &apos;](&apos; + p.repository.url + &apos;)\n&apos;);
    process.stdout.write(p.description + &apos;\n\n&apos;);
  }
});
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Switch to Atom!&lt;/h1&gt;
&lt;p&gt;What I love most about Atom is that it encourages you to hack it and make it yours. When I&apos;m less than thrilled with how Atom is behaving I know there&apos;s a way to tweak it and make it work just how I desire.&lt;/p&gt;
&lt;p&gt;Just the other day I was annoyed at what Atom showed in its title bar. So after a quick search I found the &lt;a href=&quot;https://github.com/postcasio/custom-title&quot;&gt;custom-title&lt;/a&gt; that allows me to completely customize what is shown. Had I not found that package I know there&apos;s an API waiting for me to jump into and use to my hearts content.&lt;/p&gt;
&lt;p&gt;I love that Atom is extendable and flexible. It truly can be made into anything you desire, and there&apos;s no better time to make the switch than today.&lt;/p&gt;
</content:encoded></item><item><title>Top 10 Albums of 2014</title><link>https://hswolff.com/blog/top-10-albums-of-2014/</link><guid isPermaLink="true">https://hswolff.com/blog/top-10-albums-of-2014/</guid><pubDate>Wed, 31 Dec 2014 21:54:02 GMT</pubDate><content:encoded>&lt;p&gt;Music. In 2014. God, how can I even begin?&lt;/p&gt;
&lt;p&gt;2014 wasn&apos;t even a year of music for me, it was a year of growth with Rachel and starting a whole new chapter in my life. The marriage was what consumed the entire year, with everything else just a blur in the background.&lt;/p&gt;
&lt;p&gt;Yet the music of this year is what accompanied me along the way towards saying my blessed vows. It was the music, and the story of how the music came into my life, that gave this year its depth and color. How could I have known that my first dance song would be from my top album of 2014? (I suppose that it shouldn&apos;t be that much of a surprise.)&lt;/p&gt;
&lt;p&gt;There was a lot of music in 2014. Looking back at everything that flittered through my ear canals in the past year somewhat astonished me - there was a lot of good stuff released. Some albums held me for months on end, listening to each track in sequence on repeat until every song was etched into the recesses of my brain. Some albums were spiked with a couple outstanding tracks amidst limp ones, preventing me from enjoying the album from beginning to end.&lt;/p&gt;
&lt;p&gt;When I sat down and sorted through what albums would make it onto this top ten list I wasn&apos;t shocked at the ones that bubbled to the surface. Yet the albums that didn&apos;t make it onto the list deserve mention too. Every album listed on this post holds a dear place in my heart, as it helped shape this year into one of the best of my life. Without them I&apos;d have gone through the year in silence, and god what a boring thing that would have been.&lt;/p&gt;
&lt;h3&gt;Honorable Mentions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Her Soundtrack&lt;/li&gt;
&lt;li&gt;Beck, &lt;em&gt;Morning Phase&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Banks, &lt;em&gt;Goddess&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Caribou, &lt;em&gt;Our Love&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Damon Albarn, &lt;em&gt;Everyday Robots&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Hamilton Leithauser, &lt;em&gt;Black Hours&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Jessie Ware, &lt;em&gt;Tough Love&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Porter Robinson, &lt;em&gt;Worlds&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;SBTRKT, &lt;em&gt;Wonder Where We Land&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Sylvan Esso, &lt;em&gt;Sylvan Esso&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;TV on the Radio, &lt;em&gt;Seeds&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;10. alt-J, &lt;em&gt;This Is All Yours&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When alt-J first came onto the music scene in 2012 they brought with them a sound that no one had quite heard before. It was eerie, atmospheric, moody, and insanely catchy. It was decidedly alternative, but surprisingly very popular.&lt;/p&gt;
&lt;p&gt;The question then becomes, can they do it again? With their sophomore album they proved they can.&lt;/p&gt;
&lt;p&gt;In many ways weirder than their first album, &lt;em&gt;This Is All Yours&lt;/em&gt; retained the same trademark alt-J sound, delivering some new songs with hooks, and some new ones that showed them exploring more of their weirder side. Although not as immediately accessible as their first album, this follow-up grew on me and became one of my go-to albums to listen to when I went out running.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;9. The Decemberists, &lt;em&gt;What a Terrible World, What a Beautiful World&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Three years since their previous release, this new album ended the hard drought of new material. It caught me by surprise as I had completely forgotten that The Decemberists were working on new material. I wasn&apos;t expecting it, but dear lord was I happy when it arrived.&lt;/p&gt;
&lt;p&gt;Their previous album left me wanting as I found it completely inaccessible, whereas &lt;em&gt;What a Terrible World, What a Beautiful World&lt;/em&gt; immediately reminded me of their sound from their first two albums (which I completely adore).&lt;/p&gt;
&lt;p&gt;I didn&apos;t know that this is what I wanted, but as soon as I started listening I knew it was long overdue. This album is such a welcome and triumphant return to form. Every track is packed with all the reasons you originally fell in love with The Decemberists. Far from nostalgia, it&apos;s a collection of tracks that perfectly show how they initially became popular.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;8. Hoodie Allen, &lt;em&gt;People Keep Talking&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have a soft spot in my heart for Hoodie Allen. He&apos;s an artist who bucks the stereotypical path of musicians. He lives outside of the music industry machine, having remained independent his entire career, never signing a contract with a major record label.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;People Keep Talking&lt;/em&gt; is Hoodie Allen&apos;s first full-length studio album and it&apos;s some of his strongest work to date. The album flows from start to finish, with wonderful interludes that nicely bridge the transition from one track to the next. Every song is catchy and packed with hooks that you&apos;ll find yourself repeating throughout the day.&lt;/p&gt;
&lt;p&gt;It&apos;s a happy album, one that&apos;ll put a swagger in your step as you ride along with Hoodie as he takes you on a joy-filled ride through his musical canvas.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;7. Inside Llewyn Davis Soundtrack&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you haven&apos;t seen the movie yet, I implore you to watch &lt;em&gt;Inside Llewyn Davis&lt;/em&gt; before listening to the album. One of my favorite things about music is how it can elevate life into a realm that&apos;s beyond reality. &lt;em&gt;Inside Llewyn Davis&lt;/em&gt; and the music that accompanies it is a perfect examples of this phenomena.&lt;/p&gt;
&lt;p&gt;The mood cast from this album is almost tangible. Every song is oozing with emotion. The melancholy tunes of yearning clutch at my heart as I get to feel the heartache and pain that was put into the song.&lt;/p&gt;
&lt;p&gt;Even though there&apos;s a couple of tracks on this album that are nails on a chalkboard, the rest of the album completely makes up for it and eases the pain.&lt;/p&gt;
&lt;p&gt;The emotion on this album is incredible and it&apos;s something I found myself returning to again and again.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;6. Taylor Swift, &lt;em&gt;1989&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2014 was the year I found myself giving up my pre-conceived notions of pop and the artists that create it. Taylor Swift&apos;s &lt;em&gt;1989&lt;/em&gt; was one of the albums that benefited from my new open-mindedness (she really has my number three album to thank for opening this door).&lt;/p&gt;
&lt;p&gt;To be fair, I don&apos;t think I could have avoided &lt;em&gt;1989&lt;/em&gt;if I had tried. It completely took the world by storm and for a good reason: the album is great. And I mean, truly, honestly, no bull-shit, great. It&apos;s unabashedly pop (thankfully not country) and every track is immaculately constructed.&lt;/p&gt;
&lt;p&gt;Yet despite the micro-management of working every track to perfection, the album comes across as honest and authentic. That&apos;s its true drawing power. While the songs are great and know every pop trick in the book, its delivery ad presentation include a note of authenticity that allows the album to come without pretension.&lt;/p&gt;
&lt;p&gt;Perhaps that was calculated too, but at this point I just have to put paranoia aside and enjoy the pop-perfection that is &lt;em&gt;1989&lt;/em&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;5. Spoon, &lt;em&gt;They Want My Soul&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Spoon is an incredible band that makes incredible music. They&apos;re unafraid to take risks with their sound, yet even while experimenting their music retains the trademark Spoon sound.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;They Want My Soul&lt;/em&gt; is another incredible album from Spoon, where literally every track is a winner. There are no duds and nothing on the album that caused even the slightest of winces. While some tracks could be considered experimental, for Spoon it&apos;s just a continuation of their already strong musical foundation.&lt;/p&gt;
&lt;p&gt;I listened to this album ad nauseam. On my way into work, while I went running, while working. &lt;em&gt;They Want My Soul&lt;/em&gt; consumed my soul for an entire month and I&apos;m so glad that it did.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;4. Nick Mulvey, &lt;em&gt;First Mind&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Nick Mulvey came into my world by way of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Mercury_Prize&quot;&gt;Mercury Prize&lt;/a&gt;. Every year when the Mercury Prize announces their short list for albums of the year I pour through it to make sure I didn&apos;t miss anything from the past year. Thank god I did so, as Nick Mulvey would have been missed.&lt;/p&gt;
&lt;p&gt;A singer-songwriter, &lt;em&gt;First Mind&lt;/em&gt; is Mulvey&apos;s debut album and it quickly became one of my favorite albums of the year. Wonderful lo-fi and serene, the tracks showcase Mulvey singing along with his guitar, crafting such wonderful and calming folky tunes that proved an excellent back-drop to the rush and bustle of NYC.&lt;/p&gt;
&lt;p&gt;Each track flows into the next, creating an album that is wonderful to listen to from start to finish. The worst part of the album is its end. Yet I found a trick to side-step this issue: hit play again.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;3. Ed Sheeran, &lt;em&gt;X&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ed Sheeran is the guy who got me out of my bubble of beliefs that pop wasn&apos;t worth my time and the people who made it are sub-par musicians. My ridiculous immature knee-jerk reaction against popularity was getting in the way of finding good music and I&apos;m incredibly glad that Ed Sheeran&apos;s &lt;em&gt;X&lt;/em&gt; showed me that there&apos;s a reason some artists are incredibly popular: because they make really good music.&lt;/p&gt;
&lt;p&gt;While &lt;em&gt;X&lt;/em&gt; has many great moments of Ed Sheeran wailing over his guitar, it&apos;s also filled with his trademark rapping that adds such a delightful twist to the album. The mood and ambiance of the album sway easily from introspective and insecure to uplifting and wondering.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;X&lt;/em&gt; is filled with pop-standouts but it&apos;s also an album with heart. It&apos;s the heart that grounds every track and makes it such a pleasure to listen to.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;2. Chet Faker, &lt;em&gt;Built On Glass&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The only electronic album on my list this year lands at number two. Introduced to me by my wife, Chet Faker is a lovely mix of electronic and singer-songwriter simplicity. While the production is entirely electronic, its Chet Faker singing along with the music that gives his sound the heart and depth that electronic music sometimes lacks.&lt;/p&gt;
&lt;p&gt;The album is relaxed and free-flowing, with catchy beats and refrains that guarantees you&apos;ll be bobbing your head and singing along. In many ways the album reminds me of the Kings Of Convenience album &lt;em&gt;Versus&lt;/em&gt;, however &lt;em&gt;Built On Glass&lt;/em&gt; diverges in a welcome way. &lt;em&gt;Built On Glass&lt;/em&gt;leans away from delving too deeply into its electronic soundscape, instead focusing on crafting catchy tunes and melodies that get their sound from electronic instruments.&lt;/p&gt;
&lt;p&gt;I listened to &lt;em&gt;Built On Glass&lt;/em&gt; on repeat for many weeks. The songs don&apos;t tire - they remain just as catchy and addicting as the first listen.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;1. Sam Smith, &lt;em&gt;In The Lonely Hour&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And we arrive at my number one album of 2014, Sam Smith&apos;s debut album &lt;em&gt;In The Lonely Hour&lt;/em&gt;. In some ways its unfair to say that 2014 was Sam Smith&apos;s debut year, as he had such a big presence in 2013 thanks to his lending his voice to Disclosure&apos;s breakout debut record &lt;em&gt;Settle&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;And while I won&apos;t say that &lt;em&gt;In The Lonely Hour&lt;/em&gt; overshadows Sam Smith in 2013, it is in many ways the logical and welcome progression of Sam Smith&apos;s career.&lt;/p&gt;
&lt;p&gt;Yes we first got to know this man while he crooned over dance tunes, yet seeing him fully express himself and his sound through his own album was completely welcome. We got to know the music that Sam Smith would create, free of collaboration with other artists. And we found out that he creates some soul-crushingly beautiful music.&lt;/p&gt;
&lt;p&gt;There isn&apos;t enough that can be said of Sam Smith&apos;s voice. He croons so beautifully, with soul and honesty that causes your own heart to reach out and touch his. He can howl without breaking a sweat and whisper a lyric so beautiful it causes you to tear.&lt;/p&gt;
&lt;p&gt;Many a night were spent with Sam Smith lulling me to rest, singing me down to a level of calm from the rush of the day. As the sun set Sam Smith sang and welcomed the night with his beautiful music.&lt;/p&gt;
&lt;p&gt;My wife and I chose his rendition of &lt;em&gt;Latch&lt;/em&gt; to be the music we used for our first dance at our wedding. I&apos;ll never forget the moment, holding her close, smiling deeply, as we danced as best we could on the dance floor, as Sam Smith crooned:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You lift my heart up when the rest of me is down&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;You, you enchant me even when you&apos;re not around&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If there are boundaries, I will try to knock them down&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;I’m latching on, babe, now I know what I have found&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr /&gt;
&lt;p&gt;Care to easily listen to the albums listed above? My friend Tom took the time to compile a Spotify playlist for your easy use. Thanks Tom!&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;https://embed.spotify.com/?uri=spotify:user:tomstroll:playlist:3lyzNJvzUU4zz6DZDAXy9E&quot; width=&quot;300&quot; height=&quot;380&quot; frameborder=&quot;0&quot; allowtransparency=&quot;true&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Building Hacker News With Angularjs</title><link>https://hswolff.com/blog/building-hacker-news-with-angularjs/</link><guid isPermaLink="true">https://hswolff.com/blog/building-hacker-news-with-angularjs/</guid><pubDate>Thu, 09 Oct 2014 01:39:53 GMT</pubDate><content:encoded>&lt;p&gt;This week &lt;a href=&quot;http://blog.ycombinator.com/hacker-news-api&quot;&gt;Hacker News announced its official API&lt;/a&gt;. This is really great news. Prior to this official API all 3rd-party apps resorted to scraping the website to as their data source, a brittle and unscalable practice. This new API provides a standard and efficient way to create 3rd-party Hacker News applications.&lt;/p&gt;
&lt;p&gt;Last night I decided to try out this new API. I randomly decided to sprint and see how quickly I could create an exact clone of Hacker News using &lt;a href=&quot;https://angularjs.org/&quot;&gt;angularjs&lt;/a&gt;. Turns out it took me almost exactly 2 hours to do. Pretty damn impressed with myself.&lt;/p&gt;
&lt;p&gt;To cut to the chase, find the demo url here: http://hswolff.github.io/hn-ng/
And the source code here: https://github.com/hswolff/hn-ng&lt;/p&gt;
&lt;h2&gt;How Was This Made?&lt;/h2&gt;
&lt;p&gt;I started the project via scaffolding through &lt;a&gt;Yeoman&apos;s&lt;/a&gt;http://yeoman.io/ &lt;a href=&quot;https://github.com/yeoman/generator-gulp-webapp&quot;&gt;gulp-webapp generator&lt;/a&gt;. This saved me a lot of initial work, as it created all the rote files I would have otherwise had to create and saved me the trouble of finding one of my old gulp files to copy over.&lt;/p&gt;
&lt;p&gt;After that I added angularjs to my bower file:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bower install --save angularjs&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And then used the magic of one of Yeoman&apos;s default tasks, &lt;code&gt;gulp wiredep&lt;/code&gt; to automatically inject those new bower files into my &lt;code&gt;index.html&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;I did hit a struggling point when it came to compiling my angular application. As angular dev&apos;s are aware, there are some issues surrounding &lt;a href=&quot;https://docs.angularjs.org/tutorial/step_05&quot;&gt;minification&lt;/a&gt;. To surmount this I grabbed the &lt;a href=&quot;https://github.com/Kagami/gulp-ng-annotate&quot;&gt;gulp-ng-annotate&lt;/a&gt; plugin which handles adding all required annotations to your code.&lt;/p&gt;
&lt;p&gt;There was also the issue of pre-warming my template cache. To solve this I used &lt;a href=&quot;https://github.com/miickel/gulp-angular-templatecache&quot;&gt;gulp-angular-templatecache&lt;/a&gt;, which allows you to pre-warm your &lt;code&gt;$templateCache&lt;/code&gt; to not require any AJAX calls in production.&lt;/p&gt;
&lt;p&gt;After solving those two hiccups everything was smooth sailing. I sprinted through the &lt;a href=&quot;https://github.com/hswolff/hn-ng/blob/master/app/scripts/controllers/homepage.js&quot;&gt;controller that handles the homepage&lt;/a&gt; and was just racing against myself.&lt;/p&gt;
&lt;p&gt;All-in-all a wonderful exercise. I hope as the official Hacker News API expands I can also expand my clone, and maybe add some of my own personal enhancements to it. For now I hope you enjoy the code!&lt;/p&gt;
</content:encoded></item><item><title>Chartbeat Presents at Front-end Meetup</title><link>https://hswolff.com/blog/chartbeat-presents-at-front-end-meetup/</link><guid isPermaLink="true">https://hswolff.com/blog/chartbeat-presents-at-front-end-meetup/</guid><pubDate>Thu, 31 Jul 2014 17:26:28 GMT</pubDate><content:encoded>&lt;p&gt;Last Thursday Chartbeat hosted the &lt;a href=&quot;http://www.meetup.com/frontend/events/148291772/&quot;&gt;Frontend Innovators Meetup group&lt;/a&gt; at our office. The focus was &lt;a href=&quot;https://angularjs.org/&quot;&gt;Angular.js&lt;/a&gt;, and my co-workers and I had the good fortune of being presenters. Our goal was to share some of the experiences and insights we’ve gained over the past year working with Angular.js.&lt;/p&gt;
&lt;h1&gt;From Closure To Angular&lt;/h1&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/IVVzM6upJN4&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://chart.bt/1rwuol9&quot;&gt;Slides are available online.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I presented first, focusing on how and why Chartbeat began using Angular.js for all of our front-end applications in the first place. I discuss our decision to migrate from &lt;a href=&quot;https://developers.google.com/closure/library/&quot;&gt;Google Closure Library&lt;/a&gt; to Angular.js after weighing all the options we had available. I then shared how we actually develop with Angular.js, focusing on how we layout our directories, files, and applications, and discussing our multiple applications at Chartbeat and our need for a system that allows for growth, flexibility, and sharing between all applications.&lt;/p&gt;
&lt;h1&gt;Reusable Components&lt;/h1&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/o_ehzZE4iFk&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://chart.bt/1pMW7JL&quot;&gt;Slides are available online.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/dbow1234&quot;&gt;Danny&lt;/a&gt; presented next, discussing the merits and pitfalls of developing reusable components. He first discussed the advantages of working with components, which give us the ability to quickly throw together entire new applications by using existing components, allowing us to rapidly develop new applications by leveraging existing components. Danny then dove into the trade-offs that accompany the creation and maintenance of components: if it is more “expensive” to create a component than it is to simply duplicate code then perhaps it isn’t worth the time and effort to create it as a component. It was a nuanced talk with some great points. Worth watching in full, I think.&lt;/p&gt;
&lt;h1&gt;Graphing Chartbeat with Angular + SVG + D3&lt;/h1&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/vmJ0501WzU0&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://chart.bt/1mxcE1m&quot;&gt;Slides are available online.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/heavi5ide&quot;&gt;Nick&lt;/a&gt; then presented about &lt;a href=&quot;http://en.wikipedia.org/wiki/Scalable_Vector_Graphics&quot;&gt;SVG&lt;/a&gt;, &lt;a href=&quot;http://d3js.org/&quot;&gt;D3&lt;/a&gt;, and Chartbeat’s use of D3 within Angular. He began by giving a solid background on SVG and the pitfalls you can encounter when trying to use Angular’s templating functionality with SVG elements (spoiler alert: there are a few!). Nick then discussed our internal library called C3 that he developed. He showed the design decisions that shaped C3 and the places where he’s found some shortcomings that he hopes to fix in the future.&lt;/p&gt;
&lt;h1&gt;Frontend Testing and Build Process&lt;/h1&gt;
&lt;p&gt;&amp;lt;iframe src=&quot;//www.youtube.com/embed/C5tei0brXRI&quot; width=&quot;560&quot; height=&quot;315&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;allowfullscreen&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://chart.bt/1sGmm9I&quot;&gt;Slides are available online.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/JemYoung&quot;&gt;Jem&lt;/a&gt; rounded out the night with a thorough talk on Chartbeat’s test practices and build process. He talked about our testing stack, consisting of &lt;a href=&quot;http://jasmine.github.io/2.0/introduction.html&quot;&gt;Jasmine&lt;/a&gt;, &lt;a href=&quot;http://karma-runner.github.io/&quot;&gt;Karma&lt;/a&gt;, &lt;a href=&quot;https://github.com/angular/protractor&quot;&gt;Protractor&lt;/a&gt;, &lt;a href=&quot;http://jenkins-ci.org/&quot;&gt;Jenkins&lt;/a&gt;, and &lt;a href=&quot;http://www.seleniumhq.org/&quot;&gt;Selenium&lt;/a&gt;, and the best ways to put  these systems to work. Jem also shared some good practices to keep in mind when using these tools. He then turned his focus to how we compile our applications for a production environment, discussing our move from &lt;a href=&quot;http://gruntjs.com/&quot;&gt;Grunt&lt;/a&gt; to &lt;a href=&quot;http://gulpjs.com/&quot;&gt;Gulp&lt;/a&gt; and why we&apos;re finding it a better fit -- it&apos;s cleaner and clearer to work with, as it’s mostly vanilla JavaScript, which makes reasoning with it easier.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;We had a great time presenting and hope everyone learned something from our talks.&lt;/p&gt;
&lt;p&gt;Angular.js is still pretty new and we&apos;re all still learning the best way to do things. Over the past year we’ve learned a lot about the right way to do things and the wrong way to do things. If you have too, please chime in. Sharing what we&apos;ve learned is the best way for our whole front-end community to continue building better and better things.&lt;/p&gt;
</content:encoded></item><item><title>Building an Entire Product in 6 Weeks (How we built the Chartbeat Paid Content Tool)</title><link>https://hswolff.com/blog/building-an-entire-product-in-6-weeks-how-we-built-the-chartbeat-paid-content-tool/</link><guid isPermaLink="true">https://hswolff.com/blog/building-an-entire-product-in-6-weeks-how-we-built-the-chartbeat-paid-content-tool/</guid><pubDate>Wed, 09 Jul 2014 14:40:04 GMT</pubDate><content:encoded>&lt;p&gt;A little while ago we released our &lt;a href=&quot;https://chartbeat.com/publishing/for-adsales/paid-content&quot;&gt;Paid Content&lt;/a&gt; product after two consecutive six week sprints. The first six weeks were spent creating the &lt;a href=&quot;http://en.wikipedia.org/wiki/Minimum_viable_product&quot;&gt;MVP&lt;/a&gt;, and the second six weeks were spent polishing it up.&lt;/p&gt;
&lt;p&gt;This is the breathless tale of those first six weeks.&lt;/p&gt;
&lt;h1&gt;Part 1: Research&lt;/h1&gt;
&lt;p&gt;This whole thing began because we saw that our clients were struggling. Paid content, sponsored content, native content – whatever you call it – remains a mysterious beast for many folks and there were few options for measuring paid content performance, let alone figuring out what you can do to make it better.&lt;/p&gt;
&lt;p&gt;For the first two weeks of our sprint we researched and brainstormed. We huddled into offices and littered the white boards with ideas, questions, diagrams, and whatever else we could to make sense of things. We’d pour over data to see what insights we could glean and what information would be helpful to know for any native content campaign. It was a lot of debating and arguing, breaking for lunch, and then regrouping for more debating and arguing.&lt;/p&gt;
&lt;p&gt;Amidst these debates we talked to existing clients. A lot. We wanted to know how they created paid content campaigns, and what pain points they have experienced. We’d invite them into the office and talk to them on the phone. We’d visit them in their office and pummel them with questions, searching to find what we could do to improve how they analyzed paid content performance.&lt;/p&gt;
&lt;h1&gt;Part 2: Design&lt;/h1&gt;
&lt;p&gt;
As we were assessing the type of data our clients needed, we also began to design our version of &lt;em&gt;better&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://tomgermeau.com/2014/02/how-designers-can-create-interactive-prototypes-with-illustrator/&quot;&gt;We&apos;d create one mock-up, show it around, gather feedback, and iterate. &lt;/a&gt; We&apos;d see what worked in a design and what didn’t. We&apos;d toss out the bad, toss out some of the good, and try again. We moved swiftly, for time was against us.&lt;/p&gt;
&lt;p&gt;Something that proved to be a great success were clickable mocks. Typically a mock is static. With a static mock you can cycle through a list of images to give a sense of what the product will contain, but a clickable mock allows you to simulate how the product will feel when it’s complete.&lt;/p&gt;
&lt;p&gt;These clickable mocks proved insanely helpful when discussing the product to clients. It enabled us to show our ideas and direction rather than just tell.&lt;/p&gt;
&lt;h1&gt;Part 3: Development&lt;/h1&gt;
&lt;p&gt;With under three weeks left to go in the cycle we knew we had to hustle.&lt;/p&gt;
&lt;p&gt;We wanted to see what the data for a real paid content campaign looked like so we worked towards getting things working on the screen as fast as possible. Despite all our planning and designing we had yet to see real data for a paid content campaign and we had concerns that we had planned and designed for data points that may not exist. It’s fine to plan to include data about the amount of Twitter activity that drives traffic to a piece of native content, however if that value is always 0, it’s not helpful.&lt;/p&gt;
&lt;p&gt;To our relief our planning paid off. The data worked and made sense. From there on out it was a sprint to bring all the beautiful designs to life.&lt;/p&gt;
&lt;h1&gt;Part 4: Launch&lt;/h1&gt;
&lt;p&gt;
With the launch of our MVP looming we knew we’d have to start making some hard decisions. Everything we wanted to include for the first version would not fit, so out came the knife as we looked to see what we could cut away.&lt;/p&gt;
&lt;p&gt;Delicately we began to inspect what was left. We began to weigh things, deciding what were show-stopping features or essential functionalities that had to make it for the launch, versus things that would be fine to include afterwards. We’d see which features would be more ‘expensive’ to complete. At this stage the only currency we traded in was time, with everything balanced between time to complete versus its impact on the product.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Some hard decisions were made but ultimately we managed to ship on time and practically feature complete.&lt;/p&gt;
&lt;p&gt;We were able to bring to market a product that six weeks prior did not exist as anything but an idea. Everyone at Chartbeat came together to make this a reality, each pulling their own weight and helping one another. Through and through it was an incredible team effort.&lt;/p&gt;
&lt;p&gt;Within Chartbeat we managed to create a MVP in record time. We were able to assess client needs and industry gaps to form our product and get it out the door and into client’s hands. We’re not done, but we’re off to a strong start.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Also posted on: &lt;a href=&quot;http://chart.bt/1jpEDFo&quot;&gt;Chartbeat&lt;/a&gt; and &lt;a href=&quot;https://medium.com/@hswolff/building-an-entire-product-in-6-weeks-how-we-built-the-chartbeat-paid-content-tool-1b27b46ff11b&quot;&gt;Medium&lt;/a&gt;&lt;/p&gt;
</content:encoded></item><item><title>Don&apos;t Deal With It, Fix It</title><link>https://hswolff.com/blog/dont-deal-with-it-fix-it/</link><guid isPermaLink="true">https://hswolff.com/blog/dont-deal-with-it-fix-it/</guid><pubDate>Wed, 23 Apr 2014 01:31:07 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve used Sublime Text for a long time. I started using it when it hit version 2 and clung to it like all hell was about to break loose.&lt;/p&gt;
&lt;p&gt;It fit my needs well. Opened nearly instantaneously, had sensible defaults for editing, and a lush and vibrant community of third-party packages that I could install to extend its core.&lt;/p&gt;
&lt;p&gt;There were a few things that bothered me about Sublime Text 2. Things that I just lived with as I couldn&apos;t be bothered to fix them. No, that&apos;s not true. I didn&apos;t fix them because I didn&apos;t think I was capable of fixing them. I looked at these inconveniences as something I just had to deal with because that&apos;s how the program worked, and there was nothing within my power to make it better.&lt;/p&gt;
&lt;p&gt;For a long time I lived with these irksome issues. Every time they popped up I would quickly swallow the ire that would rise in my throat, fighting it down so it wouldn&apos;t overwhelm. I would remind myself on every recurrence that this was just something I had to live with. It was just the way things are, and either I had to deal with it or go look for some other code editor.&lt;/p&gt;
&lt;p&gt;Every time I was faced with something annoying that Sublime Text did I would I swallow my annoyance. I would side-step it and walk right back into Sublime Text&apos;s loving embrace. Because for that one thing that annoyed me, it did countless other things that were simply amazing. So I would live with it.&lt;/p&gt;
&lt;p&gt;I&apos;ll never forget when my friend &lt;a href=&quot;http://netpro2k.com/&quot;&gt;Dom&lt;/a&gt; started using Sublime Text. He was a long time vim user, staunchly entrenched in the comfort of vim. Able to navigate his way across any document with just a matter of keystrokes. I was able to finally persuade him to try out Sublime Text by highlighting its ability to emulate vim&apos;s key bindings. After weeks of lobbying and convincing, Dom finally tried out Sublime Text and began to appreciate it in much the same way I had.&lt;/p&gt;
&lt;p&gt;He used it, and began to like it. He slowly started expanding his Sublime Text knowledge, gaining more experience with the program as he programmed. All was well for Dom until one day when Dom experienced the same annoyance that I had for weeks tried my best to ignore.&lt;/p&gt;
&lt;p&gt;I&apos;ll never forget what Dom did next.&lt;/p&gt;
&lt;p&gt;He fixed it.&lt;/p&gt;
&lt;p&gt;He set aside some time during his day and fixed this bug that I had been living with for months.&lt;/p&gt;
&lt;p&gt;He researched why this bug was happening and then looked into the Sublime Text API and created a third-party package that completely fixed the issue.&lt;/p&gt;
&lt;p&gt;I was dumb struck. It had not once occurred to me that it was within my power to fix this thing. I simply believed that it was something I was stuck with. And that was the assumption under which I operated for months.&lt;/p&gt;
&lt;p&gt;Dom? He wouldn&apos;t put up with it. He stopped everything he had to do, and found a fix to make his Sublime Text experience one without any grievance.&lt;/p&gt;
&lt;p&gt;Since that day I&apos;ve learned that I have the power to fix things around me that I don&apos;t like. I don&apos;t need to just deal with it because that&apos;s just the way things are. I have the power to shape the world around me. It&apos;s just a matter of believing that I can change things. Just believing is all I need to actually take the first step towards taking action.&lt;/p&gt;
&lt;p&gt;Sure this was about fixing a bug in a piece of software that annoyed me. But the implications of this realization was one that has reverberated throughout my way of going about life.&lt;/p&gt;
&lt;p&gt;Just the other day I was about to go into the planetarium at the Museum of Natural History. As the massive herd of people rushed past doors propped open by doorstops one doorstop came loose. This caused each person walking through the doorway to hold the door open for the person behind them. So it went in a long chain of people, each holding the door open for the next person, every one ignoring the door stop loose on the ground. However when I came to the door I paused to find the doorstop and jam it back into the door. A clear problem with a clear solution. All it took was a belief that I could fix the problem, and some time to take action.&lt;/p&gt;
&lt;p&gt;I&apos;m trying to do that more and more as I go about my days. When I see a problem I&apos;m going to look for a solution. No longer will I try to just deal with it. I&apos;m going to try and make it better. No matter how small and trivial it may be. I believe I can make my world better. All it requires is some action.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; By popular demand and through the miracle of memory recal I&apos;ve managed to remember what the issue was. I was using an existing Sublime Text plugin that was using the SublimeText API incorrectly which caused an error pop-up window to show every so often. It was infrequent enough to not bother me, however it was enough to annoy Dom. So he went into the source code and found the offending line and fixed it to prevent the pop-up from ever showing again. Sure it was a small thing, but made the entire experience that much better.&lt;/p&gt;
</content:encoded></item><item><title>The Modern Front-end Workflow - From Start to Finish</title><link>https://hswolff.com/blog/the-modern-front-end-workflow-from-start-to-finish/</link><guid isPermaLink="true">https://hswolff.com/blog/the-modern-front-end-workflow-from-start-to-finish/</guid><pubDate>Thu, 30 Jan 2014 18:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Front-end engineers have gone through a bit of a renaissance in recent years.&lt;/p&gt;
&lt;p&gt;There&apos;s been a wild and wonderful spurt in innovation that has completely changed what it means to be a front-end developer.&lt;/p&gt;
&lt;p&gt;We now have a vast and wide array of tools available to us, allowing us to develop faster and smarter.&lt;/p&gt;
&lt;p&gt;We now can push the limits of what a modern web browser can do, accomplishing things that two years ago seemed impossible.&lt;/p&gt;
&lt;p&gt;Bottom line, right now is an amazing time to be a front-end developer.&lt;/p&gt;
&lt;h2&gt;Start&lt;/h2&gt;
&lt;p&gt;
&lt;a href=&quot;http://www.flickr.com/photos/takkaria/2520731995/&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today there is almost zero friction to getting set up with a new project. Everything that you need to get started is only a few key strokes away thanks to some powerful new tools.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt; is the version control system of choice for most developers nowadays. It makes sharing code easy and frictionless. When you want to get going on a new code base you only have to run the simple git command of &lt;code&gt;git clone&lt;/code&gt; and all the code and all of its history is downloaded directly to your computer.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://npmjs.org/&quot;&gt;NPM&lt;/a&gt; is the &lt;a href=&quot;http://nodejs.org/&quot;&gt;node&lt;/a&gt; package manager. It allows developers to package their nodejs code a self contained module and then share it with the community. There are npm packages that provide almost every type of functionality you can imagine, allowing you to leverage the work of the community. Each new project has their own unique set of dependencies they require for them to work. To get all these dependencies installed locally you only need to run &lt;code&gt;npm install&lt;/code&gt;, which downloads and installs everything you need.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://bower.io/&quot;&gt;Bower&lt;/a&gt; is a package manager for third-party web libraries. Historically if your project requires &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; be included you would have to navigate to the jQuery website, download the file, extract it, and move it into your project. Bower simplifies that process by giving you the command &lt;code&gt;bower install&lt;/code&gt; which handles getting jQuery into your project.&lt;/p&gt;
&lt;h2&gt;Development&lt;/h2&gt;
&lt;p&gt;
&lt;a href=&quot;http://commons.wikimedia.org/wiki/File:EPA_GULF_BREEZE_LABORATORY,_CHEMISTRY_LAB._THE_CHEMIST_IS_TESTING_WATER_SAMPLES_FOR_PESTICIDES_-_NARA_-_546277.jpg&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Actually coding and developing your project is where most time is spent. Nowadays this is one of the most enjoyable parts due to the many wonderful tools available. These tools make dev&apos;ing so smooth that I&apos;d dare say it makes it fun. Scratch that - it makes it oodles of fun.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://gruntjs.com/&quot;&gt;GruntJS&lt;/a&gt; is the most popular task runner amongst front-end developers. There&apos;s already a huge community of grunt plugin authors that to date have written over 2,000 Grunt plugins, all of which are immediately ready for your use. Grunt allows you to automate rote tasks without breaking a sweat. For example if you need to compress all your jpg, gif, and png files you can use the &lt;a href=&quot;https://npmjs.org/package/grunt-contrib-imagemin&quot;&gt;imagemin grunt task&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;CSS Preprocessors like &lt;a href=&quot;http://lesscss.org/&quot;&gt;LESS&lt;/a&gt;, &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt;, or &lt;a href=&quot;http://learnboost.github.io/stylus/&quot;&gt;Stylus&lt;/a&gt; have made it easy to architect maintainable, extendable, and modular CSS. Among the many features that CSS preprocessors provide the two of most value are without a doubt &lt;a href=&quot;http://www.lesscss.org/#-nested-rules&quot;&gt;nested selectors&lt;/a&gt; and &lt;a href=&quot;http://www.lesscss.org/#-variables&quot;&gt;variables&lt;/a&gt;. Having the ability to define a color variable in one location and use it throughout allows for a flexibility in CSS that did not previously exist, yet one that was sorely needed.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://livereload.com/&quot;&gt;LiveReload&lt;/a&gt; changes the way you develop, as it brings a fluidity to your development flow that you didn&apos;t realize you needed. Whenever you change a file that you&apos;re working on LiveReload will notice that it changed and refresh your browsers so that you can immediately see your changes in place. No longer do you have to save a file, switch to the browser, and then refresh the page. With live reload after you save a file the browser will refresh itself, saving you time and grief.&lt;/p&gt;
&lt;h2&gt;Review&lt;/h2&gt;
&lt;p&gt;
&lt;a href=&quot;http://www.flickr.com/photos/awcole72/5826659567/&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you&apos;re ready to push some of your code into the wild it&apos;s always a good idea to review it with your team and run it through some code quality and style tools.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://help.github.com/articles/using-pull-requests&quot;&gt;A GitHub Pull Request&lt;/a&gt; is one of the handiest ways that you can rally your team around vetting your changes. After opening a pull request you&apos;re given a page that allows you to clearly state what you changed along with a view that shows the changes you made. Coupled with a robust comment system, a GitHub pull request makes it easy for your team to review and give feedback on changes.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.jshint.com/&quot;&gt;JSHint&lt;/a&gt; is a tool that programmatically finds errors in your code. It&apos;ll prompt you if you have a function with two arguments, and the second argument is never used, or if you&apos;re missing a semicolon where one should be. All these things ensure your code is in good shape, allowing your teammates to focus on other things that aren&apos;t as nit-picky as JSHint.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/mdevils/node-jscs&quot;&gt;JSCS&lt;/a&gt; is another tool that is great to have in your repertoire. JSCS is a JavaScript &lt;a href=&quot;http://coding.smashingmagazine.com/2012/10/25/why-coding-style-matters/&quot;&gt;code style&lt;/a&gt; checker, focusing on the style of your code and not the quality. You define what code styles you want and when you run your code through JSCS it&apos;ll alert you if there are any areas of your code that are not inline with your project&apos;s expectations.&lt;/p&gt;
&lt;h2&gt;Deploy&lt;/h2&gt;
&lt;p&gt;
&lt;a href=&quot;http://www.flickr.com/photos/boston_public_library/6323966056/&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Getting your code from your computer out into the world is the best part of development, as it&apos;s when you get to share all your work with the world at large.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.thoughtworks.com/continuous-integration&quot;&gt;Continuous integration&lt;/a&gt; is a practice that enables and encourages getting your code to production frequently and without fear of breaking anything. A CI server will automatically perform tests across all products, not just the ones you touched. If any tests fail alerts are sent out and any changes to production are halted, preventing regressions from reaching production. When all tests pass your changes are merged into the production ready branch, assets compiled, and production is updated.&lt;/p&gt;
&lt;p&gt;This makes the entire process of getting your changes live easy, effortless, and safe. You can view the progress of the CI server as it chugs along, letting you be kept in the loop of what&apos;s going on without having to push the process along yourself.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;The life of a front-end developer has never been easier. Browsers are getting better every day, and the tools we have at our disposal have never been better.&lt;/p&gt;
&lt;p&gt;No longer are we wallowing in the shadow of legacy browsers, but we&apos;re barreling ahead to stretch what&apos;s possible in the browser.&lt;/p&gt;
&lt;p&gt;The processes outlined above lets you worry less about minutiae and just focus on development and the product.&lt;/p&gt;
&lt;p&gt;The life of a front-end developer is pretty damn good.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Also posted on &lt;a href=&quot;http://blog.chartbeat.com/2014/01/30/modern-front-end-workflow-start-finish/&quot;&gt;Chartbeat&apos;s blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</content:encoded></item><item><title>Smarter Express Routing</title><link>https://hswolff.com/blog/smarter-express-routing/</link><guid isPermaLink="true">https://hswolff.com/blog/smarter-express-routing/</guid><pubDate>Sun, 12 Jan 2014 04:01:13 GMT</pubDate><content:encoded>&lt;p&gt;In a large &lt;a href=&quot;http://expressjs.com/&quot;&gt;ExpressJS&lt;/a&gt; application it is not optimal to define all your routes and handlers in the same file.&lt;/p&gt;
&lt;p&gt;For the sake of code clarity and cleanliness Express route handlers are often placed in their own file. Those files are then included in the file that is bootstraps your application.&lt;/p&gt;
&lt;p&gt;What you usually ends up with are two files, &lt;code&gt;user.js&lt;/code&gt; and &lt;code&gt;app.js&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;user.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;module.exports = function(req, res) {
  // Do the cha cha
  req.json({&apos;hello&apos;: req.params.user});
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;app.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var express = require(&apos;express&apos;);
var app = express();

var user = require(&apos;./user&apos;);

app.get(&apos;/user/:user&apos;, user);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Neither the route path or the route handler have any knowledge of each other, when they are both strongly inter-related. This increases the fragility of your application as this association is defined in two files.&lt;/p&gt;
&lt;p&gt;Say down the line the &lt;code&gt;user.js&lt;/code&gt; route handler changes, making it better fit by a new path. To make that update would require modifying two files. This association between the route handler and the route path should be adjacent to each other.&lt;/p&gt;
&lt;p&gt;Also, let&apos;s say you want to later reference that route handler&apos;s path. With this configuration there is no way to do that.&lt;/p&gt;
&lt;h3&gt;Smarter route definitions&lt;/h3&gt;
&lt;p&gt;Let&apos;s improve this situation by moving the route path to be with the route handler.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;user.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;module.exports.get = [];

exports.get.push([&apos;/user/:user&apos;, function (req, res) {
  // Do the cha cha
  req.json({&apos;hello&apos;: req.params.user});
}]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;app.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var express = require(&apos;express&apos;);
var app = express();

var user = require(&apos;./user&apos;);

user.get.map(function(route) {
  app.get.apply(app, route);
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using a little JavaScript magic (&lt;code&gt;.apply&lt;/code&gt;) we&apos;re able to dynamically apply every route path and route handler defined in &lt;code&gt;user.js&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This can scale as much as you want. You can add as many routes to the &lt;code&gt;get&lt;/code&gt; array as you&apos;d like, including other middleware functions, as everything in that array is passed to &lt;code&gt;app.get&lt;/code&gt; through the magic of &lt;code&gt;.apply&lt;/code&gt;. You can and should also do the same for your &lt;code&gt;post&lt;/code&gt;, &lt;code&gt;put&lt;/code&gt;, and &lt;code&gt;delete&lt;/code&gt; routes.&lt;/p&gt;
&lt;p&gt;This should make your Express application a little more robust, and much prettier.&lt;/p&gt;
</content:encoded></item><item><title>An easy introduction to AngularJS</title><link>https://hswolff.com/blog/what-is-angularjs-and-why-is-it-awesome/</link><guid isPermaLink="true">https://hswolff.com/blog/what-is-angularjs-and-why-is-it-awesome/</guid><pubDate>Mon, 25 Nov 2013 12:00:39 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;AngularJS doesn&apos;t do much.  When you take it out of the box (i.e. load it on a webpage) you&apos;re only given five things to play with: modules, services, controllers, directives, and filters.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Each of these things complements the other.  There are very slim overlaps in functionality between all the moving pieces of AngularJS.  That fills my heart with joy because I only have to learn how to do something one way, with one slice of the AngularJS pie.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The funny thing about AngularJS is when you use every &amp;lt;em&amp;gt;thing&amp;lt;/em&amp;gt; it provides, you get something far greater than its sum.   In that way AngularJS truly does allow you to create web-apps of &apos;superheroic&apos; proportions.  Their words, not mine (although I do agree).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Ready to dive a whee bit deeper?&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;!--more--&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Modules&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;A module in AngularJS is about what you&apos;d expect.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;It lets you package your code into small chunks, useful for breaking a large application into smaller pieces and for distributing code.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;You define a module name upon instantiation, neatly namespacing all the relevant code within.  This helps you stay clear of polluting the global window object and not worry about clobbering other variables.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;One of the most lovely features of modules in AngularJS is that you can load parts of a module in any order.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;For example on a html page that is loading your application you can load the script tags in any order, and it won&apos;t affect how the application is put together.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Services&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In their simplest form, a service provides singleton objects to your application.  That&apos;s really about all they do.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Sure there are some nuances to services.  There&apos;s different variants: factories, providers, constants, and values.  Most of them are quite aptly named.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Constants and values do about what you&apos;d expect.  They are easy to use key-value stores that can&apos;t be modified after app start-up.  Hence the &apos;constant&apos; name.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Factories are services designed to allow you to create new instances of an object.  The factories themselves are singletons, but they&apos;re designed to allow you to create as many instances of an object as you desire.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Providers are services that allow an amount of configuration before application initialization.  For example if you have an API service, you can change whether it points to the dev or production server by using the provider pattern (as opposed to having that if statement within the service.  Always better to be explicit.).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;That&apos;s about the skinny of what services are in AngularJS.  These things should (almost) never touch the DOM.  They&apos;re just vanilla JavaScript objects, with sugar around them to work neatly amidst the AngularJS framework.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Controllers&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Traditionally, controllers are used as the glue between models and views.  Here again AngularJS doesn&apos;t stray far from tradition.  In an AngularJS controller you can define what data and behavior is exposed to the view.  How this is done is semi-magical.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s a service that AngularJS provides called &apos;$scope&apos;.  $scope is used like a regular JavaScript object.  You can assign strings (&amp;lt;code&amp;gt;$scope.hello = &apos;world&apos;;&amp;lt;/code&amp;gt;), other objects (&amp;lt;code&amp;gt;$scope.person = {name: &apos;bob&apos;};&amp;lt;/code&amp;gt;), and functions (&amp;lt;code&amp;gt;$scope.foo = function() { return &apos;bar&apos;; }&amp;lt;/code&amp;gt;).  You know...whatever you want.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Where things get a little opaque is how that gets exposed to the view.  If you&apos;re really curious you&apos;re free to dive into AngularJS internals.  However it is safe to assume that anything assigned to &amp;lt;code&amp;gt;$scope&amp;lt;/code&amp;gt; is available for access in the view.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Aside from the magic of &amp;lt;code&amp;gt;$scope&amp;lt;/code&amp;gt; everything else about a controller is mundane.  Thank goodness.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Directives&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Basically directives are components.  That&apos;s the simplest way to understand it.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Past that things can get awfully confusing awfully quickly.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Directives allow you to extend the language of the DOM, doing things that jQuery is commonly used for.  For example AngularJS defines the &amp;lt;code&amp;gt;ngClick&amp;lt;/code&amp;gt; directive, which allows you to attach behavior when a click event is observed.  When AngularJS compiles your views (which are basically HTML) it has knowledge of the &amp;lt;code&amp;gt;ngClick&amp;lt;/code&amp;gt; attribute, and its behavior.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So when the AngularJS compiler sees &amp;lt;code&amp;gt;&amp;lt;div ng-click=&quot;popup()&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/code&amp;gt; it attaches a click event listener on that div element (as defined in the ngClick directive).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;AngularJS ships with many great default directives.  It&apos;s encouraged to re-use directives within directives.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Just remember that directives are similar to components: they allow you to create a new unit with specific functionality.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Filters&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Filters are used by templates to modify the output of data.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;For example AngularJS ships with the &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; filter which can take an integer input such as &amp;lt;code&amp;gt;12345&amp;lt;/code&amp;gt; and output it with commas as &amp;lt;code&amp;gt;12,345&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Or you can have an array of strings and only want to show the ones that start with a &apos;he&apos;.  You&apos;d use the &amp;lt;code&amp;gt;filter&amp;lt;/code&amp;gt; filter (unfortunate name redundancy).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Wrap-up&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The dirty secret of AngularJS is that it&apos;s basically a simple set of tools that allow you to do advanced things really easily.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;AngularJS only gets really complicated when you start diving into its source code.  But let&apos;s stay away from that elephant in the corner.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s an interesting learning curve when you get up to speed with AngularJS.  The first week you&apos;ll have a grand old time.  The second week you&apos;ll encounter some weirdness which will throw you back a bit.  By the third week you&apos;ll have to do a little more conceptual diving into AngularJS to understand why things are behaving the way they are.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;By the fourth week you&apos;ll be able to write a blog post just like this.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Get out there super-heroes.  Start writing some super-heroic JavaScript.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Make Your Code Pretty</title><link>https://hswolff.com/blog/make-your-code-pretty/</link><guid isPermaLink="true">https://hswolff.com/blog/make-your-code-pretty/</guid><pubDate>Fri, 30 Aug 2013 09:32:24 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;All too often I&apos;ll see code that&apos;ll make me gag.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s inconsistent indentation, no linting, and trailing white space run amok.  It won&apos;t effect how your code is executed but it makes for an unwholesome experience for whoever reads your code.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I won&apos;t place the blame for these types of code &apos;errors&apos; on the programmer.  If you don&apos;t have the proper software installed they are extremely hard to track.  I don&apos;t expect anyone to be hand-combing through their code, looking for any extraneous white-space or instances where they forgot to remove a trailing function argument that is no longer used.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;What I expect is for programmers to install the proper tools into their code/text editors to do it for them.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In the instance of Sublime Text there is a holy marriage of two packages that will ensure that every piece of code you write is beautiful.
&amp;lt;!--more--&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/SublimeText/TrailingSpaces&quot;&amp;gt;TrailingSpaces&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/08/trailing-spaces-300x75.png&quot; alt=&quot;trailing-spaces&quot; width=&quot;300&quot; height=&quot;75&quot; class=&quot;alignleft size-medium wp-image-2697&quot; /&amp;gt;
Just like shining a black light into dusty corners, Trailing Spaces will highlight every instance of extraneous whitespace.  In glorious neon pink, you&apos;ll see all your old code come alive in ways you never thought possible.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;After you install this package you&apos;ll understand why I get so upset when I see trailing white spaces left in code.  Whereas they are invisible without this package, they are a hideous eye sore with it.  Lighting ablaze every offender in its neon pink glare.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/SublimeLinter/SublimeLinter&quot;&amp;gt;SublimeLinter&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/08/linting-300x129.png&quot; alt=&quot;linting&quot; width=&quot;300&quot; height=&quot;129&quot; class=&quot;alignleft size-medium wp-image-2699&quot; /&amp;gt;
Instantaneous linting is a friend you wish you had years ago.  Keeping you honest with each line of code you write, SublimeLinter will continuously check your code to see if it is staying inline with best coding practices.  For Python that&apos;s PEP8, for JavaScript that&apos;s JSHint.  Along with best practices it&apos;ll also point out when you&apos;re doing something wrong.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;It&apos;s a loving whisper that alerts you that you left a trailing argument in a function you wrote.  You needed that argument parameter before, but after a quick refactor it became unused.  SublimeLinter is there to kindly point these things out.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;A machine doesn&apos;t care if your code is ugly.  It doesn&apos;t care if there&apos;s a bunch of extra whitespace littered throughout the code (unless it&apos;s a code sensitive language ;)).  It&apos;ll read it and execute it the same way.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The person who cares is the one reading your code.  They are the one who must hold your code up against an engineer&apos;s standard.  If that person has their code editor wired up so that every trailing white space comes ablaze in neon pink they&apos;re gonna have a bad time.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Keeping code pretty reflects directly on the programmer.  It shows if they care about what they write.  You&apos;re in this gig because you want to be and you care about what you do.  So you should do the same for every piece of code that you write.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Weekend Project: Bring The Salsa</title><link>https://hswolff.com/blog/weekend-project-bring-the-salsa/</link><guid isPermaLink="true">https://hswolff.com/blog/weekend-project-bring-the-salsa/</guid><pubDate>Mon, 08 Jul 2013 21:48:26 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s been many times I&apos;ve read of someone hacking together a project over a weekend.  Appropriately titled a &apos;weekend hack&apos; these projects have a finite beginning and end. And they&apos;ve always seemed out of reach for me to accomplish.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;However! thanks to this long weekend I was able to complete my own weekend hack! Granted this was a long weekend so I may have cheated a little bit, but nonetheless!  I was able to start and finish a project within the span of a weekend.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So what did I make?  A web app I&apos;ve named &amp;lt;a href=&quot;http://bringthesalsa.hswolff.com&quot;&amp;gt;Bring The Salsa&amp;lt;/a&amp;gt;!&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;(Here&apos;s the part of the post where I wait for the applause to die down before I can continue typing again.  You are thunderously applauding my accomplishment, aren&apos;t you!? ;))&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Bring The Salsa is a web app that was built to solve a pain point I&apos;ve often encountered when hosting a party at my apartment:  I want friends to bring things, however managing who is bringing what is always a manual bloated ordeal.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So Bring The Salsa aims to fix that. You can create your own list with a unique URL to share with friends, and freely edit what you need to bring, how many needs to be brought, and who is bringing what.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Enough with what it does, hopefully I made the app intuitive enough that you can figure it out yourself.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Technology Used&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Now for the tech details, you know, the stuff that truly matters ;).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The backend is graciously provided by &amp;lt;a href=&quot;https://www.firebase.com/&quot;&amp;gt;Firebase&amp;lt;/a&amp;gt; (graciously and freely - cuz it&apos;s in beta).  This cut my development time in half, allowing me to focus on the front end of the application and not worry about creating a node.js server with a database and an API and yadda yadda yadda.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This was my first time using a backend provided by a 3rd-party.  After I wrapped my head around the way data is stored in the DB I found using Firebase to be an absolute joy.  Out of the box it has 1st-class support for real-time updates, a wonderful side-effect that I was able to directly take advantage of in my app.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;As for the true star of this app, that is undoubtedly &amp;lt;a href=&quot;http://angularjs.org/&quot;&amp;gt;AngularJS&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Bring The Salsa is an AngularJS application from top to bottom.  This was my first time creating an application in AngularJS and I must admit: it was lovely.  My current client side MVC background is Backbone.js so I began using Angular.js with a couple of prejudices, however they were all washed away over the course of the weekend.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In case you want to see what an Angular.JS application looks like, and in particular this application, I&apos;ve open-sourced the code on GitHub and plan to continue development openly.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;a href=&quot;https://github.com/hswolff/bringthesalsa&quot;&amp;gt;Click here to see the open-source repository of Bring The Salsa&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I have a lot more to say about AngularJS.  So much more that I will be dedicating an entire post to talk about what I&apos;ve discovered about AngularJS over this long and lovely weekend.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Regret&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The only thing I regret about creating Bring The Salsa is that it would have been perfect had it existed before this weekend began.  Because truly, that is when it will come in handy the most: for weekends that you&apos;re hosting a party and need some organization.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;And above all else, when you do use this app, for heaven&apos;s sake, don&apos;t forget to bring the salsa.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Taming The Jungle: Working With New Code</title><link>https://hswolff.com/blog/taming-the-jungle/</link><guid isPermaLink="true">https://hswolff.com/blog/taming-the-jungle/</guid><pubDate>Thu, 27 Jun 2013 13:07:05 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;An undervalued skill of the common developer lies in their ability to navigate and explore a new code base.  Although not the most glamorous or fun task, it is the one that almost always consumes most of a developers working hours.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Despite the percentage of time this work consumes, it is a topic that is seldom discussed on the internet.  Reason for that is simple: it&apos;s not fun.  It&apos;s not fun understanding someone else&apos;s code, pondering why they arranged code the way they did, why names are named the way they are, and what performance enhancement drugs they were on.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;At every job I&apos;ve started I&apos;ve had to enter the jungle that is &quot;someone else&apos;s code&quot;. Along the way I&apos;ve come up with a few strategies to mitigate the pain. Some are obvious while others are even more obvious.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;And please: if you know of any other strategies to reduce the pain of learning a new code base I would love to hear it.  I&apos;m sure everyone reading this post will appreciate it as well.
&amp;lt;!--more--&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;How Is The Code Structured?&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;First thing I always ask when encountering a new codebase is, &apos;How is the code structured?&apos;  To elaborate: from the time a client makes a request to when the client&apos;s browser renders the web page: what is going on?&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Where is the entry point?  How is it funneled through the server side code?  Where is the client side code initiated?&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Where are the pertinent files in the directory structure?  Are there any weird gotchyas with callbacks executing critical code in a non-obvious way that without the callback nothing would ever render?&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;These are the questions I ask both myself and my new co-workers.  I try to get a grip on the code, understand the general &apos;lay of the land&apos; if you will.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This is the part of the process where I want a high-level view of &apos;what is going on?&apos;. The details of the process are distractions at this point: all I need is a working knowledge of all moving parts.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This process takes anywhere from a day to a week in my experience.  Usually I take around two days to get a general idea of how the code is structured and what it&apos;s comprised of.  At this point I have a naive understanding of the entire system, enough that I feel confident that I&apos;ll be able to make changes, which is the second thing I usually do.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;How can I change code and see the results of my work?&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In the great words of Yoda, &apos;Do or do not, there is no try.&apos;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There is no better way to learn something than by trying it out and actually doing what you are learning.  This is true for everything (everything!) including learning code.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;When I am given a small starting task at a new job I take an oblong approach: rather than attack it head on I reduce the task to the smallest unit of provable success.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;For example if I am tasked to add myself to the about page I&apos;d want to do two things:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Find the file that I think is the about page.&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Add the most obvious edit to make sure that a) I&apos;m editing the right file and b) that there is nothing else in-between editing the file and seeing that change reflected.  (My personal favorite edit is along the lines of &amp;lt;h1&amp;gt;Pandas Rock&amp;lt;/h1&amp;gt; appended to the &amp;lt;body&amp;gt; of the page.)&amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Rather than assume I am doing everything correct, I actually prove it to myself and avoid working on something that could very well be wrong.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The about page that I&apos;m editing may be an outdated one that is no longer used, however still exists in the repository and as such is often confused with the one used in production.  By simply testing to make sure I&apos;m in the right place, and doing the right thing, I save myself wasted dev cycles and frustration.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This process of orienting myself before making changes further cements my knowledge and understanding of the code base, and prevents me from getting lost.  By forcing myself to always breach the surface and take a gasp of air (i.e. seeing my changes reflected) I&apos;m able to take a dive into the code base to find what I need.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;As I&apos;m able to hold my breath longer (i.e. my knowledge of the codebase increases) my need to come up for air and double check I&apos;m in the right place decreases.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;What were the design ideas?&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;After my memory of the code base begins to solidify and coalesce I begin to ask more introspective questions.  I begin to wonder why things were done the way they were and what was the reasoning behind these decisions.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;These questions allow me to gain a deeper and more intimate understanding of the code and my co-workers.  Rather than assume an aspect of the code I find un-intuitive is the result of poor decision making I can ask to find out how it came into existence.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Perhaps as the project was developed requirements changed, causing a rush of modifications that resulted in the code that I had just assumed was the result of poor choice. I may have even taken my assumptions as far to assume the developer that came before me hated his own kind and wanted all those who came after him to suffer!  What a thought!&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Through understanding of the why I can at least appreciate and reconcile my differences with the code rather than begrudge it. Not only that I can find my co-workers dislikes and work together to fix our problems.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Another benefit of understanding the ideas behind the code is its ability to strengthen and deepen my knowledge.  While I may have wondered why some component had a certain name that was not representative of its usage, I may learn it once did what it is named to do and why it was changed.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Getting out of the jungle alive&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Every code base is unique.  Sure, there are overlaps that will make learning a new code base easier: if you use a framework (Ruby on Rails) or follow a common architecture (MVC).  However the spirit of the code lies in the details, and those are near impossible to clone.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So you must enter the jungle that is a new code base.  With or without trepidation, you must plunge in head first, without knowing what you&apos;ll find.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;And after some time you&apos;ll exit the jungle.  You&apos;ll come out wiping your hands free of dirt, turn around, and see a playground with a brand new swing set.  It&apos;s the same code base, but now you know what&apos;s inside, and you know the fun you can have.  Sure you may add some renovations (always need a vomit wheel), but that jungle will have been tamed.  And in taming the jungle, you&apos;ll now be free to build your own.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>Upgrading to Sublime Text 3</title><link>https://hswolff.com/blog/upgrading-to-sublime-text-3/</link><guid isPermaLink="true">https://hswolff.com/blog/upgrading-to-sublime-text-3/</guid><pubDate>Sat, 11 May 2013 22:15:29 GMT</pubDate><content:encoded>&lt;p&gt;When Sublime Text 3 was released I groaned along with many others. Why a new version? What are the incompatibilities? But most importantly: Will all my old packages that I know and love still work??&lt;/p&gt;
&lt;p&gt;After attempting (and succeeding) in upgrading to ST3 and trying to &amp;lt;a href=&quot;http://blog.harrywolff.com/my-favorite-sublime-text-2-plugins-aka-packages/&quot;&amp;gt;install all my old plugins&amp;lt;/a&amp;gt; I know, love, and use daily I can safely say: the old packages work! They work! And it&apos;s glorious!&lt;/p&gt;
&lt;p&gt;There is a but here: the process of installing some plug-ins is not as plug and play as it is for Sublime Text 2. There is a certain amount of &apos;getting your hands dirty&apos; work required - namely using git to check out the ST3 compatible branch. Aside from that you&apos;ll leave the process without any stains on your newly washed white shirt.&lt;/p&gt;
&lt;p&gt;So let&apos;s dive in, shall we?&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Installing Sublime Text 3&amp;lt;/h2&amp;gt;
You&apos;re a responsible developer right? You&apos;ve paid for Sublime Text 2 already right? Supporting a brethren developer&apos;s hard work, putting food on his table, a new Retina MacBook Pro in his lap?&lt;/p&gt;
&lt;p&gt;You have? Good. Cuz that&apos;s all that&apos;s required to download ST3: an active and valid ST2 license.&lt;/p&gt;
&lt;p&gt;After that&apos;s all squared away head over to the &amp;lt;a href=&quot;http://www.sublimetext.com/3&quot;&amp;gt;Sublime Text 3&amp;lt;/a&amp;gt; download page and commence with the installation.&lt;/p&gt;
&lt;p&gt;Tip: You can install ST3 alongside ST2 without any modifications to either program. Each install to separate application names and &apos;Application Support&apos; directories without needing any user intervention. Interestingly enough the application name for ST3 is &apos;Sublime Text&apos;. Seems Jon Skinner&apos;s gone back in time with this change.&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Install Package Control (for ST3)&amp;lt;/h2&amp;gt;
Ready to get down and dirty with git? Of course you are.&lt;/p&gt;
&lt;p&gt;The Package Control website plainly instructs &amp;lt;a href=&quot;http://wbond.net/sublime_packages/package_control/installation#ST3&quot;&amp;gt;how to install Package Control for Sublime Text 3&amp;lt;/a&amp;gt;.&lt;/p&gt;
&lt;p&gt;I could regurgitate those instructions here but I&apos;d rather not muddy the internet with cloned instruction sets. If you have any issues with this part feel free to &amp;lt;a href=&quot;https://twitter.com/hswolff&quot;&amp;gt;ping me&amp;lt;/a&amp;gt;.&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Using Package Control to install packages&amp;lt;/h2&amp;gt;
For most packages I was able to use Package Control without any issue.&lt;/p&gt;
&lt;p&gt;The packages I have currently installed and working brilliantly are:&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;CoffeeCompile&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;CoffeeScript&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Emmet&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;GitGutter&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;GitHubinator&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;LESS&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;SideBarEnhancements&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;sublime-closure-linter&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
However there were two packages I do use daily that I didn&apos;t want to lose that did require a bit more manual labor.
&amp;lt;h2&amp;gt;Installing SublimeLinter for ST3&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;em&amp;gt;Update: SublimeLinter has been updated to natively support Sublime Text 3. You can now easily install SublimeLinter straight from Package Control. Yay!&amp;lt;/em&amp;gt;&lt;/p&gt;
&lt;p&gt;Ready for some more git wizardry?&lt;/p&gt;
&lt;p&gt;Follow these four simple steps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd ~/Library/Application Support/Sublime Text 3/Packages
git clone https://github.com/SublimeLinter/SublimeLinter.git
cd SublimeLinter
git checkout sublime-text-3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Yey fun, you&apos;re done!&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Installing Soda Theme for ST3&amp;lt;/h2&amp;gt;
Ready for some intense deja vu?&lt;/p&gt;
&lt;p&gt;Follow these four simple steps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd ~/Library/Application Support/Sublime Text 3/Packages
git clone https://github.com/buymeasoda/soda-theme/ &apos;Theme - Soda&apos;
cd &apos;Theme - Soda&apos;
git checkout soda-st3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Yey fun, you&apos;re mostly done!&lt;/p&gt;
&lt;p&gt;If you want to use the &amp;lt;a href=&quot;https://github.com/buymeasoda/soda-theme/#syntax-highlighting-colour-schemes&quot;&amp;gt;Soda Theme Color Schemes&amp;lt;/a&amp;gt; follow the steps outlined exactly - just put them in your ST3 folder instead.&lt;/p&gt;
&lt;p&gt;Et voilà Finito!&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;
I&apos;m finding Sublime Text 3 to be a lot faster than ST2. Perhaps my (now old) install of ST2 has become bogged down with crap that it doesn&apos;t need, but in switching to ST3 I&apos;ve found its fuzzy search to be leaps faster and I&apos;m finding it&apos;s new fast open of files to be an interesting UX update (when you select a file in the project browser it now opens up a temporary tab instead of previously just showing the text in the code window. Hope that made sense).&lt;/p&gt;
&lt;p&gt;Aside from speed ST3 is the future of ST2 and it&apos;s better to get on the bus as it&apos;s going through the station and before it&apos;s out in the country somewhere remote and unattainable. This metaphor went nowhere.&lt;/p&gt;
&lt;p&gt;Looking forward to hearing your successes in upgrading to ST3. I also can&apos;t wait for the whole package community to fully embrace ST3 support. Should happy any day now, right? ;)&lt;/p&gt;
</content:encoded></item><item><title>My First App: Jot</title><link>https://hswolff.com/blog/my-first-app-jot/</link><guid isPermaLink="true">https://hswolff.com/blog/my-first-app-jot/</guid><pubDate>Mon, 11 Feb 2013 09:00:47 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;In the middle of last year I began playing around with iOS development. I&apos;ve long been curious about Objective-C and Cocoa Touch, trying tutorials and reading documentation on and off for a few years. Every so often I&apos;d begin work on an application only to have it end in frustration: either I didn&apos;t enjoy what I was working on or more commonly the learning curve proved too steep.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;However last year when I began working on another application a funny thing happened: I finished it. My first commit was on May 10th and seven months later to the day, I released it to the app store. It is with tremendous pride that I present to you&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://harrywolff.com/jot/&quot;&amp;gt; Jot. The fastest way to write on your iPhone.&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div style=&quot;clear:both&quot;&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Currently it sits at version 1.2.0. I waited until now to write about it to make sure all initial bugs were worked out before you got your hands on it.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I have a full pipe-line of features planned that I&apos;m anxious to develop and release. The two I&apos;m most excited about are: 1) the ability to customize the editor&apos;s appearance and 2) synching of Jots via Dropbox. The latter should prove most interesting as it involves networking which will be fun to learn about.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;One of the more crucial elements that enabled me to create this application was the wonderful book, &amp;lt;a href=&quot;http://www.bignerdranch.com/book/ios_programming_the_big_nerd_ranch_guide_rd_edition_&quot;&amp;gt;iOS Programming: The Big Nerd Ranch Guide&amp;lt;/a&amp;gt;. Without this book the uphill battle to understanding how and why Cocoa Touch works would have been much steeper. If you are at all interested in developing your own iOS App I strongly recommend this book. It&apos;s wonderful.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I&apos;d also like to thank all my friends and family for supporting me along the way. Without their help I would still be in development of Jot, continuously tinkering away into oblivion. Also a special thank you to everyone who helped me debug my beta builds. It meant heaps, thank you.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;It was a long journey to releasing Jot in the App Store, however the sense of accomplishment I felt when it was released was awesome. To everyone thinking about or working on their first app: keep at it and don&apos;t stop. You&apos;ll get it done.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>My Top 10 Albums Released in 2012</title><link>https://hswolff.com/blog/my-top-10-albums-released-in-2012/</link><guid isPermaLink="true">https://hswolff.com/blog/my-top-10-albums-released-in-2012/</guid><pubDate>Sat, 05 Jan 2013 17:06:57 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;When I first sat down to map out what my top albums of 2012 were I drew a blank. Looking blindly back at the year of music I couldn&apos;t easily recall any knock-out releases. I was stumped and confused - could the past year of album releases been as boring as my memory is awful? Happily the answer is no - however I do not have high hopes for my memory.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;When I started pouring through what albums did come out this past year I was appalled at myself for not remembering any of them. I suppose I shouldn&apos;t be so harsh on myself. By my count the year 2012 was an odd year for music. Most of the releases I was looking forward to were follow-ups to their previous break-out successes: The Xx, Dirty Projectors, Sleigh Bells, Two Door Cinema Club, and Passion Pit. Most of their 2012 releases did not meet my high expectations, leaving me somewhat crushed and discouraged.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Yet there were so many new artists that entered the scene in 2012 and their efforts were marvelous. One is already a classic by many accounts. These new artists shaped the year 2012 in ways that could not have been predicted and I am grateful for that. It is always a relief to hear something new. 2012 provided that amply.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Before I get into my top 10 albums of 2012 I&apos;d like to list a few Honorable Mentions. These are the albums that did not break into my top 10 albums of 2012 however they were very close.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Honorable Mentions&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Benjamin Gibbard, &amp;lt;em&amp;gt;Former Lives&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Capital Cities, &amp;lt;em&amp;gt;Safe and Sound EP&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Django Django, &amp;lt;em&amp;gt;Django Django&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Fiona Apple, &amp;lt;em&amp;gt;The Idler Wheel…&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Four Tet, &amp;lt;em&amp;gt;Pink&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;The Maccabees, &amp;lt;em&amp;gt;Given To The Wild&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Pinback, &amp;lt;em&amp;gt;Information Retrieved&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;POP ETC, &amp;lt;em&amp;gt;POP ETC&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;The Tallest Man on Earth, &amp;lt;em&amp;gt;There&apos;s No Leaving Now&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;The Xx, &amp;lt;em&amp;gt;Coexist&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;And now without further ado, my top albums of 2012.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;My Top 10 Albums of 2012&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;10. A Silent Film, &amp;lt;em&amp;gt;Sand &amp;amp; Snow&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/a-silent-film_sand-and-snow-150x150.jpg&quot; alt=&quot;a-silent-film_sand-and-snow&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2525&quot; /&amp;gt; Every bit a pop album, this album contains one of my favorite songs from 2012, &amp;lt;em&amp;gt;Danny, Dakota &amp;amp; the Wishing Well&amp;lt;/em&amp;gt;. Wonderfully catchy and light-hearted I find myself throwing this album on whenever I want to just relax and enjoy some clear-headed pop. Clearly influenced by Coldplay and other modern pop acts, A Silent Film stands tall thanks to their solid production and well written lyrics.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;9. The Shins, &amp;lt;em&amp;gt;Port of Morrow&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/The_Shins_-&lt;em&gt;Port_of_Morrow-150x150.jpg&quot; alt=&quot;The_Shins&lt;/em&gt;-_Port_of_Morrow&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2526&quot; /&amp;gt; It&apos;s been five years since the previous Shins album. Five years is a long time, especially in the music industry. However I think those five years served The Shins well. &amp;lt;em&amp;gt;Port of Morrow&amp;lt;/em&amp;gt; felt like a coming home party, returning to the sound of earlier Shins records. A welcome addition to their catalog and the sounds of 2012.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;8. The Walkmen, &amp;lt;em&amp;gt;Heaven&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/Thewalkmen_heaven-150x150.jpg&quot; alt=&quot;Thewalkmen_heaven&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2527&quot; /&amp;gt; The Walkmen are getting old. That&apos;s what this album told me. Their sound is softer, calmer. It&apos;s serene by Walkmen standards, erring on the side of serenity as opposed to chaos. It was not a surprise to hear this side of The Walkmen as their previous albums have been consistently leaning this way, however I think it is on &amp;lt;em&amp;gt;Heaven&amp;lt;/em&amp;gt; that they found the musical sound they have been searching for.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;7. Grizzly Bear, &amp;lt;em&amp;gt;Shields&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/GrizzlyBearShields-150x150.jpg&quot; alt=&quot;GrizzlyBearShields&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2528&quot; /&amp;gt; &amp;lt;em&amp;gt;Shields&amp;lt;/em&amp;gt; safely and confidently continues Grizzly Bear&apos;s string of successful albums. This album is more polished and accessible than their previous efforts however the core sound of Grizzly Bear remains strong and alive. As a fan of Grizzly Bear I was not disappointed and was overjoyed to listen to this album on repeat for weeks.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;6. Solange, &amp;lt;em&amp;gt;True&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/solangetrue-150x150.jpg&quot; alt=&quot;solangetrue&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2529&quot; /&amp;gt; Introduced to me late in 2012 Solange&apos;s second album is an unapologetic pop album that will have you dancing. Appropriately and accurately comparable to an old Madonna record, this album draws from the sounds of R&amp;amp;B to create songs that will have you bopping along as it sings to your heart.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;If anything else I urge you to listen to &amp;lt;em&amp;gt;Losing You&amp;lt;/em&amp;gt;, the first track off the album. And once you&apos;ve finished your fifth listen go watch the video and dance along with Solange.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;5. Divine Fits, &amp;lt;em&amp;gt;A Thing Called Divine Fits&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/divine-fits-150x150.jpg&quot; alt=&quot;divine-fits&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2530&quot; /&amp;gt; This album almost snuck under my radar. A side project of the lead singer of Spoon and band members of Wolf Parade this album reminded me how great Spoon is, how much I want a new Spoon album, and what a great rock album sounds like.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I would not have thought to mix the sounds of Spoon and Wolf Parade however Divine Fits is living proof that the result is wonderful. Combining the pop of a Spoon song with the growl of Wolf Parade has resulted in an album of tracks that delighted the alternative rocker in me. I don&apos;t expect to ever hear a Divine Fits song on FM Radio however I do expect and have already witnessed it played to wonderful effect on XM.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;4. Kendrick Lamar, &amp;lt;em&amp;gt;good kid, m.A.A.d city&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/KendrickGKMC-150x150.jpg&quot; alt=&quot;KendrickGKMC&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2531&quot; /&amp;gt; I don&apos;t know how I found out about Kendrick Lamar. However his album quickly shot to the top of my list. A solid rap album with a swagger that I had been missing all year.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The production on each track matches the snarl of the M.C., propelling each track forward, getting you to bob along no matter what you&apos;re doing.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I feel required to mention the wondrous track that is &amp;lt;em&amp;gt;Bitch, Don&apos;t Kill My Vibe&amp;lt;/em&amp;gt;. Title aside this track is awesome. It is quite appropriate that the title mentions vibe as this track is overflowing with it. No matter where I am, when I listen to this track you can see me vibing right along with it.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;3. Father John Misty, &amp;lt;em&amp;gt;Fear Fun&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/Fearfunfatherjohnmisty-150x150.jpg&quot; alt=&quot;Fearfunfatherjohnmisty&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2532&quot; /&amp;gt; J. Tillman (aka Father John Misty) used to be the drummer of Fleet Foxes. He left Fleet Foxes last year to pursue his own musical career and since then I have been waiting to listen to what he would release. It wasn&apos;t so much my faith in Tillman that perked my attention but more so my love of Fleet Foxes.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;With the release of &amp;lt;em&amp;gt;Fear Fun&amp;lt;/em&amp;gt; I was not disappointed. It&apos;s a wonderful folk album that rollicks along its path, retaining many elements of a Fleet Foxes album while expanding to flesh out what a Father John Misty album sounds like.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The songs are not complex however that is what lends each to being so catchy. The lyrics are alive and sound joyful even when dwelling on death. You can practically hear Father John Misty&apos;s beard through each track, a hallmark of many a great folk musician.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;2. alt-J (∆), &amp;lt;em&amp;gt;An Awesome Wave&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/Alt-J_-&lt;em&gt;An_Awesome_Wave-150x150.png&quot; alt=&quot;Alt-J&lt;/em&gt;-_An_Awesome_Wave&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;alignleft size-thumbnail wp-image-2533&quot; /&amp;gt; Until the &amp;lt;a href=&quot;http://www.mercuryprize.com/aoty/shortlist.php&quot;&amp;gt;Mercury Prize&amp;lt;/a&amp;gt; announced this album as the winner I had no idea this band existed. I&apos;m glad I decided to check them out because their album is a marvelous breath of fresh air.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The vocalist that sings on each song has a very unusual voice. He half mumbles and sings each song, giving alt-J a highly unique sound that makes all of their songs instantly recognizable.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Although the band is decidedly Rock they pull in fringe sounds of folk, pop, and alternative that add up to a wonderful sum that give alt-J its distinctive flair and voice. A powerful album and a great band.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h3&amp;gt;1. Frank Ocean, &amp;lt;em&amp;gt;channel ORANGE&amp;lt;/em&amp;gt;&amp;lt;/h3&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;/images/posts/2013/01/Channel_ORANGE-150x150.jpg&quot; alt=&quot;Channel_ORANGE&quot; width=&quot;220&quot; height=&quot;220&quot; class=&quot;alignleft size-full wp-image-2534&quot; /&amp;gt; When this album was first released I ignored it. I didn&apos;t know who this Frank Ocean guy was nor why I should care about him. I&apos;d like to go back in time to smack my former ignorant self.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Frank Ocean&apos;s debut album instantly became a classic. There isn&apos;t one track on the album worse than a 6, with multiple tracks perfect 10/10s.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Not only did Frank Ocean write, sing, and rap on all the tracks he also produced most (perhaps all?) of them as well.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The production on every track is luscious and full bodied with vocals expertly blended. The lyrics on &amp;lt;em&amp;gt;Sweet Life&amp;lt;/em&amp;gt; and &amp;lt;em&amp;gt;Super Rich Kids&amp;lt;/em&amp;gt; are beautiful works of poetry and no matter how hard I tried I was unable to play any of the songs to death.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s a high level of dedication clearly visible throughout &amp;lt;em&amp;gt;channel ORANGE&amp;lt;/em&amp;gt;, making it the top album of 2012 without any doubt.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>GetGlue&apos;s Front End Stack</title><link>https://hswolff.com/blog/getglues-front-end-stack/</link><guid isPermaLink="true">https://hswolff.com/blog/getglues-front-end-stack/</guid><pubDate>Sun, 25 Nov 2012 11:53:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;Earlier this year &amp;lt;a href=&quot;http://getglue.com/&quot;&amp;gt;GetGlue&amp;lt;/a&amp;gt; began work on the new GetGlue website.  It was a chance for a clean engineering slate, allowing us to put all our knowledge together to begin a new project on strong footing.  It was a chance to use all of the most powerful client-side technologies to allow us to work efficiently and quickly.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Our old front-end stack consisted of a PHP backend that rendered XML documents with XSLT.  We used vanilla CSS to style our pages and plain JavaScript to add sugar to the UI.  We relied on jQuery for DOM manipulation and various jQuery plugins to increase the usability of the site.  We optimized our JavaScript files for deployment via our own concatenation and optimization script and served it as one canonical file.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The new GetGlue website is taking advantage of many new powerful front end tools.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The tl;dr list of tools:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://coffeescript.org/&quot;&amp;gt;CoffeeScript&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://sass-lang.com/&quot;&amp;gt;SASS&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://compass-style.org/&quot;&amp;gt;Compass&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://jquery.com/&quot;&amp;gt;jQuery&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://backbonejs.org/&quot;&amp;gt;Backbone.js&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://underscorejs.org/&quot;&amp;gt;Underscore.js&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;https://github.com/janl/mustache.js&quot;&amp;gt;Mustache.js&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;http://requirejs.org/&quot;&amp;gt;RequireJS&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;!--more--&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Preprocessors:  CoffeeScript and SASS&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Before any code was written we made the decision to use preprocessors as part of our tool-chain.  Specifically we decided to use CoffeeScript and SASS to code and style the new GetGlue website.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;CoffeeScript has enabled us to develop features at a break-neck pace.  It strips away a great deal of the boilerplate code that exists in JavaScript.  For example when referencing a property on a JavaScript object:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;view = response.items[0].title
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;d be instances when the items array would be empty.  With JavaScript we would have to verify its existence via:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;if (response.items &amp;amp;&amp;amp; response.items != null) {
view = response.items[0].title
}
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The CoffeeScript equivalent to the above code involves just one additional character:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;view = response.items?[0].title
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This is one reason we have found CoffeeScript to be incredibly powerful, enabling us to be twice as productive.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;SASS has also allowed us to code efficiently and quickly. We are making great use of SASS’a nested selectors as well as mixins. Those two features alone have made coding CSS a joy again and not a pain. Through mixins we can keep our CSS more DRY-compliant, and with variables it is a breeze to update color configurations.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In addition to SASS we are using Compass. We have found Compass to be a great utility belt of common SASS mixins we would have otherwise made ourselves.  Rather than having to manually type every vendor prefix we leverage a Compass mixin to automate the process. For example:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;@include border-radius(4px)
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Compiles to&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;-webkit-border-radius: 4px
-moz-border-radius: 4px
-o-border-radius: 4px
border-radius: 4px
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;We get to save time and sanity. It&apos;s a wonderful addition to our toolkit.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Libraries&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;At GetGlue we also take advantage of a number of JavaScript libraries.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;It almost goes without saying that we use jQuery for a whole slew of things. DOM selection, manipulation, and everything in between.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;More exciting however is our great use of Underscore.js and Backbone.js.  Our entire front-end UI has been built with Backbone Views, Models, Collections, and Routers.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Each page of GetGlue is comprised of one general &amp;lt;code&amp;gt;PageView&amp;lt;/code&amp;gt; which in turn contains multiple sub-views (and usually those sub-views have sub-views - turtles all the way down).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;All of our data is represented in Backbone Models and Collections with our views bound to change events to re-render themselves.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;And naturally we employ underscore.js’ functions to make common tasks more enjoyable to perform. Varying from _.map to _.throttle - it makes our coding lives an absolute joy.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Mustache&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Currently GetGlue is rendered  entirely client-side and because of that we make extensive use of Mustache templates.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;We&apos;ve found the (mostly) logic-less Mustache templates  easy to work with and they are a cornerstone of our new website. Without any templates we&apos;d have nothing to render and there&apos;d be no website for you to see.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;By keeping (most) of the view&apos;s logic out of the template we&apos;re able to focus on just the structure of the view and not have to worry about anything else.  This allows for fear-less template refactors as nothing else is affected.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;RequireJS&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;When developing a large JavaScript application it can become hard to keep track and manage all the moving pieces that are required to make the application run.  To that end we have turned to RequireJS as our module loader and build tool.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Each discrete section of code  lies in its own JavaScript file, attached to its own namespace, and only included by another file when explicitly requested. By adhering to these strict rules we avoid unexpected behavior and can code with confidence.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Having code for one specific functionality in its own JavaScript file makes for great organizational clarity and lends a certain amount of intuition to our code base: by that I mean when file B is a subclass of file A the file structure mimics that behavior.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;For example on GetGlue when you open an item from the Guide you open what we internally refer to as a Card. Each of those types of popovers are derivatives of a Card. In our file tree we have the &amp;lt;code&amp;gt;card.coffee&amp;lt;/code&amp;gt; base class and in the directory &amp;lt;code&amp;gt;cards/&amp;lt;/code&amp;gt; lay all of the card subclasses.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This intuitive structure makes not only for development delight but also allows for easy on boarding of new hires as the system is easy to understand.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;We also use RequireJS as our primary build tool for our JavaScript and SASS.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The way you include JavaScript files into other modules is through RequireJS’ require() function. As part of its build process RequireJS traces all require() calls and inlines them into one JavaScript file that we then serve to the browser. (Note: RequireJS allows for other build configurations).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;RequireJS will also take all CSS import statements and inline them into a single CSS file.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;By the end of the build process we’ve slimmed our JS and CSS files to one a piece making for a quick download by the client and a speedy experience.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Conclusion&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;We’re very proud of what we&apos;ve accomplished with the new GetGlue website.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;By switching to CoffeeScript and SASS we were able to develop quickly and efficiently.  We were able to create features and tweak them without much effort.  It made the entire development experience much more enjoyable.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Giving our site some Backbone.js made UI transition and state management easier than ever before. I will never again dip my hand into the DOM to find state. Thar be dragons.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;RequireJS is a beautiful tool that I wish I had known about years ago.  Its module management is intuitive and its build tool is very powerful.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;We&apos;ve had a great time building the new GetGlue website. We hope you enjoy it as much as we do.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>What I Install After A Fresh OS Installation</title><link>https://hswolff.com/blog/what-i-install-after-a-fresh-os-installation/</link><guid isPermaLink="true">https://hswolff.com/blog/what-i-install-after-a-fresh-os-installation/</guid><pubDate>Wed, 12 Sep 2012 09:26:43 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;I received a great gift from work last week.  It came in the form of a rectangle, and fit in the palm of my hand.  It has made my life easier and more enjoyable.  In fact it has single handedly changed the way I approach most things throughout my day.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;What is it?&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;A brand new SSD hard drive.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I&apos;ve never witnessed the power of a SSD drive first hand.  I&apos;ve used friend&apos;s computers that had a SSD drive, but never before has my own computer been running an SSD drive.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Let me tell you:  it&apos;s glorious.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I decided that during the installation of the SSD I would also install a fresh copy of OS X (as opposed to a Time Machine restore).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I figured it&apos;d be fun to log the steps I took after installing Mountain Lion. They&apos;re fraught with monotony but one that every user must go through when setting up their machine after a fresh install.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So what follows is my Post Mountain Lion install log. I did exactly what I expected: install my favorite applications and set up my system presences. Only surprises were the settings I forgot I had ever changed in the first place.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Without further ado!  The list!&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;!--more--&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Day 1&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Finished installing Mountain Lion&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Opened App Store&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Installed iA Writer to write these notes&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Updated ML to 10.8.1 (Rebooted)&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Went through App Store previous purchases and installed old apps:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Twitter&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Sparrow&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;The Unarchiver&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Xcode&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Went to System Preferences &amp;gt; Trackpad&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Turned on &apos;Tap to click&apos;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Opened Safari, Downloaded:&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Google Chrome&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Skype&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Dropbox for Mountain Lion&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Installed Chrome and logged in to download my cloud synched bookmarks&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install and setup Skype&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Went through System Preferences, customized to my liking&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Turned off Gatekeeper&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Added twitter account&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Xcode finished installing&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;opened to install remaining SDKs and Sims&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Downloaded and installed Sublime Text 2&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Copied old Music onto hard drive / restored iTunes&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Set up Dropbox and download old files&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Customize Terminal&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Duplicated Pro theme&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Made font size 13px&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Customize Sparrow&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Add back signature to accounts&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Turn off message preview&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Customize Finder&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;New finder window shows: user root&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Customize what folders show on left side&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Change search preferences to keep last settings&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install Cloudapp&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install MAMP&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install VirtualHostX&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Set up virtual hosts&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install Git&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Set up git&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Set username, email&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Copy over old .gitconfig to new install&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install oh my zsh&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Use my theme&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Install plugins&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install command line Sublime Text 2&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Set up SSH Key for Github&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Set up RVM&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Install Compass&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install node.js&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;CoffeeScript&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;RequireJS&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Update Python to latest&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;setuptools&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;pip&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;fabric&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install nvALT&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install Aperture&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Set up Sublime Text 2&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Copied over old packages&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Day 2&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Installed Printer&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Sys Pref -&amp;gt; Accessibility -&amp;gt; Use scroll modifier keys to zoom&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install Phonegap 2.0&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Day 3&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;VLC&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Transmit&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;Reinstalled Favorites&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Sketch&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Pixelmator&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Restore MAMP DBs&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Install Last.fm&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h1&amp;gt;Afterward&amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There isn&apos;t much left say.  After the first three days of ferocious software installation and customization I was pretty much done and comfortable with my current computer setup.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There were a few things I did forget to copy from my old hard drive that proved to be a bit of a nuisance.  I forgot to backup my Transmit favorites and had to prowl through my old hard drive to find where those files were saved.  I also forgot to backup my Apple Developer keychains which I ended up just re-creating.  Next time I&apos;ll just back them up safe and sound.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The speed of the SSD drive made installing all my old programs so fast that the once laborious process of setting up my computer from scratch went by in a blink.  Tasks that used to require patience as my HDD read and wrote bytes were done before I was even ready for the next task.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s no turning back for me now.  I have seen the glory of SSD.  My future has been written.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>My Favorite Sublime Text 2 Plugins aka Packages</title><link>https://hswolff.com/blog/my-favorite-sublime-text-2-plugins-aka-packages/</link><guid isPermaLink="true">https://hswolff.com/blog/my-favorite-sublime-text-2-plugins-aka-packages/</guid><pubDate>Thu, 26 Jul 2012 08:14:01 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;The current code editor that is widely in vogue amongst programmers is far and above Sublime Text 2. There&apos;s many reasons that ST2 usurped this crown previously held by TextMate (it&apos;s new and actively maintained) but one of the biggest reasons is its ability to have its core functionality extended via plugins.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The plugins that you can install for ST2 make this otherwise light weight text editor all that much more powerful and effective - but only in the areas you care about.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I&apos;ve grown particularly attached to a couple of ST2 plugins. Ones that I know that if I hadn&apos;t found them my love for ST2 wouldn&apos;t be as strong as it currently is.
&amp;lt;!--more--&amp;gt;
So in a very particular order what follows are my favorite and most appreciated plugins for Sublime Text 2 that I use on a daily basis.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt;  It is of tremendous help to know of one keyboard shortcut for ST2 that lets you easily access the majority of the following plug-ins:  &amp;lt;code&amp;gt;Cmd+Shift+P&amp;lt;/code&amp;gt;.  Hit that keyboard shortcut and you&apos;ll see the Command Palette at the top of your ST2, in which you can take advantage of ST2&apos;s fuzzy search to find the particular feature you want to use.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;a href=&quot;/images/posts/2012/07/st2_command_palette.png&quot; rel=&quot;attachment wp-att-2433 lightbox[st2]&quot;&amp;gt;&amp;lt;img src=&quot;/images/posts/2012/07/st2_command_palette-300x193.png&quot; alt=&quot;&quot; title=&quot;st2_command_palette&quot; width=&quot;300&quot; height=&quot;193&quot; class=&quot;aligncenter size-medium wp-image-2433&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://wbond.net/sublime_packages/package_control&quot;&amp;gt;Package Control&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Without this plugin your entire ST2 plug-in experience will be dismal.  I say this with all sincerity and seriousness: Package Control makes packages fun and easy to use.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Basically Package Control connects to a remote server that holds a large public list of published packages for ST2.  It can then download any of those plug-ins and install them directly into your copy of ST2 without ever moving your mouse.  It&apos;s a wonderful experience, one I feel that should have have been included by default in ST2.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Open Command Palette (Cmd+Shift+P)&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Type &apos;pa in&apos; - you should see &apos;Package Control - Install Package&apos; highlighted at the top.&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Type &apos;SublimeLinter&apos;, hit enter and voila!  SublimeLinter is now installed!&amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/SublimeLinter/SublimeLinter&quot;&amp;gt;SublimeLinter&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;SublimeLinter was one of those packages that I originally thought it&apos;d be neat to have but I wouldn&apos;t really need. I couldn&apos;t have been more wrong.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;SublimeLinter has quickly shot to the top of my list of must have packages, becoming an integral part of my productivity suite.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;After installing SublimeLinter you will be linting your code as you type. This means that you can not only see what syntax errors you might be creating but you can also catch code style issues (Python’s PEP8 I&apos;m looking at you).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The ability to lint your code as you type has helped me catch countless careless mistakes. Let&apos;s say I forgot to include a closing parenthesis. Rather than executing my code only to find an error I&apos;m able to see the error as I write it and correct it right then and there. This saves me time, stress, and grief.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Another area that I&apos;ve found SublimeLinter to be of great help is when learning a new language. Think of SublimeLinter as a bowling lane with the bumpers put in. It helps keep you between the lines of the language, nudging you toward real code when you start to veer to the edges.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Create a JavaScript file and type in a simple if statement. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Don&apos;t put the if statement in parenthesis.&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;See the live linting do it&apos;s magic. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Profit. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;a href=&quot;/images/posts/2012/07/sublimelinter.png&quot; rel=&quot;attachment wp-att-2439 lightbox[st2]&quot;&amp;gt;&amp;lt;img src=&quot;/images/posts/2012/07/sublimelinter-300x140.png&quot; alt=&quot;&quot; title=&quot;sublimelinter&quot; width=&quot;300&quot; height=&quot;140&quot; class=&quot;aligncenter size-medium wp-image-2439&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/titoBouzout/SideBarEnhancements&quot;&amp;gt;SideBarEnhancements&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I&apos;m not entirely sure why this plugin isn&apos;t included by  default. It gives you a wealth of options when right clicking files in ST2’s sidebar.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;You can delete a file, duplicate it, and any other file operations you can think of.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I use this plugin all the time when creating a new JS file or CSS file. Before I&apos;d have to open up Terminal or Finder to do any simple file system manipulation. This plugin saves me that time and distraction away from ST2.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Open a saved file in ST2. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Right click on the file. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Behold the multitude of options now at your fingertips. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;a href=&quot;/images/posts/2012/07/sidebarenhancements.png&quot; rel=&quot;attachment wp-att-2438 lightbox[st2]&quot;&amp;gt;&amp;lt;img src=&quot;/images/posts/2012/07/sidebarenhancements-218x300.png&quot; alt=&quot;&quot; title=&quot;sidebarenhancements&quot; width=&quot;218&quot; height=&quot;300&quot; class=&quot;aligncenter size-medium wp-image-2438&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/ehamiter/ST2-GitHubinator&quot;&amp;gt;GitHubinator&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This is such a simple lovely plugin.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Basically if you&apos;re working on a project whose repo is also on GitHub you can quickly open the GitHub page of that file through a keyboard shortcut.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I use this all the time at work to easily link a co-worker to a line of code that I might need help with.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Again it&apos;s the time this plugin saves me that makes it so valuable. It&apos;s not hard to open GitHub and navigate to the file, however it&apos;s something that can be automated and that&apos;s what this plugin does.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Open a local repo that is on GitHub. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Go to any random file and line. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Either hit Cmd+\ or right click on the document and hit ’Githubinator’ to see the plugin in action. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Find yourself on the GitHub page of that file. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/kemayo/sublime-text-2-git&quot;&amp;gt;Git&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;This plugin brings the power of the Git command line to ST2.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;You can run git status through the Command Palette and ST2 will open a new file tab to show you the results.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Or you can git log. Or a git blame. Honestly that&apos;s how I use this plugin the most. To run a quick git blame to see which one of my co-workers I can ping for help on a line of code they wrote.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Open a file in a local git repository. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Open the Command Palette (Cmd+Shift+P). &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Type ’git blame’ and hit enter. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;A new ST2 tab will open with the git blame output. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;a href=&quot;/images/posts/2012/07/git-blame.png&quot; rel=&quot;attachment wp-att-2437 lightbox[st2]&quot;&amp;gt;&amp;lt;img src=&quot;/images/posts/2012/07/git-blame-300x167.png&quot; alt=&quot;&quot; title=&quot;git-blame&quot; width=&quot;300&quot; height=&quot;167&quot; class=&quot;aligncenter size-medium wp-image-2437&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/sublimator/ZenCoding&quot;&amp;gt;ZenCoding&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I was curious about the excitement around ZenCoding for a while. It wasn&apos;t till installing the ST2 package and playing around with it that I become a complete convert to the ZenCoding way of life.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;ZenCoding makes scaffolding new layouts a complete breeze by taking your shorthand DOM structure and expanding it to full HTML tags.  Rather than having to monotonously type ever closing tag for every new &amp;lt;code&amp;gt;&amp;lt;div/&amp;gt;&amp;lt;/code&amp;gt;  ZenCoding takes care of that for me, expanding and creating the tags it knows I want to use.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;ZenCoding saves times, and for me that&apos;s what makes it so valuable.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Open a new file. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Type: &amp;lt;code&amp;gt;table&amp;gt;(tr&amp;gt;td*2)*3&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Hit tab. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://xavura.github.com/CoffeeScript-Sublime-Plugin&quot;&amp;gt;CoffeeScript&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I&apos;ve recently become a big fan of CoffeeScript.  Unfortunately ST2 doesn&apos;t ship with language support for CoffeeScript file.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Fortunately there&apos;s a plugin that gives ST2 CoffeeScript syntax support.  And thank goodness it does because I would not enjoy writing CS without proper syntax highlighting.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Open a CoffeeScript file. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;See how wonderfully highlighted the file is. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/buymeasoda/soda-theme/&quot;&amp;gt;Theme - Soda&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Theme - Soda isn&apos;t really a plugin per se, however it is installed like one.  Don&apos;t get me wrong, the default theme of ST2 isn&apos;t painful to look at, however I have found this theme to be more joyful to use while I&apos;m coding throughout the day.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;There&apos;s a light and dark theme, so depending on your preference there&apos;s a Soda theme that&apos;s right for you.  Also be sure to find your favorite color scheme to match, or you can just &amp;lt;a href=&quot;https://github.com/buymeasoda/soda-theme/#bonus-options&quot;&amp;gt;use the one Soda uses&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;strong&amp;gt;Quick Demo of Awesomeness&amp;lt;/strong&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;ol&amp;gt;
&amp;lt;li&amp;gt;Activate the Soda Theme. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Close and reopen ST2. &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Enjoy the new prettiness. &amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Wrap Up&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So there you have it, my favorite Sublime Text 2 plugins aka packages. These are the ones I couldn&apos;t live without however I also make use of quite a few other plugins.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I encourage you to &amp;lt;a href=&quot;http://wbond.net/sublime_packages/community&quot;&amp;gt;browse the list of published packages&amp;lt;/a&amp;gt; to see of there&apos;s one there that will make your daily coding experience that much more enjoyable. After all, every bit helps to make coding on a daily basis a pleasurable experience.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;If you have any packages you use that you can&apos;t live without please let me know about them in the comments! I&apos;m always on the lookout for that next best package.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Who knows?  Maybe you&apos;ll even create it :).&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>My Experience with Ruby On Rails as a PHP Developer</title><link>https://hswolff.com/blog/my-experience-with-ruby-on-rails-as-a-php-developer/</link><guid isPermaLink="true">https://hswolff.com/blog/my-experience-with-ruby-on-rails-as-a-php-developer/</guid><pubDate>Sun, 06 May 2012 20:43:26 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Note:  This post is an extension of my previous post &amp;lt;a href=&quot;http://blog.harrywolff.com/my-experience-with-php-frameworks-yii-codeignitor-and-symfony/&quot; title=&quot;My Experience with PHP Frameworks – Yii, CodeIgnitor, and Symfony&quot;&amp;gt;about developing with PHP frameworks.&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Recently I created a new web app using Ruby on Rails. By trade I&apos;m a PHP and JavaScript developer so this foray into RoR broke new ground for me.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I went with Rails over a PHP framework mostly because I wanted to try something new. I wanted to try something different and with its popularity Rails was a great pick.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In brief I found my experience developing with Ruby on Rails to be both frustrating and effortless.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Frustrating&amp;lt;/strong&amp;gt;:  because I was new to RoR I didn&apos;t know all of its tricks and how to do things the Rails Way. As a result I felt like I was coding at a slower pace than I usually do.  Really that&apos;s the performance hit anyone experiences when trying something new.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Effortless&amp;lt;/strong&amp;gt;:  once I learned some Railisms and began to get the swing of how Rails works coding went smoothly. Using Rails’ ActiveRecord was magic once I understood how and why I should use it. Also Rails’ form helpers made form handling a joy to work with. Again: this was after I picked up some understanding of how these things worked. Before understanding I was close to pulling out my hair.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;So what follows is a run through of my thoughts and experiences while I used Ruby on Rails to create &amp;lt;a href=&quot;http://datesandpairs.com/&quot;&amp;gt;Dates &amp;amp; Pairs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Disclaimer:  I am in no way a Rails or Ruby expert so if something written is incorrect please let me know and I will update the post to reflect the correct information.&amp;lt;/em&amp;gt;
&amp;lt;!--more--&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Ruby is [more] Complicated (than PHP)&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;With a PHP application all you need is an Apache server.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;With a Ruby on Rails application you need &amp;lt;a href=&quot;https://rvm.io/&quot;&amp;gt;RVM&amp;lt;/a&amp;gt; (optional), &amp;lt;a href=&quot;http://rubygems.org/&quot;&amp;gt;gems&amp;lt;/a&amp;gt;, Rails, and patience.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;It isn&apos;t possible to open your favorite Code Editor and start writing. You have to create a Rails application and play within its confines.  (To be fair those confines are larger than most PHP applications.)&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Ruby is a full fledged object oriented language whereas PHP is a scripting language.  There&apos;s no equivalent to an index.php file with &amp;lt;code&amp;gt;&amp;lt;?php echo &apos;Hello&apos;; ?&amp;gt;&amp;lt;/code&amp;gt; in it in the Ruby world.  The closest you&apos;ll get is a &amp;lt;a href=&quot;http://www.sinatrarb.com/&quot;&amp;gt;Sinatra&amp;lt;/a&amp;gt; app, yet even then you&apos;re making use of the Sinatra gem.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;That was one of the biggest differences I faced while developing in Ruby on Rails.  I didn&apos;t know where the entry point for my program was and that led to a great deal of frustration.  In a PHP application I almost always know where things start.  In my RoR app I had to do a good deal of sleuthing to figure that out.  Although it wasn&apos;t really important to my coding it mattered to me on an intellectual level, something that I couldn&apos;t let sit unanswered.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Ruby the Language&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Just as there&apos;s a PHP way of doing things there&apos;s a Ruby way of doing things.  This goes from syntax to how Ruby functions are named.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;As a PHP developer I have grown used to checking if a variable is set by using PHP&apos;s &amp;lt;code&amp;gt;isset()&amp;lt;/code&amp;gt; function.  In fact most PHP functions, whether it be for array or object manipulation, the variable is passed into the function to perform the desired computation.  In Ruby all function calls are made on the object.  This makes for beautiful code but also requires a shift in one&apos;s cognitive approach.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In PHP you&apos;d type &amp;lt;code&amp;gt;isset($_GET[&apos;name&apos;])&amp;lt;/code&amp;gt; to check if the query param &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; was set.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In Ruby you&apos;d type &amp;lt;code&amp;gt;params[:name].blank?&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In PHP if you wanted to change &apos;Hello World&apos; to &apos;Hello Bob&apos; you would type &amp;lt;code&amp;gt;str_replace(&apos;World&apos;, &apos;Bob&apos;, &apos;Hello World&apos;)&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;In Ruby you would type &amp;lt;code&amp;gt;&apos;Hello World&apos;.gsub(&apos;World&apos;, &apos;Bob&apos;)&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;As you can see the Ruby syntax allows you to make function calls directly on the subject, whereas PHP requires you to pass in the subject to the function.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The reason for this is that Ruby is an object-oriented language.  Everything in Ruby is an object, allowing you to make function calls on anything.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Besides the power you can get from object-oriented programming, this allows you to write code that is very easy to read and follow.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;The main problem with moving to Ruby is that you have to learn what all those function calls are.  Also you have to start developing a sense of what function calls would be named.  Like above, I would not have guessed that &amp;lt;code&amp;gt;gsub&amp;lt;/code&amp;gt; would be the function name to replace part of a string.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;That&apos;s why &amp;lt;a href=&quot;http://www.ruby-doc.org/&quot;&amp;gt;Ruby-Doc.org&amp;lt;/a&amp;gt; became my best friend while learning Ruby.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;MVC or Bust&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Ruby on Rails is an MVC architecture that makes it very difficult for you to cheat.  This is a good thing as the more you adhere to a MVC design the easier it will be for you to maintain your application.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;As a result you should take advantage of Ruby&apos;s object-oriented powers.  Create additional methods on your Rails models.  This will allow for later development joy, keeping your code dry and easy to read and maintain.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Deployment&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Without a doubt the hardest part to developing my app in Ruby on Rails was deploying the final code to production.  I damn near quit at this point as the curve to get my site live was very steep.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I used Rails&apos; relatively new &amp;lt;a href=&quot;http://guides.rubyonrails.org/asset_pipeline.html&quot;&amp;gt;asset pipeline&amp;lt;/a&amp;gt; which in retrospect was probably above my skill level.  The documentation for deploying with Rails&apos; asset pipeline isn&apos;t very rich and as such I had to hunt and peck around the web to find the answers I needed.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I am hosting my program on &amp;lt;a href=&quot;http://www.webfaction.com?affiliate=hswolff&quot;&amp;gt;Webfaction&amp;lt;/a&amp;gt; which is a pseudo-VPS service.  You get shell access and the ability to host a plethora of applications, Rails being one of them.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I also used &amp;lt;a href=&quot;https://github.com/capistrano/capistrano&quot;&amp;gt;Capistrano&amp;lt;/a&amp;gt; to deploy my application.  Without this software I would dread deploying any updates.  With this software it&apos;s a breeze.  All I do is &amp;lt;code&amp;gt;cap deploy&amp;lt;/code&amp;gt; and I start the automated process to updating my production code.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;All in all I had a fun time learning how to create a Ruby on Rails application.  Half of it was spent learning Ruby, half was spent learning Rails, and half was spent learning how to learn Ruby and Rails.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I thought RoR would speed up my development time and it did.  However my inexperience with Ruby and Rails slowed me down, being the primary source of productivity speed bumps.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I was a little upset at how complicated it was to use Rails` asset pipeline.  The biggest reason was definitely its lack of quality documentation.  However the features it brings you are quite lovely (CSS and JS concatenation and minification).&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Would I use RoR for my next project?  Yes.  But I won&apos;t.  I have my eyes set on using &amp;lt;a href=&quot;http://nodejs.org/&quot;&amp;gt;Node.js&amp;lt;/a&amp;gt; for my next project.  My JavaScript skills have immensely improved and the prospect of coding in JavaScript on both the front-end and back-end brings a smile to my face.  Stay tuned for when that happens.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Ruby is a hell of a language and one I look forward to playing with more.  It brought an element of joy to my coding that I had never before experienced with PHP.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Sure there were times I wanted to run back to the warm and familiar embrace of PHP&apos;s dollar signs but the fluidity of Ruby kept me close.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;Of course at the end of the day it doesn&apos;t matter what language you use.  Just start coding and don&apos;t give up.  Everything else is just fluff.&amp;lt;/p&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>The Best Mac Git Gui</title><link>https://hswolff.com/blog/the-best-mac-git-gui/</link><guid isPermaLink="true">https://hswolff.com/blog/the-best-mac-git-gui/</guid><pubDate>Mon, 30 Jan 2012 14:51:43 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;a href=&quot;http://en.wikipedia.org/wiki/Git_(software)&quot;&amp;gt;Git&amp;lt;/a&amp;gt; is one of the most powerful and effective revision control systems available. It&apos;s lightweight and highly configurable, complimenting almost anyone&apos;s programming workflow. Predominately you interact with git from the command line, inputting commands such as &lt;code&gt;git status&lt;/code&gt; or &lt;code&gt;git commit&lt;/code&gt; to manipulate your repository.&lt;/p&gt;
&lt;p&gt;When you first learn git the CLI can be daunting and confusing. Browsing through your history of commits with &lt;code&gt;git log&lt;/code&gt; is not efficient. Even after you learn a few tricks such as &lt;code&gt;git log --graph --oneline --all&lt;/code&gt; it remains difficult to really explore your history.&lt;/p&gt;
&lt;p&gt;This is why a git GUI can put the joy back into using git.&lt;/p&gt;
&lt;p&gt;This article is focused on git GUIs for Mac OS X running 10.5 or greater. As I find new git GUIs I will add them to this list, hopefully making a canonical collection of Mac git GUIs.&lt;/p&gt;
&lt;p&gt;&amp;lt;hr /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;GitX&amp;lt;/h2&amp;gt;
GitX is one of the most popular open-sourced Git GUI for the Mac. Subsequently it has been the source of numerous forks. Here&apos;s three of the best forks I know about.
&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://gitx.frim.nl/&quot;&amp;gt;GitX - Pieter&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/GitX-pieter01.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/GitX-pieter02.png&quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;The first GitX version released was created by &amp;lt;em&amp;gt;pieter&amp;lt;/em&amp;gt; on his GitHub account. This version is highly stable however it lacks two very important things: features and active development. The last time this version of GitX was updated was on &amp;lt;a href=&quot;https://github.com/pieter/gitx/commits/master&quot;&amp;gt;Oct 2nd, 2009.&amp;lt;/a&amp;gt; Due to the lack of a development cycle the UI has begun to show its age. To toggle between viewing your history and staging a commit isn&apos;t as intuitive as other git GUI clients. This version is quite minimal in that regard: you can view your history, stage commits, and commit.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;
&lt;p&gt;Stable
Free&lt;/p&gt;
&lt;h2&gt;Cons&lt;/h2&gt;
&lt;p&gt;No active development
Non-intuitive UI&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://gitx.laullon.com/&quot;&amp;gt;GitX (L)&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/GitX-l01.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/GitX-l02.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/GitX-l03.png&quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;This is one of the more popular GitX forks available. It was my client of choice until I discovered one big problem this fork has: it runs very slow with large repos. When I first began using GitX (L) my repos were small enough that it ran fine. However as soon as my repo grew this fork couldn&apos;t keep up. Every time I&apos;d refresh my history of commits I&apos;d have to wait upwards of 30 seconds for it to finish scanning my log history.&lt;/p&gt;
&lt;p&gt;Aside from the performance issues on large git projects this fork brings a lot of nice UI improvements. The overall usability of this GitX client is great. The screens are clearly laid out, easy to navigate, and the GUI doesn&apos;t get in the way should you want to drop into a CLI and directly type in some git commands.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;
&lt;p&gt;Free
Easy commit history view
Shows how far ahead/behind your branch is with a remote branch
Staging commits is easy and fast
Easy to view and checkout tags, branches, and stashes&lt;/p&gt;
&lt;h2&gt;Cons&lt;/h2&gt;
&lt;p&gt;Very slow on large repositories&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;https://github.com/rowanj/gitx&quot;&amp;gt;GitX - Rowanj&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
This GitX version is forked off of GitX (L). As such it has all the pro&apos;s of GitX with some noticeable differences. The best difference is its performance on large repos: it&apos;s fast. It&apos;s able to load commits just as fast as the native git client. As noted on the GitHub page there are other fixes in this version which I&apos;m sure help with its stability as I have been using this GitX client for a while without any crashes. My only negative about this fork is it removed from the UI how many commits you were ahead or behind of a remote branch.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;
&lt;p&gt;Free
All the pros of GitX (L)
Very fast loading of large repos&lt;/p&gt;
&lt;h2&gt;Cons&lt;/h2&gt;
&lt;p&gt;Removed UI view of how many ahead or behind your branch is of a remote branch&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://gitboxapp.com/&quot;&amp;gt;Gitbox&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/Gitbox-01.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/Gitbox-02.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/Gitbox-03.png&quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;Gitbox prides itself on its minimalism. The UI is calm but plain, with few buttons available to push, allowing you to focus on your commit history and staging. It doesn&apos;t have a built in diff app so by default it makes use of FileMerge but is compatible with a range of 3rd-party diff applications. Most of what you see in Gitbox is fairly easy to do in a CLI, however if you must have a GUI for those tasks then Gitbox is the GUI for you.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;
&lt;p&gt;Free for 1 repo
Minimalistic
Fairly fast&lt;/p&gt;
&lt;h2&gt;Cons&lt;/h2&gt;
&lt;p&gt;Paid for more than 2 repos
Un-intuitive UI for staging
Features hidden in dropdown boxes
Not enough UI features to justify GUI&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://www.git-tower.com/&quot;&amp;gt;Tower&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/tower-01.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/tower-02.png&quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;Tower is one of the more full-featured git GUI clients available. Nearly everything that you would want to do with git you can do with Tower. This makes for a very powerful GUI however one that can be intimidating on first blush. Each screen has a lot going on as it seems that the creators of Tower tried to implement nearly everything you could do with git in the CL with a GUI. This makes for screens bursting with buttons and tabs and tables of information. If you really don&apos;t like the CL then Tower is a suitable choice for you.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;
&lt;p&gt;Full-featured - can do nearly everything via GUI
Pretty UI
Adopts OS X UI standards&lt;/p&gt;
&lt;h2&gt;Cons&lt;/h2&gt;
&lt;p&gt;Paid, $59 for a license
Crowded UI
Lots of buttons&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;http://www.sourcetreeapp.com/&quot;&amp;gt;SourceTree&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/sourcetree-01.png&quot; /&amp;gt;
&amp;lt;img src=&quot;/images/posts/2012/01/sourcetree-02.png&quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;This GUI is another full-featured one that rivals Tower. Where it differs significantly is the price: SourceTree is freely available in the Mac App store. That&apos;s a nice convenience that makes installing this GUI a breeze. Another nice feature of SourceTree is it is able to load Mercurial repositories alongside git repositories. Like Tower you can do almost anything through SourceTree that you can do through the git CL client. SourceTree also has a lot of buttons in its UI however I found these UI elements to be more intuitive than Tower&apos;s. SourceTree makes a lot of things automatic and easy to use, making it one of the best choices for a git newbie.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;
&lt;p&gt;Freely available in Mac App Store
Full-featured
Fast&lt;/p&gt;
&lt;h2&gt;Cons&lt;/h2&gt;
&lt;p&gt;Lots of buttons
Some tasks easier to perform via CL&lt;/p&gt;
&lt;p&gt;&amp;lt;hr /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;And that wraps up all the git GUIs that I know of! It should go without saying but your mileage may vary so pick the GUI that best suits you. What I might not like about Gitbox might be what you love about it, and that&apos;s ok.&lt;/p&gt;
&lt;p&gt;I will warn that using a git GUI exclusively is a bad idea. You should learn how and why git works the way it does. Inevitably you will run into some weird problem and solely relying on a GUI to help you could lead to even more problems. Learn the git command line client. When you know it then enjoy the benefits of a GUI to speed up your workflow.&lt;/p&gt;
&lt;p&gt;I personally use GitX - Rowanj to stage my commits and search my commit history. I use the command line for almost everything else. I push, merge, and rebase exclusively through the command line, giving myself complete control over my git commits.&lt;/p&gt;
&lt;p&gt;Whatever GUI you pick just make sure it works for you and you aren&apos;t working for it. With that said, get coding!&lt;/p&gt;
</content:encoded></item><item><title>Prune Remote Git Branches</title><link>https://hswolff.com/blog/prune-remote-git-branches/</link><guid isPermaLink="true">https://hswolff.com/blog/prune-remote-git-branches/</guid><pubDate>Thu, 13 Oct 2011 11:41:06 GMT</pubDate><content:encoded>&lt;p&gt;Git is a wonderful version control system. It’s light, nimble, and fast. It makes managing code amongst many developers a dream.&lt;/p&gt;
&lt;p&gt;Unfortunately it has a fair share of quirks.&lt;/p&gt;
&lt;p&gt;One of the quirkiest quirks that I’ve run into a couple times now is an issue with remote git branches.&lt;/p&gt;
&lt;p&gt;When a remote git branch is deleted from the server your local repository doesn’t update its references.&lt;/p&gt;
&lt;p&gt;The easy solution is to run this command:&lt;/p&gt;
&lt;p&gt;&amp;lt;code&amp;gt;git remote prune origin&amp;lt;/code&amp;gt;&lt;/p&gt;
&lt;p&gt;This prunes and removes all remote branches that no longer exist.&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&quot;http://kpumuk.info/development/memo-2-useful-git-tricks-with-remote-branches/&quot;&amp;gt;Full credit to Dmytro Shteflyuk for this tip.&amp;lt;/a&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>My Experience with PHP Frameworks - Yii, CodeIgniter, and Symfony</title><link>https://hswolff.com/blog/my-experience-with-php-frameworks-yii-codeignitor-and-symfony/</link><guid isPermaLink="true">https://hswolff.com/blog/my-experience-with-php-frameworks-yii-codeignitor-and-symfony/</guid><pubDate>Mon, 26 Sep 2011 00:12:45 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;h2&amp;gt;Overview&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;A week ago I started work on a personal web project using PHP as my programming language of choice. This wasn’t a hard decision as I use PHP daily for work and have a great deal of strength in the language.&lt;/p&gt;
&lt;p&gt;As I set forward to create my web app I knew I wanted to use a prebuilt PHP web framework. My reasons included not wanting to reinvent the wheel and the belief that the benefit of open source software is its great community of support.&lt;/p&gt;
&lt;p&gt;Another reason I wanted to use an open source PHP framework was that it provides a tried and true framework complete with features that I otherwise would not have time to code myself. Although this project is being done during my free time I don’t want its quality to suffer. So by using a framework that already provides proper request/response, and routing support it would allow me to focus on designing and developing the app and not worry about the architecture that it would be built on.&lt;/p&gt;
&lt;p&gt;From my research (lots of Google searches and crawling through and around websites) I found the current top PHP frameworks are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Yii&lt;/li&gt;
&lt;li&gt;CodeIgniter&lt;/li&gt;
&lt;li&gt;Symfony&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here’s my interactions with them.&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Symfony&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;I first chose Symfony as the framework to use for my web project. I tried its &amp;lt;a href=&quot;http://symfony.com/get_started&quot;&amp;gt;Quick Tour&amp;lt;/a&amp;gt; and found myself agreeing with the design decisions of the software. It made sense to me how things were built and how they were used.&lt;/p&gt;
&lt;p&gt;In addition to the content of the Quick Tour I also found the design of Symfony’s website to be quite appealing. Although it is said to not judge a book by its cover we humans tend to notice things that are pretty. The same is true of Symfony’s website. Its pleasing to look at, pleasing to use, and I felt a sense of professionalism and polish that made me feel safe to learn more about the code.&lt;/p&gt;
&lt;p&gt;I spent a few nights reading in bed on my iPad the rest of Symfony’s tutorials and docs and finally felt confident enough to begin coding. I did begin doing some coding in Symfony and aside from the difficulty of learning a new project’s jargon I was actually having an enjoyable time using Symfony. That is until I ran into Symfony’s Bundle system.&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&quot;http://symfony.com/doc/current/book/page_creation.html#page-creation-bundles&quot;&amp;gt;Symfony’s bundle system&amp;lt;/a&amp;gt; is unique. I honestly don’t fully understand it but I was not enjoying learning what I was reading. From what I read it sounds like a very strong design approach to maintainable and self-contained code however it is not a convention I’m used to, nor one that I found myself wanting to learn.&lt;/p&gt;
&lt;p&gt;Even more than not understanding fundamentally what a bundle is and what it is used for, from what I understood I felt as if it was overkill for my purposes and would end up slowing my development down rather than help speed it up. As a result I stopped learning Symfony and began looking at the other two popular PHP frameworks.&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;CodeIgniter&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;I never tried programming with CI but from what I read I actually liked what the software provided. My biggest irk about the project was its close tie to the commercial ExpressionEngine. Although probably not based on any pieces of truth I could not shake the feeling that by using CI I was using a hand-me-down relative of ExpressionEngine.&lt;/p&gt;
&lt;p&gt;Now this is perhaps in no way based on reality but it was my subjective feeling that I got when reviewing the websites. It was that feeling that pushed me away from trying to use CodeIgniter for my project.&lt;/p&gt;
&lt;p&gt;I only write this so that the creators of CodeIgniter know that these sentiments and perceptions exist (perhaps only within me). However if its more widespread it should be addressed so as to not lose potential users of the framework.&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Yii&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;I was very apprehensive about using Yii. It’s mostly known as the ‘new-kid’ on the block in terms of PHP frameworks. It&apos;s a framework that doesn’t seem to have as much real world experience as other PHP frameworks as there doesn’t seem to be a wealth of sites using it in their production environment. Nevertheless this was the last choice I had in the realm of PHP and I wanted to see what it had to offer.&lt;/p&gt;
&lt;p&gt;Yii is a very solid PHP framework. There is a pretty thorough &amp;lt;a href=&quot;http://www.yiiframework.com/doc/guide/&quot;&amp;gt;guide to Yii&amp;lt;/a&amp;gt; that I went through and tried out. It’s a very solid introduction to the framework that showcases its code design decisions and teaches you how to use the framework along the way. I liked it and started programming my web app with Yii.&lt;/p&gt;
&lt;p&gt;Things were going mostly well. I hit a few speed bumps here and there that a Google search was fortunately able to solve (on Yii’s own message board no less - thumbs up for that). I noticed a large amount of foreign writers (mostly Russian) frequenting the forum which led me to believe that Yii’s popularity lies mostly outside of the USA’s borders. This left me slightly uneasy as I only speak English and I didn’t want to translate to find the answers to my questions.&lt;/p&gt;
&lt;p&gt;Nevertheless I plugged forward and continued to code. Yii’s guide was lacking in some aspects however &amp;lt;a href=&quot;http://www.yiiframework.com/doc/api/&quot;&amp;gt;Yii’s api reference&amp;lt;/a&amp;gt; is absolutely amazing. If more open source projects had documentation like Yii’s the open source community would be a safer and happier place. The main problem with the API reference is not with the reference but - in my opinion - with Yii itself.&lt;/p&gt;
&lt;p&gt;Yii provides a lot, and as a result it has a large codebase. This led to frequent bouts of 8+ Chrome tabs open as I tried to triage the proper function to use for the effect that I wanted. This happened a few times: once with relational support and once with helper function support. After going through these maze-like quests to find what I wanted to do I realized that I had hit the wall. Yii was no longer helping me. It was getting in the way and I did not want that to happen.&lt;/p&gt;
&lt;p&gt;That was one of my most important rules: the framework is there to help me get my job done - not hinder me. Of course there are points of friction when learning new software yet when I found myself continuously running into them I did not feel as if I was using the right software for the job.&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;One of the largest problems I continuously saw when looking for a suitable PHP framework to use was the discord in the PHP community. There aren’t any dominant PHP frameworks (Zend aside which I will forever gloss over due to complete lack of interest).&lt;/p&gt;
&lt;p&gt;As a result of there not being one ‘true’ PHP framework that everyone agrees is the best one to use most development efforts are divided among the available PHP frameworks. Were these development efforts united under one project not only would the amount of developers supporting the software increase but it would also help decrease decision fatigue.&lt;/p&gt;
&lt;p&gt;When I was searching for what PHP framework to use I found myself growing quickly tired trying to decide which one was the best and which one would help me the most. After a while I had to put blinders on and just start trying to use each PHP framework that I wanted but the process to get there was much longer than it should have been.&lt;/p&gt;
&lt;p&gt;Perhaps I’m unique in this situation but I doubt it. If there were only two frameworks to choose from, or frameworks that were obviously created for entirely different purposes that would have made my decision making process umpteenth times easier.&lt;/p&gt;
&lt;p&gt;Yet at the end of the day I found myself striking out. Whether for subjective or real reasons I did not enjoy my experiences with any of these PHP frameworks. Also my pinky finger got really tired holding shift so that I could write $ all the fricken time. It’s the small things that matter and all those $ add up.&lt;/p&gt;
&lt;p&gt;I’ve now decided to try my hand at Ruby On Rails. It’ll do me good to try my hand at another language. I’ve already ported over what code I had so far from Yii in about half the time it took me to originally create. I’m liking it so far and will of course update again with future reflections.&lt;/p&gt;
&lt;p&gt;&amp;lt;em&amp;gt;Update: &amp;lt;a href=&quot;http://blog.harrywolff.com/my-experience-with-ruby-on-rails-as-a-php-developer/&quot; title=&quot;My Experience with Ruby On Rails as a PHP Developer&quot;&amp;gt;Check out my thoughts and reflections of my time spent developing with Ruby on Rails&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;&lt;/p&gt;
</content:encoded></item><item><title>How To Find A Tech Job</title><link>https://hswolff.com/blog/finding-a-job/</link><guid isPermaLink="true">https://hswolff.com/blog/finding-a-job/</guid><pubDate>Tue, 02 Aug 2011 18:33:29 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;m helping a friend find a job. I&apos;ve already gone through the entire job search process and I do not envy the guy. It&apos;s a hard, grueling process but one that when successful is such a rush.&lt;/p&gt;
&lt;p&gt;Off the top of my head I shared with him a list of job listing websites I used during my search. These sites are mostly geared toward technology jobs but hopefully it&apos;ll spark an idea of a place to search for a job you haven&apos;t thought of before. Like maybe one of your favorite websites is hiring, or has links towards a website that is hiring.&lt;/p&gt;
&lt;p&gt;What I&apos;ve learned from my job hunt is that you have to get creative. You have to look for jobs in places you wouldn&apos;t expect to find them.&lt;/p&gt;
&lt;p&gt;And of course you have to apply. My philosophy on that matter is: it doesn&apos;t hurt to apply but it does take a lot of time.&lt;/p&gt;
&lt;p&gt;Here&apos;s the shortlist of sites that may help you land that next killer job you&apos;re looking for:&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&quot;http://www.dice.com/&quot;&amp;gt;Dice.com&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://www.craigslist.org/&quot;&amp;gt;Craigslist Job Board in your area&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://nytm.org/made/&quot;&amp;gt;Internet Made in New York City Hiring Spots&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://www.usv.com/jobs/&quot;&amp;gt;Jobs in the Union Square Ventures Portfolio&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://jobs.mashable.com/a/jbb/find-jobs&quot;&amp;gt;Mashable Job Board&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;https://weworkremotely.com/&quot;&amp;gt;37signals Job Board&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://www.crunchboard.com/jobs/&quot;&amp;gt;TechCrunch&apos;s CrunchBoard Job Board&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&lt;/p&gt;
&lt;p&gt;Updates:
&amp;lt;a href=&quot;http://www.linkedin.com/jobs&quot;&amp;gt;LinkedIn Jobs&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://www.indeed.com/&quot;&amp;gt;Indeed.com&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;a href=&quot;http://mandy.com/&quot;&amp;gt;Mandy - Film and TV Jobs&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&lt;/p&gt;
&lt;p&gt;If you have any other ideas of where to look let me know and I&apos;ll update the list. Good luck!&lt;/p&gt;
</content:encoded></item><item><title>CSS3 Rounded Corners On IE</title><link>https://hswolff.com/blog/css3-rounded-corners-on-ie/</link><guid isPermaLink="true">https://hswolff.com/blog/css3-rounded-corners-on-ie/</guid><pubDate>Thu, 10 Mar 2011 12:53:44 GMT</pubDate><content:encoded>&lt;p&gt;One of the coolest new additions to the CSS3 specification is its built-in ability to render rounded corners. Before CSS3 the only semi-humane way to create rounded corners on an element was to create four rounded corner images and use some unwieldy albeit effective &amp;lt;code&amp;gt;display:absolute&amp;lt;/code&amp;gt; positioning to get the desired effect. This resulted in bloated code that contained numerous extra &amp;lt;code&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/code&amp;gt; tags such as: &amp;lt;code&amp;gt;&amp;lt;div class=&quot;topLeftCorner&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/code&amp;gt; to create the effect, and ultimately bogged down the rendering of the page.&lt;/p&gt;
&lt;p&gt;This onerous task has been thankfully and mercifully banished to the days of yore thanks to CSS3&apos;s &amp;lt;code&amp;gt;border-radius&amp;lt;/code&amp;gt;. To create a rounded-border with CSS3 it is as simple as typing:&lt;/p&gt;
&lt;p&gt;&amp;lt;code&amp;gt;
.rounder_corners {
-moz-border-radius: 12px;
-webkit-border-radius: 12px;
border-radius: 12px;
}
&amp;lt;/code&amp;gt;&lt;/p&gt;
&lt;p&gt;Now this is all well and good however the bane of every accomplished web developer is cross-platform compatibility - namely Internet Explorer. Unfortunately for all who code for the web most of the world still uses IE7 and IE8 as their web browser of choice. What&apos;s so horrible about this? IE6-8 does not suport CSS3&apos;s &amp;lt;code&amp;gt;border-radius&amp;lt;/code&amp;gt; property, thus insuring that any IE6-8 user will not see your beautifully rounded corners. I&apos;m choking up just thinking about the ugly pain. :(&lt;/p&gt;
&lt;p&gt;So what&apos;s a web developer to do? Today I stumbled across (through &amp;lt;a href=&quot;http://html5boilerplate.com&quot;&amp;gt;html5boilerplate.com&amp;lt;/a&amp;gt;) the most excellent and amazing &amp;lt;a href=&quot;http://css3pie.com/&quot;&amp;gt;CSS3 PIE&amp;lt;/a&amp;gt; resource. PIE stands for Progressive Internet Explorer and the long and short of its awesomeness is that when it is included on your web page it equips every user running IE6-8 with the ability to render and display all the glorious benefits of CSS3 - including its &amp;lt;code&amp;gt;border-radius&amp;lt;/code&amp;gt; property! Ugliness undone!&lt;/p&gt;
</content:encoded></item><item><title>Top 10 Albums Of 2010</title><link>https://hswolff.com/blog/top-10-albums-of-2010/</link><guid isPermaLink="true">https://hswolff.com/blog/top-10-albums-of-2010/</guid><pubDate>Tue, 28 Dec 2010 13:10:32 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;img src=&quot;/images/posts/2010/top-10-albums-300x207.png&quot; alt=&quot;&quot; title=&quot;top 10 albums&quot; width=&quot;300&quot; height=&quot;207&quot; class=&quot;alignright size-medium wp-image-1103&quot; /&amp;gt;What a year for music. Seriously, this year has been just a whopper for music, something that I could not have even &amp;lt;em&amp;gt;tried&amp;lt;/em&amp;gt; to predict. When 2010 was just peaking it’s head around the corner I was honestly a little bummed. I looked at the music that had come out in 2009 and was glum, believing it would be impossible for 2010 to come in any way close to the music of 2009.&lt;/p&gt;
&lt;p&gt;Boy, was I wrong.&lt;/p&gt;
&lt;p&gt;Actually let’s take that ‘boy’ exclamation up a notch.&lt;/p&gt;
&lt;p&gt;Man, was I wrong. And in so many ways that I still don’t understand...&lt;/p&gt;
&lt;p&gt;So I’ve looked at all the music I’ve listened to in 2010 and have humbly selected my Top 10 Albums along with the Stand Out Track from that album.&lt;/p&gt;
&lt;p&gt;You probably won’t agree with any of my choices past my number 1 pick, but that’s okay. I’m the one doing the writing and you’re the one doing the reading. Unless you add a comment refuting my opinion. But you wouldn’t do that, would you?&lt;/p&gt;
&lt;p&gt;Read on for my Top 10 Albums of 2010!&amp;lt;!--more--&amp;gt;&lt;/p&gt;
&lt;p&gt;P.S: If you click on any of the album links and buy the record I get a little affiliate money from Amazon. Proper warning and hoping for help! Thanks!&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt; Top 10 Albums of 2010&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Kanye West - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003X2O6KW/?tag=harwol-20&quot;&amp;gt;My Beautiful Dark And Twisted Fantasy&amp;lt;/a&amp;gt;
Stand Out Track: Lost In The World
Creating a good bit of distance between himself and all other artists of 2010, Kanye West’s My Beautiful Dark Twisted Fantasy has found itself sitting securely as my number one album of the year.  I’m far from original in that decision, with many other bloggers and critics deciding the same, however you cannot beat the absolute genius of this record.  Say what you want about Kanye West the celebrity - when it comes to music he is irreproachable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sleigh Bells - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003KT3NS4/?tag=harwol-20&quot;&amp;gt;Treats&amp;lt;/a&amp;gt;
Stand Out Track: Rill Rill
I’ve listened to ‘noise music’ before. I’ve liked some of what I’ve heard, however I usually don’t. Sleigh Bells’ debut album Treats not only takes ‘noise music’ to a whole new level, it does so while remaining incredibly catchy and melodic. Put this record on and listen to it. You’ll be surprised to notice how catchy ‘noise’ can be. And then after you’re done with your first listen, put the record on again. And dance. And now you won’t have to go to the gym that day. Or dance while at the gym. Two workouts in one. Excuse me, I need to go to my gym. And dance. Workout +2&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Menomena - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003P5AJCG/?tag=harwol-20&quot;&amp;gt;Mines&amp;lt;/a&amp;gt;
Stand Out Track: Dirty Cartoons
This choice is heavily swayed. Menomena has long been a favorite band of mine, and with their fourth record Mines they continue to rock as hard as they did on their first record. The most important thing to know about Menomena - the band - is how incredibly deft they are at creating songs seeped in melancholy - an emotion that is quite difficult to create. Whether you need some music to accompany a lonely rainy day, or a song to help transition from dusk to night, Menomena is your band.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Foals - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003H8WSLQ/?tag=harwol-20&quot;&amp;gt;Total Life Forever&amp;lt;/a&amp;gt;
Stand Out Track: Total Life Forever
I almost missed this album. It slipped entirely underneath my radar, with my first listen of this record happening a good two months after it was released. Before hearing Foals’ Total Life Forever I knew nothing about the band - and frankly still don’t. I do remember seeing the video for their first single, Spanish Sahara and finding their use of a drum pad to be quite cool. This record is even more moody than Menomena’s but in a very different way. This record is great for early dawns and black midnights. It’s a record that paints silence. Some tracks take a few minutes to really pick up speed, but once they do you remain hooked.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;LCD Soundsystem - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003BEE0F8/?tag=harwol-20&quot;&amp;gt;This Is Happening&amp;lt;/a&amp;gt;
Stand Out Track: All I Want
I feel as though, at this point, everyone knows who LCD Soundsystem is. In case you don’t (how do you not!?) LCD Soundystem is a band fronted by the highly talented producer James Murphy that creates incredibly upbeat and catchy dance songs. I was fortunate to see these guys live three years ago, and incredibly lucky to see them live again this year for their new record, This Is Happening. This record is assuredly their best so far, with their live show exceeding the excitement and fun already found on the album. (On an aside, I ran into Aziz Ansari at this show. That was weird - but exciting!)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hoodie Allen - &amp;lt;a href=&quot;http://www.timeforthepeprally.com/&quot;&amp;gt;Pep Rally&amp;lt;/a&amp;gt;
Stand Out Track: January Jones
Not truly an album, this debut mixtape from current unknown Hoodie Allen contains catchy rhymes and hooks, focusing on subject matters near and dear to this suburban kid’s heart. This is a rap record, but it’s rap that I would easily call ‘pop rap’ in the sense that it’s light-hearted and cheerful but not the radio friendly garbage that generally hurts my sensibilities. The entire mixtape is available as a free download, just click on the album name and get your free download on!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ray LaMontagne - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003QCCS36/?tag=harwol-20&quot;&amp;gt;God Willin&apos; and the Creek Don&apos;t Rise&amp;lt;/a&amp;gt;
Stand Out Track: God Willin&apos; and the Creek Don&apos;t Rise
Adult contemporary? On my list!? Yes please ma’am sir! To be fair I would peg Ray LaMontagne as more of a folk artist and that is the exact reason his record is sitting so pretty at number seven. I’m a sucker for soft voices and acoustic guitar and this record gives me plenty of both, along with excellent production.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cee Lo Green - &amp;lt;a href=&quot;http://www.amazon.com/dp/B0041WLBEC/?tag=harwol-20&quot;&amp;gt;The Lady Killer&amp;lt;/a&amp;gt;
Stand Out Track: Please
I feel bad for Cee Lo Green. His album, The Lady Killer is a tremendous record however it is being continuously overshadowed by all the other great albums of 2010. If it wasn’t for his breakout song ‘Fuck You’ I doubt anyone would know Cee Lo Green had released a new album. The rest of his album is as solid as ‘Fuck You’ - however not as radio friendly. Still the record pleases with its soulful sounds and it won’t disappoint. In fact, it’ll definitely please.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Joe Purdy - &amp;lt;a href=&quot;http://www.amazon.com/dp/B003U06B50/?tag=harwol-20&quot;&amp;gt;4th of July&amp;lt;/a&amp;gt;
Stand Out Track: On The Wind
I don’t remember how I stumbled upon this artist but I am very glad that I did. This is another folk album that was on constant replay for a solid week. More soft voices and acoustic guitars, with melodies and tunes that work so well in their simplicity. You probably won’t like this guy, and that’s okay. For me, I couldn’t get enough of him.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Spoon - &amp;lt;a href=&quot;http://www.amazon.com/dp/B002VDZIIS/?tag=harwol-20&quot;&amp;gt;Transference&amp;lt;/a&amp;gt;
Stand Out Track: I Saw The Light
Just rounding out the top 10 is Spoon’s latest record Transference. Each album Spoon creates has their distinctive sound, while remaining highly unique. This album continues that trend, further stripping away some of the gloss of their earlier records, leaving an album that is so raw and bare you may wonder if they took any time to practice before recording. I once saw someone describe this album as a ‘5 o’clock shadow rock’ and I haven’t been able to find any better description.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Aside from these 10 stellar albums there have been a whole slew of albums released in 2010 that deserve at least some mention of their existence. You know what this calls for don’t you?&lt;/p&gt;
&lt;p&gt;&amp;lt;h2&amp;gt;Honorable Mentions&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;J. Cole - Friday Night Lights
The Tallest Man on Earth - The Wild Hunt
Two Door Cinema Club - Tourist History
Vampire Weekend - Contra
The Walkmen - Lisben
A Weather - Everyday Balloons
Yeasayer - Odd Blood
Gorillaz - Plastic Beach
Arcade Fire - The Suburbs
Atmosphere - To All My Friends EP
The Black Keys - Brothers
Caribou - Swim&lt;/p&gt;
&lt;p&gt;So there you have it: the Top 10 Albums of 2010. This top 10 list really puts the 10 in 2010. Pschaw!&lt;/p&gt;
&lt;p&gt;And now onto 2011! What we might see I can only dream! Let’s get going!!&lt;/p&gt;
</content:encoded></item></channel></rss>