<?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 Henry Warren on Medium]]></title>
        <description><![CDATA[Stories by Henry Warren on Medium]]></description>
        <link>https://medium.com/@henry.warren?source=rss-6d49e3c5fa22------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_JqpX8ZtyPYswGrc.jpg</url>
            <title>Stories by Henry Warren on Medium</title>
            <link>https://medium.com/@henry.warren?source=rss-6d49e3c5fa22------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 11:49:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@henry.warren/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[A First Hackathon Experience at Compass]]></title>
            <link>https://medium.com/compass-true-north/a-first-hackathon-experience-at-compass-30db4b3eb2f7?source=rss-6d49e3c5fa22------2</link>
            <guid isPermaLink="false">https://medium.com/p/30db4b3eb2f7</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[compass]]></category>
            <dc:creator><![CDATA[Henry Warren]]></dc:creator>
            <pubDate>Mon, 23 Dec 2019 17:01:01 GMT</pubDate>
            <atom:updated>2019-12-23T17:01:01.080Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_2OjOk1FfoHTnKTC9j1fzA.jpeg" /></figure><p>Fall in New York is a very special time of year. The leaves in the parks turn, the streets are graced by crisp Atlantic air, and the days of sweating on the subway platforms are but a repressed memory. This past November, as most New Yorkers pulled on their sweaters and geared up for Turkey day, Product &amp; Engineering employees over at Compass geared up for another event: the Compass November Hackathon.</p><p>There are few traditions more celebrated in engineering organizations than hackathons. These events bring engineers together for the love of what got many of them into the profession in the first place; the joy of building things. The Compass Fall Hackathon was my first hackathon to date, and I hope to participate in many more to come.</p><p><strong>Event Overview</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LzSJnECNkcsQYXHudlSZiQ.png" /></figure><p>The rules for the hackathon were straight forward: Five-person teams had five days to hack together focused software projects, followed by a demo day consisting of deliverable presentations from every participating team across our three national engineering offices. A panel of judges would then review these presentations and decide on winners.</p><p>On the technical side of things, Compass was fortunate enough to have the nice folks over at Amazon Web Services sponsor our Hackathon with a dedicated account with $50,000 worth of compute credit — a very sweet perk indeed. Our 40+ hackathon teams made great use of this resource.</p><p><strong>Let the Games Begin!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80hRI2P3zDFt7XaEoi1f8A.jpeg" /></figure><p>The hackathon began on a Thursday. After the ceremonial kickoff in the morning, it was go time. My team sought out to build a search tool to help Compass agents find agent-to-agent referrals easier. For our project, we chose to use one of the common web-based stacks that we use at Compass (React/Go/Postgres). We all had familiarity with these technologies, and with only five days to build a demo-worthy prototype, we didn’t want a new stack to hinder our development velocity. We made sure to devote a good bit of time planning our technical approach, spending the majority of our first day creating requirements and diagramming our architecture on a whiteboard. Walking through the halls of the 10th floor that night, the amount of whiteboards and glass walls littered with bullet-pointed lists and arrow diagrams were telling that it was a planning day for many teams at HQ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0bmYnKg3qjJLrkGhVzQXlA.png" /><figcaption>All hands on deck!</figcaption></figure><p>Once we had figured out what steps needed to be taken to make our vision a reality, we divided and conquered, spending much of Friday setting up our infrastructure and writing our backend service. Saturday and Sunday were spent hacking away, wrangling data and iterating on our frontend UI. By Monday, we were continuing to polish our frontend, squashing bugs up until the deadline.</p><p><strong>Demo Day</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Go9PRANYy0fjgWCOnT2mIw.jpeg" /><figcaption>A team demoing their virtual reality project</figcaption></figure><p>Demo day at HQ was nothing short of a spectacle. Hackathon teams from New York, D.C. and Seattle tuned in to present projects ranging from augmented and virtual reality experiences, to innovative new mobile features, and everything in between. Our team was fortunate enough to be one of the first presenters, allowing us to sit back, relax, and fully enjoy the rest of the demos. Above all else, demo day made me feel extremely proud and humbled to work with such a talented group of individuals here at Compass.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DmSLLNB1GbmKa7sbsd7jvg.jpeg" /></figure><p><strong>Take Aways</strong></p><p>Being my first hackathon, there are a few key takeaways that I’ve considered for my next hackathon that I’d like to share with anyone else who may be interested in participating in such an event:</p><ul><li>Practice your pitch, then practice it again.</li><li>Don’t wait to build your UI.</li><li>Commit to some level of code quality, even in a hackathon setting.</li><li>Go back and practice your pitch again!</li></ul><p>Last but certainly not least, a huge thank you is in order to everyone who helped coordinate this event and made this experience possible. I couldn’t imagine a better first hackathon experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30db4b3eb2f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/compass-true-north/a-first-hackathon-experience-at-compass-30db4b3eb2f7">A First Hackathon Experience at Compass</a> was originally published in <a href="https://medium.com/compass-true-north">Compass True North</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concurrent Programming in Go]]></title>
            <link>https://medium.com/compass-true-north/concurrent-programming-in-go-de33441ace1c?source=rss-6d49e3c5fa22------2</link>
            <guid isPermaLink="false">https://medium.com/p/de33441ace1c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[goroutines]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Henry Warren]]></dc:creator>
            <pubDate>Mon, 08 Jul 2019 19:27:23 GMT</pubDate>
            <atom:updated>2019-07-15T18:18:33.340Z</atom:updated>
            <content:encoded><![CDATA[<p>A quick case study.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I71xKSGmKet3z6dVPEdtKg.png" /></figure><p><em>Special thanks and credit to </em><a href="https://medium.com/@danmcclure"><em>Dan McClure</em></a><em> for implementation of RunAsync</em></p><p>First and foremost, I’d like to say that working with Go the past six months at <a href="https://grnh.se/ae70a06b1">Compass</a> has been nothing short of a joy. The language’s uncompromisingly simple feature set and familiar syntax has made it the most legible, learnable, and maintainable language I’ve had the pleasure of working with. From type inference, to first-class functions, to duck-typing, Go picks its design battles wisely. While Go has many compelling features, today I’m going to touch on Go’s concurrency model, and one example of how we’re harnessing its power to build better software at Compass. As a disclaimer, this article does assume an introductory level knowledge of Go.</p><h3><strong>Terminology Review</strong></h3><p>Before getting into the how and why, let’s briefly cover the what. There are two primary elements of Go’s concurrency model:</p><ul><li><strong>Goroutines</strong></li><li><strong>Channels</strong></li></ul><p>A <a href="https://tour.golang.org/concurrency/1"><strong>Goroutine</strong></a> is a concurrent thread of execution. Compared to traditional threads, goroutines are computationally much cheaper to utilize. They have much faster startup times and take up minimal space on the stack. To spawn a new goroutine, you simply precede a function call with the keyword <em>go</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22ab632bf69bef915bd1a219f7f7be14/href">https://medium.com/media/22ab632bf69bef915bd1a219f7f7be14/href</a></iframe><p>A <a href="https://tour.golang.org/concurrency/2"><strong>Channel</strong></a><strong> </strong>is the conduit through which goroutines communicate with one another via message passing. Channels typically use blocked message passing, although <a href="https://gobyexample.com/non-blocking-channel-operations">non-blocking channel operations</a> are possible as well. Channels are how goroutines share data with one another without the complexity and safety concerns that come with sharing memory. In terms of usage, a channel can essentially be thought of as a typed queue with optional capacity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8627b646c0b1a15b18a61338d6b0c17f/href">https://medium.com/media/8627b646c0b1a15b18a61338d6b0c17f/href</a></iframe><h3><strong>A Case for Concurrency</strong></h3><h4>Background</h4><p>In a <a href="https://en.wikipedia.org/wiki/Microservices">microservice</a> architecture such as Compass’, each microservice owns its own data exclusively and provides an API for other services to query this data. While defining the scope of a microservice is often a point of contention, for us it boils down to a service that <em>does one thing, and one thing well</em>. In practice, this often takes the form of feature-based microservices.</p><h4><strong>Problem</strong></h4><p>Our team was recently tasked with building the web API for an analytics application — one that would require data pertaining to customer usage of roughly a dozen different features on a per-customer basis, in real time. In terms of technical implications, this meant that to serve a request, we’d need to <strong>query the APIs of many disparate microservices, process their data into a consistent format, and aggregate all of this data into a single response payload</strong>. With performance at the front of our minds, we knew that the only way for this map-reduce operation to be feasible would be to make the microservice API calls concurrently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*8IStDQVxlvugVF_HKmfZGg.png" /><figcaption>Fanning out API calls over RPC to many feature-based microservices</figcaption></figure><h4><strong>Go Time</strong></h4><p>Luckily for our team, our need to execute functions concurrently was hardly a novel one. In fact, the gophers at Compass had already implemented an extremely helpful utility function titled <em>RunAsync</em> for this exact purpose (huge shoutout to <a href="https://medium.com/@danmcclure">Dan McClure</a>, the author of this very clever utility). <em>RunAsync</em> had a simple and elegant objective; to execute any list of functions concurrently, exiting and returning on the first encountered error.</p><p>RunAsync alone got us 95% of the way there. However, our use case did not require such a strict approach to error handling. For this reason, we created <em>RunAsyncAllowErrors</em>. As opposed to exiting early and returning the first error, <em>RunAsyncAllowErrors</em> returns an indexed list of errors encountered, always waiting to return until all functions have finished executing.</p><p>Enough talk, let’s look at some code. Note that early exit conditions and other optimizations have been removed for readability sake.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b94038a29ba216d14ec1cea1f6debd2/href">https://medium.com/media/8b94038a29ba216d14ec1cea1f6debd2/href</a></iframe><p>There’s quite a bit to unpack in this code. While the core concurrency logic is fairly straight forward (spawning goroutines in a for loop, capturing their errors, joining them), there are some interesting things that take place in regards to error handling.</p><p>This utility is powerful in that it handles both explicitly thrown errors as well as runtime panics. For the latter type of error, the helper function <em>formatStack</em> is used to parse the ugly stack trace thrown by the panic error and extract only the line that we care about.</p><p>While many gophers would simply write their concurrent logic inline, we’ve found that for safer concurrency, a single generic concurrency utility like <em>RunAsyncAllowErrors </em>can be advantageous. Of course, the tradeoff is that this utility becomes a single point of failure, so you better get it right (took us a couple of patches). Now that we’ve walked through the code and discussed its functionality, let’s take a look at a simple usage example.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6990b5cc543acaff38479597705ac06/href">https://medium.com/media/f6990b5cc543acaff38479597705ac06/href</a></iframe><p>That’s pretty cool, but only useful for executing asynchronous tasks with no associated state. If you refer back to the code for <em>RunAsyncAllowErrors</em>, you’ll recall that a <em>GenericFunction</em> is a function that takes no arguments and returns an error (or nil). But what if we want to concurrently execute functions that don’t conform to the signature of a <em>GenericFunction</em>? Let’s start by seeing how we can concurrently execute functions that take different arguments.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cca973bc3bef02b159e078d2323c02b/href">https://medium.com/media/6cca973bc3bef02b159e078d2323c02b/href</a></iframe><p>Go’s support for closures allows us to wrap a <em>GenericFunction</em> in the context of a scope that has access to values not explicitly passed into the <em>GenericFunction</em> as arguments. In this example, we’re getting our <em>GenericFunction</em> as the return value of a higher-order function that wraps it, but the same effect can be achieved inline as well. Now that we can pass arguments in, let’s see how we can capture return values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b15bf02804180b9620d58c6376c4e9b4/href">https://medium.com/media/b15bf02804180b9620d58c6376c4e9b4/href</a></iframe><p>Once again, closures save the day. Just like how closures allow us to preserve <em>values</em>, they also allow us to preserve <em>references</em> to objects outside of the current scope using pointers. To scale our example, we’d probably want to define a structure to hold all of the state we want to pass around to each function. We’d also want to handle and propagate errors of course.</p><h3><strong>Go Forth and Prosper</strong></h3><p>In the context of a larger paradigm shift towards concurrent programming, Go’s concurrency features are a great tool for both learning about concurrency and using it to optimize your codebase. If you enjoy Go as much as we do, make sure to keep an eye out for more content from Compass. Oh, and we’re hiring! We hope this article was helpful, thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de33441ace1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/compass-true-north/concurrent-programming-in-go-de33441ace1c">Concurrent Programming in Go</a> was originally published in <a href="https://medium.com/compass-true-north">Compass True North</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>