<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chromatic on Medium]]></title>
        <description><![CDATA[Stories by Chromatic on Medium]]></description>
        <link>https://medium.com/@ChromaticHQ?source=rss-4fdf26861308------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TdjOv9Eii8gCyVYG.png</url>
            <title>Stories by Chromatic on Medium</title>
            <link>https://medium.com/@ChromaticHQ?source=rss-4fdf26861308------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:42:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ChromaticHQ/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Questions To Ask Before Building a Component Library]]></title>
            <link>https://medium.com/@ChromaticHQ/questions-to-ask-before-building-a-component-library-5fa10967df48?source=rss-4fdf26861308------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fa10967df48</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[style-guides]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[component-libraries]]></category>
            <dc:creator><![CDATA[Chromatic]]></dc:creator>
            <pubDate>Wed, 28 Feb 2018 16:40:22 GMT</pubDate>
            <atom:updated>2018-02-28T16:40:22.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GF6ozztlIUgBB7wY8OtxLA.jpeg" /></figure><p>At this point it feels safe to say that component-based design and development is here to stay. Gone are the days of designing and building pages in isolation. Instead, we’re building collections of components that all follow a shared design system and can be used anywhere on any page. This is increasing the consistency and predictability of our user experiences. It’s also speeding up our development.</p><p>We’re achieving this with the help of component libraries, the most important tool to emerge from this paradigm. Component libraries allow us to build, test, and browse our components in isolation. They also make prototyping new experiences both easy and fast.</p><p>That said, a component library can also introduce friction. They add complexity and there is plenty of room for error. Fortunately, like any technical project, we can ease this friction with proper planning. Answering key questions before building a single component can go a long way towards ensuring the library’s success. We’d love to share what we’ve found to be the most important questions to ask.</p><h3>What problems will a component library solve?</h3><p>Component libraries add complexity to a project’s workflow. It’s important to be able to justify that with an explanation of the problems they solve. Don’t build one simply because everyone is talking about them or because it’s another buzzword to throw around. Instead, understand how it will improve your project. We’ll get you started with a bit more about the most common benefits.</p><p>In short, component libraries bring consistency to an organization’s brand. Everything in the library follows a defined design system, which does away with ill-informed, one-off designs. This consistency improves the user experience, which increases engagement. This may mean more ad revenue or product sales, or perhaps you’re a nonprofit. Regardless, increasing engagement is always the end goal.</p><p>Component libraries also result in less time spent on development, as their complexity pays dividends down the road. Once it’s built, the development team is armed with an arsenal of components used to prototype and build experiences in a fraction of the time. New features are easily shared across all properties and because bugs are siloed, they’re easier to test and fix.</p><p>What about the complexity we mentioned? Well, the component library adds yet another piece to the puzzle, which can be a blessing or a curse. It does allow further separation between front-end and back-end development. This can be really helpful on larger teams, but for smaller teams, that may only mean a tedious extra step.</p><h3>Is everyone on the project behind the component library?</h3><p>Everyone has to champion the component library. This includes stakeholders, the design team, and whomever is using the components. Stakeholders won’t appreciate the time and care spent building and maintaining the library if they don’t understand the benefits. If the design team isn’t in tune, it’ll be nearly impossible to componentize their work. Likewise, if the library isn’t properly utilized while implementing its code, many of the benefits will quickly dissolve.</p><p>These champions may be spread across entirely different organizations. The less they overlap, the more important this communication and collective buy-in becomes. In any case, everyone has to be on the same page and be committed to the library’s success.</p><h3>How will the component library be used?</h3><p>Successful components don’t care how they will be used. They don’t care about what data they’ll be fed or where they’ll end up on the page. They also don’t care about what technologies will use them, but knowing that may help inform the rest of our questions.</p><p>The Holy Grail is to use the component library’s code within whatever is implementing it. This is helpful because future updates only have to be made in one place, as opposed to mirroring them with duplicate code. Using the library’s CSS and JavaScript as-is isn’t too hard to accomplish, but HTML templates can be tricky. In theory you want your library to support any technology, but if you’re largely planning for one, it’s important to know that. We’ll touch more on that in our next question.</p><p>If the library lives in a separate repository, which we’ll also discuss more later, how will you update it everywhere it is used? Having the implementations randomly pull from the master branch will likely be an unstable mess. Instead, we recommend creating releases named with the <a href="https://semver.org/">semantic versioning scheme</a>. Implementations can then update when ready, and the release names and notes will let everyone know what they can expect when doing so.</p><h3>What tool(s) will be used to build the component library?</h3><p>In addition to each component’s HTML, CSS, and JS, component libraries typically provide a user interface. That interface makes it easy for non-developers to visually browse and test the available components. There are many helpful tools that generate the user interface from the organized component code.</p><p>We wrote <a href="https://chromatichq.com/blog/evaluating-tools-building-component-library">a post about evaluating tools to build a component library</a>. It outlines how we settled on <a href="https://fractal.build/">Fractal</a>, but it’s important to remember that different projects have different needs. We revisit that process on every project. Given what we just discussed, if we know Drupal will be our primary consumer, we may use a <a href="https://github.com/pattern-lab/edition-php-drupal-standard">PHP-based implementation of Pattern Lab</a> instead. That post, in combination with your answers from this one, will help you evaluate which tool(s) will be right for your project.</p><h3>Where should the component library live?</h3><p>We’re actually asking a few questions here. Assuming the library’s code is managed with version control, the first question is: which repository will it live in? If only one website or application will use it, and assuming it could be separated later if needed, it may be easiest to store it in the same repository. That would simplify integration by removing the aforementioned need for releases. If the library will support multiple websites or applications, it should probably live in its own repository.</p><p>Then there is the user interface. What will its URL be? More importantly, can it be public? <a href="http://styleguides.io/examples">Many organizations have public component libraries</a>. This removes any friction from using it and gives potential partners or employees an impressive look behind the scenes. If you’re not able to convince the stakeholders to follow suit, at least be sure that everyone on the project can access it and knows where it is.</p><h3>How granular should the library be? How should it be organized?</h3><p>Deconstructing and organizing components within a library is an art form. Where do we draw the lines? Is a button a component? Or the form that uses it? How will you group them?</p><p>We recommend breaking everything down into the smallest possible bits, such as a button, from the beginning. Then reuse those components within larger components. It’s tedious, but it beats having to separate something later after it was already implemented somewhere. Also, to avoid calling everything a “component”, group them by the level of granularity. You can use <a href="http://atomicdesign.bradfrost.com/chapter-2/">Atomic Design’s naming convention</a> for those buckets, or decide on something else that makes sense to your organization.</p><p>For this level of granularity and reuse to work, you’ll also have to build in flexibility from the beginning. Hardcode things like classes, labels, or content as little as possible. They’ll need different values at different times, so allow those to be populated with variables passed by whatever is using them instead. Only universal attributes should be hardcoded in a template.</p><h3>How will component code be scoped? What about page layout?</h3><p>Component code (HTML, CSS, and JS) is typically organized into individual component directories (or in some cases, <a href="https://vuejs.org/v2/guide/single-file-components.html">a single file</a>). This is a refreshing way to work. That said, you still have to ensure that the code in one component won’t affect another. Being able to use any component anywhere and being able to edit one without affecting another is only made possible by properly scoped code. From module patterns to <a href="https://en.bem.info/methodology/quick-start/">BEM methodology</a>, the solution will depend on preference and the technologies you’re using.</p><p>You’ll also want to ensure that any component can be placed anywhere. Don’t assign any outer layout-related styles to the component itself! Have separate elements for the various layout regions and place components within them. Assign styles like dimensions, alignment, and margin to those elements instead.</p><h3>What data will the library use? What else should it have?</h3><p>As with design, it’s helpful to populate the component library with realistic data. We would recommend gathering and constructing a collection of sample data that can be used throughout all of the components. Most tools used to build component libraries will have a preferred approach to storing and using this data within the components.</p><p>You’ll also want to consider where to draw the line in terms of operations on that data. For example, your library won’t be plugged into a database, so it won’t be able to actually add a product to a cart when you click “Add to cart”. You’ll just want to be sure to provide markup for all of the possible states. You may also need to have a way for component JavaScript to communicate with implementation JS without using global scope.</p><p>Will you be building page prototypes within the library? We’d recommend it, but that does raise more questions. Should you attempt to link pages together within the markup, or link everything to #? What about the &lt;head&gt; tag? Do you attempt to represent the various meta tags stuffed with your favorite keywords, or do you leave that to whatever is implementing them? How many different page layouts do you need to account for?</p><p>What about documentation? At the very least, it’s helpful to have documentation that outlines how to use the library and implement the components. Some organizations add even more, such as guidelines for <a href="http://carbondesignsystem.com/guidelines/accessibility">accessibility requirements</a> or <a href="http://voiceandtone.com/">voice and tone</a>. If your organization will want to include information like this, it’s important to pick a tool that makes that easy.</p><h3>Now what?</h3><p>Start building components! We’ve spent the whole post stressing the importance of thinking ahead, but don’t let it paralyze you. You don’t have to have the perfect answer to every question. You never will. We’re still learning more with every component. Reading this post already has you ahead of the game, and from here the only path forward is to dive in. Be sure to reach out to <a href="https://twitter.com/chromatichq">@chromatichq</a> if you need any help or advice along the way. Have fun!</p><p><em>Originally published at </em><a href="https://chromatichq.com/blog/questions-ask-building-component-library"><em>chromatichq.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fa10967df48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing DNS Records In Version Control]]></title>
            <link>https://medium.com/@ChromaticHQ/managing-dns-records-in-version-control-13766ae1b11e?source=rss-4fdf26861308------2</link>
            <guid isPermaLink="false">https://medium.com/p/13766ae1b11e</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Chromatic]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 13:57:09 GMT</pubDate>
            <atom:updated>2017-08-30T15:40:01.881Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwUEEeVLsJYwrddTBHF_8Q.jpeg" /></figure><p>Here at Chromatic, we are on a <a href="https://chromatichq.com/blog/version-control">never-ending mission</a> to get as many things as possible into version control as possible. Next step? DNS configuration.</p><p><a href="https://github.com/StackExchange/dnscontrol">dnscontrol</a> is an open-source tool written in Go by the fine folks at Stack Exchange that allows us to configure our DNS records in a JS file that can be committed to version control and published on demand. It supports a number of DNS <a href="https://stackexchange.github.io/dnscontrol/provider-list">providers</a> including AWS Route 53, DNSimple, and NameCheap. With this configuration in git, we can now easily review changes through our normal pull request workflow, as well as getting a full log of any changes made over time.</p><h3>Working With dnscontrol</h3><p>Configuration is done via a dnsconfig.js file and looks something like the example below, defining both a registrar and DNS provider and then configuring the records in each zone.</p><pre>var namecom = NewRegistrar(&quot;name.com&quot;, &quot;NAMEDOTCOM&quot;); <br>var r53 = NewDnsProvider(&quot;r53&quot;, &quot;ROUTE53&quot;);</pre><pre>D(&quot;example.com&quot;, namecom, DnsProvider(r53), <br>  A(&quot;@&quot;, &quot;1.2.3.4&quot;), <br>  AAAA(&#39;@&#39;, &#39;2001:db8:a0b:12f0::1&#39;), <br>  A(&quot;test&quot;, &quot;5.6.7.8&quot;), <br>  CNAME(&quot;www&quot;, &quot;@&quot;), <br>  MX(&quot;@&quot;, 5, &quot;mail.myserver.com.&quot;), <br>);</pre><h3>dnscontrol preview</h3><p>dnscontrol preview is similar to a diff in that it compares the configuration in your code to what is published on the DNS name servers. Its output highlights any records that would be created, modified, or removed were you to run dnscontrol push.</p><h3>dnscontrol push</h3><p>dnscontrol push takes the configuration state in your config file and publishes it live to your DNS name servers.</p><h3>Now Let’s Automate</h3><p>Even better, now that we are committing our DNS records to version control and putting them to our review process, we can automate the publishing of those changes when we merge the changes. A simple Jenkins job will suffice that is triggered on merge and runs dnscontrol push.</p><p><em>Originally published at </em><a href="https://chromatichq.com/blog/managing-dns-records-version-control"><em>chromatichq.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13766ae1b11e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluating Tools For Building a Component Library]]></title>
            <link>https://medium.com/@ChromaticHQ/evaluating-tools-for-building-a-component-library-e02e1ebcb32f?source=rss-4fdf26861308------2</link>
            <guid isPermaLink="false">https://medium.com/p/e02e1ebcb32f</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[component-libraries]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Chromatic]]></dc:creator>
            <pubDate>Fri, 25 Aug 2017 13:45:40 GMT</pubDate>
            <atom:updated>2017-08-30T15:43:43.892Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*go5FSjlmQR7zdU2VqUhyWw.jpeg" /></figure><p>Component libraries are living inventories of <a href="http://rizzo.lonelyplanet.com/styleguide/ui-components/buttons">user interface elements</a> (components). Also known as style guides or pattern libraries, they serve as a canonical design and development guide for every digital property within an organization. Referencing and reusing their code then makes building each new experience <a href="http://atomicdesign.bradfrost.com/chapter-1/#style-guide-benefits">easier, faster, and more consistent</a>.</p><p>Chromatic recently embarked on rebuilding the front end of a client’s online presence. Fortunately, the client was quick to understand the importance of starting with a component library. I hadn’t yet built one for a client, but I’d heard of a few tools used to do so while following the chatter around them. What I didn’t realize was just how many helpful tools there were.</p><p>The most valuable starting point I found was <a href="http://styleguides.io/">styleguides.io</a>, built primarily by <a href="http://www.maban.co.uk/">Anna Debenham</a> and <a href="http://bradfrost.com/">Brad Frost</a> (the authors of the recently released <a href="http://www.maban.co.uk/projects/front-end-style-guides/"><em>Front-end Style Guides</em></a> and <a href="http://atomicdesign.bradfrost.com/"><em>Atomic Design</em></a>, respectively). After browsing a few <a href="http://styleguides.io/examples">examples</a>, I started digging into the extensive list of <a href="http://styleguides.io/tools">tools</a>. It didn’t take long to realize that there were no obvious, one size fits all solutions.</p><p>A bit overwhelmed, I realized I needed to first define what I considered most important for this specific project. I could then use those considerations to evaluate each tool. I settled on the following list, which I share with hope that it helps others make a similar decision.</p><h3>What to consider when evaluating tools</h3><h4>Popularity and community support</h4><p>The relative popularity and support of open source projects is extremely important to me. I start by glancing around the GitHub repository: the number of stars, forks, commits, contributors, and issues. I want it to be battle tested. I also want to see recent commits and releases. I don’t want to bet my client’s money on a project that isn’t mature, or perhaps it is, but has sat idle for a few years (an eternity on the web). If I find and/or fix a bug, I want to be able to expect a response, and to know that any shortcomings may still be a work in progress.</p><h4>Integration with the specific project</h4><p>As mentioned in <a href="http://clearleft.com/thinks/382"><em>On Building Component Libraries</em></a> by <a href="http://allmarkedup.com/">Mark Perkins</a> (another thought leader on this topic), “Integration is hard, so figure it out first.” I don’t want to pick a tool that adds too much complexity to the client’s existing workflow and infrastructure. I want to find the tool that provides the least amount of friction and provides value far into the future. Maybe even find the Holy Grail, where a website’s front end can use the same CSS, JS, and/or template files as the library.</p><h4>Developer experience and documentation</h4><p>Even if a tool fits well within the client’s workflow, developers will not maintain it if it isn’t easy to do so. The development team must be the champions of a component library. As developers roll on and off the project, they will not fight to keep it if they only consider upkeep a burden. It shouldn’t take hours of internal READMEs to understand the library’s directories and files. There should also be a wealth of documentation online. Modifying and extending the library should be anything but a mystery.</p><h4>Aesthetics and user experience</h4><p>The component library should become a useful resource for many throughout the client’s organization. If it becomes a complex interface built by developers for developers, it won’t be easy to reference, and it will not be widely adopted. Additionally, like <a href="http://styleguides.io/examples">many before us</a>, we intend to one day make it publicly accessible. This means that it needs to represent the client’s brand and, quite frankly, look good while doing it. Bonus points for being able to integrate the client’s branding.</p><h4>The ability to build and preview page prototypes</h4><p>Along with listing the components, we want to use the tool to construct and preview page prototypes. These prototypes, ideally free of the cruft that creeps in to slow a website down, will inform performance benchmarks and <a href="https://timkadlec.com/2013/01/setting-a-performance-budget/">budgets</a>. We will then measure against these budgets as we integrate the components into the production website. This will also make it much faster to preview (in the browser) what a new type of page will look like before implementing it.</p><h4>The ability to house additional documentation</h4><p>We hope for our component library to evolve into a bit more than a reference for code snippets and styles. Brand guidelines is a good example. Regardless, we want the flexibility to add pages of textual documentation. Many component library tools include this feature, but not all do. Sure, one could argue that is beyond the scope of a component library. But using one less tool and having one less place to reference is a win in my book.</p><h3>Tools we evaluated</h3><p>While this post isn’t about what we landed on, I’d imagine some folks are curious. So with those criteria in mind, we narrowed down our list to 3 tools built with <a href="https://nodejs.org/en/">NodeJS</a> (easiest to introduce into the client’s workflow). Those tools were <a href="http://patternlab.io/">Pattern Lab</a>, <a href="http://fractal.build/">Fractal</a>, and <a href="http://astrum.nodividestudio.com/">Astrum</a>. All are impressive tools, but each had strengths and weaknesses when it came to our needs.</p><h4><em>Pattern Lab</em></h4><p>With roots in Brad Frost’s Atomic Design, Pattern Lab is easily the most popular tool and receives the most support. It is flexible and has great documentation. While its toolbar has great responsive preview functionality, I wasn’t excited about the aesthetics of it. Pattern Lab also didn’t fulfill our need for additional pages of documentation.</p><h4>Fractal</h4><p>Brainchild of <a href="https://chromatichq.com/blog/clearleft.com">Clearleft</a>’s Mark Perkins, Fractal has an extremely simple directory and file system. It is also flexible, has great documentation, and a great design. The interface for viewing component information is also quite nice. It appears to be the least used, but it is actively maintained (with a <a href="https://github.com/frctl/fractal/issues/199">new version in the works</a>).</p><h4>Astrum</h4><p>Astrum fell in the middle of the road for me. It, too, is actively supported, and is lightweight and flexible. It’s well designed and has the ability to add pages of documentation that look great. Unfortunately it didn’t seem to have the ability to prototype pages and view them within the interface.</p><h3>Fractal saves the day</h3><p>We went with Fractal. I was a bit hesitant to choose a less popular tool with a looming major upgrade, but its development is top notch. I was also happy to see <a href="https://rachelandrew.co.uk/archives/2016/05/06/rebuilding-the-perch-ui-creating-a-pattern-library/">that others have made the same choice</a>. It has the features we need, and I’m happier than I should be with how simple the directory and file structure is. The documentation has also been super helpful thus far. We’ve customized it with our client’s branding and are ready to roll.</p><p>Be sure to reach out to <a href="https://twitter.com/chromatichq">@ChromaticHQ</a> or <a href="https://twitter.com/guschilds">@guschilds</a> on Twitter if I’ve missed anything or if you have any questions!</p><p><em>Originally published at </em><a href="https://chromatichq.com/blog/evaluating-tools-building-component-library"><em>chromatichq.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e02e1ebcb32f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing fastly-cli]]></title>
            <link>https://medium.com/@ChromaticHQ/announcing-fastly-cli-c9c7cd45a2e0?source=rss-4fdf26861308------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9c7cd45a2e0</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[content-delivery-network]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Chromatic]]></dc:creator>
            <pubDate>Sun, 11 Jun 2017 14:34:13 GMT</pubDate>
            <atom:updated>2017-06-11T14:34:13.355Z</atom:updated>
            <content:encoded><![CDATA[<h4>Purge Fastly caches quickly, easily and automatically.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6zHk-jq8q8pIb2yUBpkMTg.jpeg" /></figure><p><a href="https://github.com/ChromaticHQ/fastly-cli">fastly-cli</a> is a command-line interface (CLI) for the <a href="https://www.fastly.com/">Fastly CDN</a> written in node.js. It currently supports checking cache status by URL, clearing caches by URL/cache key, or clearing the entire cache, as well as supporting Fastly’s <a href="https://www.fastly.com/blog/introducing-soft-purge-more-efficient-way-mark-outdated-content">Soft Purge</a> functionality by default, with an option to execute a more traditional purge.</p><h3>The Backstory</h3><p>We recently migrated <a href="https://chromatichq.com/">chromatichq.com</a> to Fastly’s CDN. After this migration was complete and we were serving content via Fastly’s network, we began exploring how to make the purging of caches fast and efficient via the command line. Fastly features a <a href="https://docs.fastly.com/api/">robust API</a> and some searching uncovered a <a href="https://github.com/thisandagain/fastly">lightweight client</a> written in node.js. This was enough to send us off to the races writing a simple command-line interface (CLI) for the Fastly API using node.js, hence: <a href="https://github.com/ChromaticHQ/fastly-cli">fastly-cli</a>.</p><h3>🎉🍾🎊</h3><p>If you are a Fastly user, we hope this is useful to you and would love any feedback or contributions you may have. Enjoy!</p><h3>Install fastly-cli</h3><p>To use fastly-cli, you’ll most likely want to install it as a global package so it is available to you from any location; both npm and yarn make this easy.</p><h3>via yarn</h3><pre>yarn global add fastly-cli</pre><h3>via npm</h3><pre>npm install -g fastly-cli</pre><p><em>Originally published at </em><a href="https://chromatichq.com/blog/announcing-fastlycli"><em>chromatichq.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9c7cd45a2e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Reviews are Worth Their Weight in Gold]]></title>
            <link>https://medium.com/@ChromaticHQ/code-reviews-are-worth-their-weight-in-gold-f094387f9545?source=rss-4fdf26861308------2</link>
            <guid isPermaLink="false">https://medium.com/p/f094387f9545</guid>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Chromatic]]></dc:creator>
            <pubDate>Thu, 02 Mar 2017 16:29:12 GMT</pubDate>
            <atom:updated>2017-03-02T16:29:12.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0HChutIUVwAKZfCP_msmZQ.jpeg" /></figure><p>A good code review is like a good home inspection. It ensures that the original architectural drawings were followed, verifies that the individual subsystems are built and integrated correctly, and certifies that the final product works and adheres to standards. In the world of software development, a “code inspection” often takes the form of a <a href="https://en.wikipedia.org/wiki/Distributed_version_control#Pull_requests">pull request</a>. A pull request, by its nature, simply shows line by line information for all of the updated or added files. This allows developers, who didn’t write the code, to perform a code review and approve the changes before they are merged into the codebase.</p><h3>Why Code Reviews are Important</h3><p>Code reviews are not just a quality assurance (QA) process with a different name. They offer a wide variety of benefits that go well beyond the inherent advantages of a QA process.</p><h3>Training / Mentorship</h3><p>Deadlines often mean that time is not set aside for mentoring developers, or when it is, finding scenarios to illustrate various ideas are hard to find. Code reviews offer a great way to organically integrate training and mentorship into everyday workflows. It allows developers to learn from each other and leverage the years of experience from everyone involved. Senior developers are able to impart background knowledge of past decisions and provide guidance on a variety of best practices.</p><h3>Accountability</h3><p>Knowing that another developer will be looking over your changes line by line forces you to think more deeply about your code as you write it. Instead of thinking “what is the fastest way to accomplish this task,” you are forced to think about the right way to build functionality. Your end goal is code that not only fulfills the scope of the ticket, but that is easy for others to understand and review.</p><h3>Sharing the Load / Burning Down the Silos</h3><p>Software development often requires specialization. When everyone’s work is visible in a pull request, it offers others the chance to see how unfamiliar problems are solved. This allows everyone to ask questions that help others, encourage additional learning, and diversify developers’ knowledge. Also, when things do break, more members of the team will have know-how to quickly track down the bug.</p><h3>Code Quality</h3><p>Peer reviews help ensure that any code that is committed to the codebase is not only functional, but meets quality standards. Typically, this means that it:</p><ol><li>Works.</li><li>Has good documentation.</li><li>Meets code style guidelines and best practices.</li><li>Is performant.</li><li>Doesn’t add unnecessary lines (uses existing APIs).</li><li>Properly abstracts code where appropriate (adheres to <a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself">D.R.Y.</a> principles).</li><li>Is future-proofed as well as possible.</li></ol><h3>Maintainability</h3><p>Senior developers may know about needs for future planned functionality or the needs of another internal team and can help steer current architecture and code changes to support those efforts. Some additional work now may pay huge dividends in the future by simplifying the addition of new features and maintaining existing functionality.</p><h3>Reducing Risk</h3><p>A peer review requires a pull request that is able to be comprehended by another developer. By introducing a peer review workflow, pull requests often decrease in size to aid the review process. This reduces risk, as often this relies upon smaller more discreet change sets instead of monolithic changes in a single pull request. Additionally, by having developers with varying areas of expertise, potential security risks are reduced by catching issues during the peer review process instead of after they’ve made it out to production.</p><h3>How to Do a Code Review</h3><h4>Creating a Pull Request</h4><p>For a peer review process to reach its full potential, it requires a skillful reviewer, but also a well-prepared pull request. A pull request might receive many reviews, but the first review it should receive is from its author. When preparing your own pull request for review by others, there are many things that can be done. These include:</p><ul><li>Provide context for the changes by including a summary.</li><li>Document outstanding questions/blockers if further progress is pending feedback.</li><li>If necessary, clear up any potential areas of confusion ahead of time with preemptive comments.</li><li>Realize that if confusion could exist, perhaps the code or the code comments need improvement.</li><li>Attach screenshots of the functionality in action to provide additional context.</li><li>Ensure reviewers are aware of the state of your pull request and are notified when their review is needed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/0*32TQ4CqIf-H5Da11.png" /></figure><h4>Reviewing a Pull Request</h4><p>Providing feedback on a pull request is a lot like coaching, it requires building trust, adjusting to the situation and the player, and treating everything as a teachable moment. Let’s walk through some of Chromatic’s tried and true techniques.</p><ul><li>Cite requests with links to posts, code standards guidelines, etc. when pointing out lesser known things or to build rapport with a developer not aware of your expertise.</li><li>Ask leading questions that help other developers see things from your perspective instead of just saying “change this.”</li><li>Keep it fun and where possible, introduce some self-deprecating humor. Bring up your own past mistakes as evidence for why an alternate approach should be considered.</li><li>Acknowledge when you are nitpicking to make feedback more palatable.</li><li>Avoid pointing out problems without providing solutions.</li><li>Denote a few instances of a repeated mistake or enough to establish a pattern, then request that they all be fixed.</li><li>Ask questions. Doing so allows you to learn something and the author is forced to think critically about their decisions.</li><li>Explain the why of your requested change, not just the what.</li><li>Avoid directing negativity at the developer, instead focus on how the code could be improved.</li><li>Enforce the use of a <a href="https://chromatichq.com/blog/learn-and-enforce-coding-standards-php-codesniffer">code sniffer</a> to prevent wasting time nitpicking code style.</li><li>Make note of the good parts of the code code and celebrate when you or others learn new techniques through the process.</li><li>Avoid bikeshedding on trivial issues.</li><li>Realize when optimization is no longer useful and avoid over engineering solutions.</li><li>Remember that the goal isn’t to find fault, it is to improve the codebase and teach others along the way.</li><li>Written communication may not come off in the same tone as it was intended, so error on the side of friendliness.</li><li>Treat others how you want to be treated. This is a simple rule, but such an important one. Consider how you would feel receiving this review, and be sure to write your review accordingly.</li></ul><h4>Establishing a Workflow</h4><p>A pull request won’t merge itself, request feedback, or implement the feedback it was given. Thus, having clear expectations for who creates, updates, reviews, and merges a pull request is crucial. For example, after a pull request has been created, is it the responsibility of the developer to solicit feedback until it is approved and merge it themselves, or does a development manager take ownership of every pull request and merge it when they deem it ready? A good workflow should have just enough rules to work, without overly burdening developers and will likely vary per project or per team. The correct workflow is the one that works for you, the important part is that you have one, and that it includes a code review.</p><h3>In “Review”</h3><p>Adding a code review step to your development workflow might slow things down at first. However, in short order it will invariably show itself to be a worthwhile investment. Code reviews are an invaluable tool for mentoring, improving accountability, sharing knowledge and enhancing overall code quality. Now that you have reviewed this post, if you approve it, then merge it into your team’s workflow.</p><p>The bad puns are done, but if you want to continue the discussion on code reviews, reach out to us on Twitter <a href="https://twitter.com/chromatichq">@chromatichq</a>.</p><p><em>Originally published at </em><a href="https://chromatichq.com/blog/code-reviews-are-worth-their-weight-gold"><em>chromatichq.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f094387f9545" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>