<?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[FloSports Engineering - Medium]]></title>
        <description><![CDATA[Experience, ideas, half-baked thoughts, and ramblings from the coders, testers, devops, hackers, and geeks at FloSports. https://www.flosports.tv - Medium]]></description>
        <link>https://medium.com/flosports-engineering?source=rss----b517ac6fa4a8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>FloSports Engineering - Medium</title>
            <link>https://medium.com/flosports-engineering?source=rss----b517ac6fa4a8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:20:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/flosports-engineering" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a React Component Library: FloSports Edition]]></title>
            <link>https://medium.com/flosports-engineering/building-a-react-component-library-flosports-edition-5c018eba12d5?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/5c018eba12d5</guid>
            <category><![CDATA[storybook]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[component-libraries]]></category>
            <category><![CDATA[radix-ui]]></category>
            <dc:creator><![CDATA[Michael Vessia]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 17:54:21 GMT</pubDate>
            <atom:updated>2023-06-13T17:54:21.852Z</atom:updated>
            <content:encoded><![CDATA[<p>How to Build a React Component Library that Flo’s Your Boat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Na1EPwcgVs7-tSy7AkXOeA.jpeg" /></figure><h3>Why Are We Building This?</h3><h4>One Flo Platform</h4><p>As you may have heard, for FloSports, 2023 is the year of re-platforming. As such, we are rebuilding our webapp from the ground up. Our main site is an Angular 14 application that has been in production for years, successfully serving live streams, video on demand, articles, sports data and more to our users across 25+ different sports. Why go through the massive undertaking to rewrite it?</p><p>To understand the motivation behind the decision, I highly recommend checking out <a href="https://medium.com/u/c9189d72fe98">Gene Chuang</a>’s post <a href="https://engineering.flosports.tv/one-platform-to-rule-them-all-f87297477e39">One Platform to Rule Them All</a> which contains more detail about our re-platforming effort.</p><p>What is most relevant here is we don’t just have a single Angular application, we have several applications running different tech stacks. We need to consolidate on one for our long term success, and we’ve chosen React as the foundation for the frontend. Why not double down on Angular? We do have Angular expertise in house, we’ve learned a lot about <a href="https://engineering.flosports.tv/simple-stream-composition-40e0165a7f6a">RxJS and Functional Reactive Programming</a>, and we could certainly re-use some of that code, right?</p><p>Ultimately we want to bet on the winners and we feel confident that React and NextJS have won the framework war and will provide a robust and performant foundation for us to build upon for OFP. We also plan to unify our codebases across platforms with React Native as we have native apps on iOS, Android, and all the major TV application platforms. In addition, it is becoming harder to find engineers who are excited to work with Angular as it fails to top developer satisfaction surveys annually. See some of the 2022 developer satisfaction surveys here: <a href="https://survey.stackoverflow.co/2022/#section-most-loved-dreaded-and-wanted-web-frameworks-and-technologies">Stack Overflow</a>, <a href="https://jamstack.org/survey/2022/#frameworks-by-usage-and-satisfaction">Jamstack</a>, <a href="https://2022.stateofjs.com/en-US/libraries/front-end-frameworks/">StateOfJS</a>. What we found when surveying our engineers internally was that we also have a large amount of engineers with prior production React experience, which will help with our migration effort. <strong>Building on a modern React stack will allow us to scale our team more easily in the future.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdkQ1HJIm3ofZgfHpnO-5w.png" /><figcaption>The parts of our stack most relevant to this effort are circled in purple, taken from One Platform to Rule Them All</figcaption></figure><h4>Consistent User Experience</h4><p>As our team and application have grown, we have found that it can be easy to implement what should be identical features in different parts of the app that differ in some way. These differences may be slight but they compound, as the next time you go to build something similar you don’t know which one to use as a base, and maybe you now have one more variation. When you add in the complexity of having acquired companies and codebases with completely different UI frameworks and design systems in place, there is even more variance in the user experience.</p><p>Given that we are building from scratch, we have a fantastic opportunity to create a core set of re-usable components to ensure that we don’t go down that same path of inconsistency. We can have shared layouts across pages which in turn are built from re-usable components from our component library. This ensures each screen has a uniform look and feel that matches the vision our design and product teams have. <strong>We have to think about our design system and component library up front, or we will eventually run into the same issues as we scale.</strong></p><h3>Boost Developer Productivity</h3><h4>Stop Re-Inventing Wheels</h4><p>I do not want to imagine the amount of engineering hours we have collectively spent over the years building things like tables, drop-downs, carousels, buttons, links, and other foundational web components due to new feature requests, changing teams and tech stacks, new designers, or integrating acquisitions. However, we do have to keep in mind that we have many implementations of things like tables for a reason — we’ve built a lot of features over time. Our new OFP table needs to be robust enough to support a varied set of features that will satisfy our users. <strong>We want to stop re-inventing wheels and focus on delivering unique experiences to sports fans.</strong></p><h4>Single Source of Truth</h4><p>Building new user experiences is unlikely to ever be quite like stacking legos, but the closer we can get to that ideal the faster we can bring features to market and wow our customers. When product makes a request for a page that has a tab navigation component, developers don’t need to dive into complex application code to figure out what component to use, they know that the one in our component library is the correct one, and that they can import and use it in their app. If we do a good job building this, each component will be well documented and will also have a consistent API that matches all the other components from our library that they’re used to using. <strong>A core set of building block components that we can compose into various layouts and pages will allow us to iterate and ship quality experiences quickly.</strong></p><h4>Accelerate Our Development Process</h4><p>Having a core set of UI components that developers can use, not just in one web application but across many product engineering teams, has numerous benefits. Here’s a few, for example:</p><ul><li>Frontend developers can more easily move across projects and teams with lower ramp up time if they can pull in components from a familiar library</li><li>Bug fixes, performance boosts, and other improvements to the library benefit everyone, not just one application</li><li>Unnecessary communication back and forth with designers is lessened as new pages can ideally be built from some combination of pre-existing components and layouts</li></ul><h3>How Do We Get There?</h3><h4>Pre-Requisite Design Work</h4><p>Loads of fantastic work has been done by our product and design teams, and while that will not be the focus of this post, there are some pre-requisite things that needed to be done before we could start building.</p><p>Some of the things that we set out to accomplish were:</p><ul><li>Creating a catalog of distinct page designs and layouts. We have a core set of experiences that we want to deliver to users. Our varied pages like video, results, rankings, editorial content all have common elements. We needed to identify what those are and create a set of several layouts that we can tweak for re-use for different pages.</li><li>Building out design tokens. We had to establish and agree upon colors, typography, shadows, borders, spacing, icons, and more.</li><li>We had to select a set of icons/SVGs that will be available for use in our components</li><li>We needed to create developer-ready designs in Figma for our foundational “atom” components to unblock development</li></ul><p>In short, we had to create the beginnings of our new design system and style guide so that we can begin to translate that into code.</p><p>Here are some examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y8CPqFN6eYyk9DQbp47yuQ.png" /><figcaption>A snapshot of our Color Palette</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*uPgnWG5D1x_mUlY9g-0Blw.png" /><figcaption>Some classes that are available for styling text</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmGXH6iw1D4Hv2fE18F0pA.png" /><figcaption>Some of our Typography elements in use</figcaption></figure><h4>Foundational Engineering Decisions</h4><p>Before writing any code, there are many big decisions that need to be made. Ultimately dozens of micro-decisions will cascade from each of those larger decisions, but those don’t necessarily need to be done up front.</p><p>Some of the ones that we <strong>had</strong> to tackle before we could begin, in no particular order:</p><ol><li>Should we use a monorepo or should we have our component library in its own separate repository?</li><li>How should we build and deploy our component library?</li><li>Where should the documentation for our components live?</li><li>How should we write our CSS?</li></ol><ul><li>Should we use straight CSS with SASS or CSS Modules?</li><li>Should we stick with <a href="https://getbootstrap.com/">Bootstrap</a> since we’re all used to it?</li><li>What’s that <a href="https://tailwindcss.com/">Tailwind CSS</a> thing I keep hearing about on Twitter?</li><li>Should we use CSS-in-JS libraries like <a href="https://styled-components.com/">Styled-Components</a>, <a href="https://emotion.sh/docs/introduction">Emotion</a>, or <a href="https://stitches.dev/">Stitches</a>?</li><li>Do we allow developers to pass in CSS properties to components with something like <a href="https://styled-system.com/">Styled-System</a>? Should they have to wrap components and override base CSS? Can we accept CSS classnames as props and apply styles that way?</li></ul><p>5. Should we use something with more “batteries included” like <a href="https://mui.com/material-ui/">MUI</a>, <a href="https://ant.design/">Ant Design</a>, <a href="https://chakra-ui.com/">Chakra</a>, <a href="https://daisyui.com/">DaisyUI</a> or <a href="https://mantine.dev/">Mantine</a>?</p><p>6. Should we use a behavior library like <a href="https://headlessui.com/">HeadlessUI</a> or <a href="https://www.radix-ui.com/">Radix</a>? Should we go even lower level and use something like <a href="https://react-spectrum.adobe.com/react-aria/getting-started.html">React-Aria</a> hooks?</p><p>7. How do all of the above decisions play with NextJS 13 and server-side rendering?</p><h3>The Path We’ve Chosen</h3><p>Each of these could probably have its own blog post with pros/cons and things we learned, but I will just summarize our choices with a brief reason as to why we went that way. As we build and learn we’ll discover more decisions that we have to make, but the great part of having a separate component library is that the impact of most of the decisions are isolated to one package and everyone benefits from the result of the effort.</p><h4>Our component library will live in a monorepo alongside our NextJS web application</h4><ul><li>Shared build, linting, and test configuration across projects in our monorepo</li><li>Developer experience is optimized as we can just import components and types across packages without having to deal with local linking of a separate NPM library</li><li>We can still individually version packages using semantic versioning</li></ul><h4>The component library will be built with Storybook + Vite and deployed as its own SST stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/130/1*5b7EtCk3rnNEVW-qfO16Sw.png" /></figure><ul><li>We use Storybook in our Angular app today and the team likes it</li><li>Storybook support for React is far superior to the Angular experience, so we’ll be sure to enjoy it even more</li><li>We can add the style guide and documentation inside Storybook using MDX</li><li>SST still allows us to have storybook preview environments for each PR, something we have become accustomed to with our current Kubernetes setup.</li><li>Building on Vite with tests written in Vitest makes local development lightning fast⚡️</li></ul><h4>We will write CSS using Tailwind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/54/1*YMpIQoayaUStvSAXCbgITA.png" /></figure><ul><li>Tailwind is utility class based, and that is how we were using Bootstrap, for the most part</li><li>We don’t pull in all the additional complexity of Bootstrap’s JS and increased bundle size, nor do we have to override Bootstrap default styles</li><li>CSS-in-JS would have been a large departure from how the team writes CSS today and we want to minimize friction</li><li>Tailwind plays nicely with NextJS &amp; SSR with little configuration</li><li>We can still fall back to CSS files if needed for some reason</li></ul><h4>We will not import a component library like Bootstrap, MUI, Chakra, or Mantine 🛑</h4><ul><li>We want to fully own our components, be able to dig into internals, and not be forced to override styles like we were with Bootstrap and <a href="https://ng-bootstrap.github.io/#/home">ng-bootstrap</a>.</li><li>We eventually felt some pains of using Bootstrap, like having conflicting styles, classnames that apply javascript when you don’t want to, or when we had to do a large migration from version 4 to 5 because it was a blocker for us being able to upgrade Angular. We don’t want to relive that pain ever again.</li><li>Many of these libraries are based on their own design system, and we want our components to match <em>our</em> design system</li></ul><h4>We will use Radix for UI Primitives</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*lNraurdqLe4K4rzx56rIyg.png" /></figure><ul><li>The components provided by radix are <strong>unstyled</strong>, meaning we can add our own CSS to make them look exactly how we want</li><li>Accessible by default — we already spoke about how we want to avoid re-inventing wheels and ship novel experiences to our users. We don’t want to spend hundreds of engineering hours or more on like keyboard navigation, focus management, WAI-ARIA compliance, etc. Radix handles all of that for us, and we can pull in only the components we need to keep bundle sizes small.</li><li>Radix provides granular access to the building blocks of the component, so we can customize behavior as well as the styles</li><li>HeadlessUI was the runner up. We went with Radix over HeadlessUI due to the more robust set of components provided by Radix. React-Aria was robust but too low level to provide the developer experience we are seeking</li></ul><h3>Where Are We Today?</h3><p>Now that most of the initial exploratory work has been done, we have been able to do what we love most — booting up our favorite text editors and start writing some code.</p><p>We have several core components built out in our Storybook already. These components have variants driven by React component props that apply different styles and behavior to match our design system down to the pixel. We can also flip components between several themes, including a fancy new dark mode that we’ve never had before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*4xenwUzz0h8ZScsGeNHw4g.png" /><figcaption>A sample of our Button storybook component, with some props</figcaption></figure><p>We’re pretty close to making things server driven by hooking this all up to our generic React component rendering engine that will render any arbitrary components provided by our Backend-For-Frontend. But that’s a topic for another post!</p><p>This component library and design system effort has included a lot of work done by a lot of folks, and yet it is is all just one small piece of the re-platforming puzzle. We’re excited with the way things are going and are heavily invested in providing a high quality developer experience for our future selves and a user experience that fans will love.</p><p>Follow our <a href="https://engineering.flosports.tv/">engineering blog</a> to read more posts about our continued efforts to move to One Flo Platform!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c018eba12d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/building-a-react-component-library-flosports-edition-5c018eba12d5">Building a React Component Library: FloSports Edition</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Platform to Rule Them All]]></title>
            <link>https://medium.com/flosports-engineering/one-platform-to-rule-them-all-f87297477e39?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/f87297477e39</guid>
            <category><![CDATA[platform]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[sports-tech]]></category>
            <dc:creator><![CDATA[Gene Chuang]]></dc:creator>
            <pubDate>Thu, 25 May 2023 18:35:52 GMT</pubDate>
            <atom:updated>2023-06-09T15:43:55.066Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZX39Y-U5PMj-fSPRmrPxQ.png" /></figure><p>FloSports is a 13+ year old startup streaming 26 underserved sports. 2023 is the year of re-platforming as the FloEngineering team will rebuild from the grounds up: One Flo Platform or OFP. This high level architecture diagram above gives you a taste of what’s in store, and the complexity and number of moving parts involved. The themes and motivation for this new platform:</p><ol><li>We have acquired at least 5 Sports Tech companies over the past decade, and the Engineering team is currently running 5 tech stacks. We have a Java 8 Tomcat/Hudson stack, a PHP Symphony stack, a .NET stack, a Golang Stack, Angular/Typscript stack, and most recently a Perl/RoR/Adobe Air stack. This is unsustainable for an engineering team size of under 100 and DevOps team of 4. Unification is needed just for sanity sake, if not for efficiency, velocity and scale.</li><li>Through our acquisitions, we are running on all 3 major clouds: AWS, GCP and Azure. Our cloud bill is $4M/year and does not make sense for the amount of subscribers we have, nor does it make sense to be split brain in Cloud with a DevOps team of 4. For OFP we will be consolidating on AWS — Amazon has won the cloud game, let’s pick the winner and move on.</li><li>Our current main stack is Angular, Typescript/Nest, MySQL, Redis and k8s. The decision to go Angular was made by my predecessor 4 years ago, when React/React Native has already won in the industry at large. The decision to use k8s over Serverless was also made without architecting a proper Serverless PoC. Our subscribers are only in North America (US and Canada, some Brazil), and our traffic peaks on Saturdays. We do not need 24/7 compute. While we are microservices, every new service our developer created use the same template: Typescript/Nest, MySQL, Redis, k8s container. Most of our developers rely on TypeScript ORM and do not evaluate their data store needs via access pattern for the service they are creating. Hence going SST.dev will greatly simplify the DevOps part of spinning up new service and optimize for performance by using DynamoDB for most of our data access patterns, and reduce compute cost from always-on k8s containers to Lambdas.</li><li>FloSports has a history of building everything from scratch — while this made sense 12 years ago to build a custom CMS, there hasn’t been the engineering prioritization to reevaluate our technology every year and make Buy vs Build decisions. Engineering teams have also historically worked in silos without central architecture or platform services, hence the wheel has been reinvented multiple times here. Conways Law: The product you deliver mirrors your organizational and communications structure. For One Flo Platform, we will make central architecture decision and design a best of breed solution. We want to reserve our precious engineering resources to build services that will differentiate us from our competitors and move the need, and not to build and maintain commodity off the shelf tooling.</li><li>Our core product, live sports streaming, is made of two broadcast chain tech stacks, one 10+ year old custom stack centered around Wowza, and one vendor driven components stack from acquisition. One competitive advantage FloSports provides is ability to stream 60 mats wrestling tournaments, that’s 60 concurrent live streams from one venue, at scale and operational efficiency. Hence we will be consolidating/rewriting our broadcast chain to fit our scaling and cost axis.</li></ol><p>One Flo Platform is set to launch in Q4 of 2023. It is a very ambitious effort, we feel we have the right engineering team on board to take down all challengers and knock it out of the park. Follow our <a href="https://engineering.flosports.tv/">engineering blog</a> as we deep dive and show progress and post-launch learnings on OFP!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f87297477e39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/one-platform-to-rule-them-all-f87297477e39">One Platform to Rule Them All</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Reactive Data Streams]]></title>
            <link>https://medium.com/flosports-engineering/simple-stream-composition-40e0165a7f6a?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/40e0165a7f6a</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Leila Adams]]></dc:creator>
            <pubDate>Mon, 15 May 2023 20:32:45 GMT</pubDate>
            <atom:updated>2023-12-02T16:57:13.872Z</atom:updated>
            <content:encoded><![CDATA[<h4>Building Observables with the RxJs Library</h4><blockquote>Special thanks to <a href="https://medium.com/u/3fd19fa66fc2">Nick Dunn</a> for collaboration on this story.</blockquote><p>Here at FloSports, We ❤️ Functional Reactive Programming!</p><h4>What is FRP?</h4><p>It’s not simple to define. In fact, Stephen Blackheath wrote <a href="https://www.manning.com/books/functional-reactive-programming">a whole book</a> about it and Zhanyong Wan co-authored <a href="https://dl.acm.org/doi/10.1145/349299.349331">this white paper</a>. There’s also a pretty good <a href="https://medium.com/@lettier/functional-reactive-programming-a0c7b08f6b67">existing medium article</a> on the topic that speaks more about its application. So I won’t try to reinvent the wheel too much here.</p><blockquote>Functional Reactive Programming, or FRP, is a general framework for programming hybrid systems in a high-level, declarative manner. The key ideas in FRP are its notions of behaviors and events. — Zhanyong Wan and Paul Hudak, “Functional reactive programming from first principles”,</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4GivgF4VXyJhkdZq" /><figcaption>Photo by <a href="https://unsplash.com/@emilep?utm_source=medium&amp;utm_medium=referral">Emile Perron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To sum it up, it’s a programming paradigm very different from imperative, object-oriented programming.</p><h4>Great For Web Apps</h4><p>FRP is all about setting up functions that asynchronously react to streams of different inputs and events over time. This makes it great for web applications, which are event based — think user clicks, typing, scrolling etc.</p><blockquote>FRP fits some problems better than others. User interfaces and networking are two event-based areas where it fits especially well. Not surprisingly, FRP is excellent for web applications. — Stephen Blackheath &amp; Anthony Jones, Functional Reactive Programming</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cRbMriHNh3687doq" /><figcaption>Photo by <a href="https://unsplash.com/@bugsster?utm_source=medium&amp;utm_medium=referral">Taras Shypka</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Instead of hard-coded, disjointed, mutable state, it enables a continuous flow of streaming events and data.</p><h4>The RxJS Library</h4><p><a href="https://rxjs.dev/">RxJS is a library of reactive extensions for JavaScript</a>. It is what we, at FloSports, use in order to accomplish this “streaminess”.</p><p>The idea is you compose observables from rxjs functions then use operators like reduce, map, filter to apply logic. Here is a basic example of an observable subscription using fromEvent and scan .</p><pre>import { fromEvent, scan } from &#39;rxjs&#39;;<br><br><br>fromEvent(document, &#39;click&#39;)<br>  .pipe(scan((count) =&gt; count + 1, 0))<br>  .subscribe((count) =&gt; console.log(&#39;Clicked &#39; + count + &#39; times&#39;));</pre><p>Once you author a stream and subscribe, it’s good to go! It can respond to the registered events appropriately — in this case clicking on a web document — without ever storing state! No state — notice how there’s no const or let declaration on count— that’s pretty cool, right? Instead scan is keeping track of previous emissions to increment the count.</p><h4>A Real World Example</h4><p>Here’s a real world code sample of a data$ stream whose responsibility is simple: fetch new data when query parameters change and/or the refresh button is clicked. It will return results once all combined streams have emitted.</p><pre>import { combineLatest } from &#39;rxjs/operators&#39;;<br><br>const data$ = combineLatest([<br>    queryParameters$,<br>    buttonClickEvents$.pipe(startWith(undefined)),<br>  ]).pipe(<br>  switchMap(([queryParameters: string, buttonClickEvent?: Event]) =&gt; {<br>    return getDataByClickEvent(queryParameters, buttonClickEvent)<br>  })<br>)</pre><blockquote><em>Note: the </em><em>$ is used to indicate an observable stream</em></blockquote><p>As you can see, we use the rxjs <a href="https://rxjs.dev/api/index/function/combineLatest">combineLatest</a> operator to group streams that rely on each other. These streams were combined because getDataByClickEvent requires the latest queryParameters regardless of which event occurs.</p><h4>Mega Streams Cause Problems</h4><p>The temptation is to add <em>all </em>streams for a given page view into a single mega combineLatest 😈</p><pre>const view$ = combineLatest(<br>  [<br>    settings$,<br>    analytics$,<br>    megaStream2$,<br>    megaStream3$,<br>    hasCoupon$,<br>    isInExperiment$,<br>    data1$,<br>    data2$,<br>    data3$,<br>    user$,<br>    buttonClickEvents$.pipe(startWith(undefined)),<br>  ]<br>).pipe(map... filter... tap... reduce...</pre><p>Well, we’ve learned that creating one ginormous combineLatest stream for an entire route can cause issues.</p><h4>Drawbacks of Mega Streams</h4><ul><li><strong>Readability</strong> — It’s easier for developers to reason about the code when they see 3 well-named streams combined together, rather than, say, 15. We also found developers compulsively combining streams that don’t even relate to each other, further complicating a single stream that should be a few smaller, separate ones.</li><li><strong>Performance</strong> — Since combineLatest waits for all input observables to emit at least once before it starts returning results, it means it is only as fast as its slowest observable. If you’ve needlessly combined streams, the code will not execute as quickly as possible.</li><li><strong>Refactoring &amp; Extending</strong> — Probably our biggest motivation behind smaller streams. Our older code is so difficult to modify! However, with our newer code that has a series of smaller streams, it’s easier to make adjustments.</li><li><strong>Debugging &amp; Preventing Duplicate Execution</strong>— Figuring out where to put a shareReplay or troubleshooting duplicate API calls. The woes of a nested take(1) or filter completely stopping a stream in its tracks (mysteriously) — these are all examples of things that are painful to debug across several giant combineLatest observables. If you must tear mega observables apart to debug, you might as well compose small streams in the first place.</li><li><strong>Unit Testing </strong>— Recognize the error below? This happens when a spec calls an observable that hasn’t been properly mocked out. It can also happen when calling a combineLatest, which has a host of secondary observables that have not been defined. Unit testing large streams is so painful and cumbersome, it’s no wonder our older code had measly code coverage. Composing smaller streams is why we are able to maintain ~90% code coverage on newer features.</li></ul><pre>TypeError: You provided &#39;undefined&#39; where a stream was expected. You can <br>provide an Observable, Promise, ReadableStream, Array, AsyncIterable, <br>or Iterable.</pre><p>Need I say more?</p><h4>Compose Small Single Responsibility Streams</h4><p><em>The lesson learned?</em> Composing small, single responsibility streams is the way to go. Think of them as little building blocks or “Lego streams”, similar to building web components as atoms, molecules, and organisms. In both cases, you want to compose observables that follow the SRP (Single Responsibility Principle) and DRY (Don’t Repeat Yo’self) principles. Each stream should be responsible for <em>the one thing it cares about</em>, and it should only pipe off other streams that contain data it needs <em>to get that one thing</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U1cmAhQGCDh2hS2t" /><figcaption>Photo by <a href="https://unsplash.com/@mourimoto?utm_source=medium&amp;utm_medium=referral">Mourizal Zativa</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Onwards!</h4><p>At the end of the day, managing side effects and state in thick web applications is pretty darn difficult. Streams help you to do these things better. Composing small streams will greatly simplify the mental model required to understand and manage your code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40e0165a7f6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/simple-stream-composition-40e0165a7f6a">Simple Reactive Data Streams</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ship More Frequently ]]></title>
            <link>https://medium.com/flosports-engineering/ship-more-frequently-4fa7d543440?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/4fa7d543440</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[agile-development]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[developer-experience]]></category>
            <category><![CDATA[nestjs]]></category>
            <dc:creator><![CDATA[Leila Adams]]></dc:creator>
            <pubDate>Fri, 05 Aug 2022 13:14:51 GMT</pubDate>
            <atom:updated>2023-05-08T17:41:12.194Z</atom:updated>
            <content:encoded><![CDATA[<h4>by Automatically Generating TypeScript Types</h4><blockquote>Here at <a href="https://www.flosports.tv/">FloSports</a> we ❤️ types.</blockquote><h4>Why?</h4><p>Stronger, more accurate types prevent bugs and create a premium, authentic user experience. 🙅🏻 🐛</p><h4>Another reason?</h4><p>Better types make developers happy since there’s less guesswork, less defensive coding, and less overall wasted energy preventing bugs. Software engineers are able to more effortlessly create new features with confidence. It’s engineering rocket fuel 🚀</p><figure><img alt="Solid types are like engineering rocket fuel" src="https://cdn-images-1.medium.com/max/1024/0*dQNljcCyHDUaWocM" /><figcaption>Photo by <a href="https://unsplash.com/@spacex?utm_source=medium&amp;utm_medium=referral">SpaceX</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Wait… What are types again?</h4><p>Types are all the possible values of a given variable. Here is an example of a Card type that has four properties. Two properties, label and description, might have string or null values. The other two properties, title and action, will always be defined, at least presumably.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a906d250dc64f37f2f1f36236d53e1cc/href">https://medium.com/media/a906d250dc64f37f2f1f36236d53e1cc/href</a></iframe><p>In programming, it’s important to have accurate types to prevent giving incorrect instructions to software. In the example above, if we attempt to access card.action.url, but the Card type is incorrect and action can sometimes be null or undefined, a runtime error will result:</p><pre>Uncaught TypeError: Cannot read properties of null (reading &#39;url&#39;)</pre><h4>Types are hard y’all!</h4><p>It is challenging to create a perfect type system, as type definitions must correctly persist across data stores, services and clients. One of our challenges: our NestJS micro services are written in TypeScript, yet there is no easy way to share types with our web app, which is also written in TypeScript. That’s right — repos we created and control have a difficult time sharing a contract in the same language. That doesn’t seem right. 🤔</p><h4>So in the meantime…</h4><p>What do we do to make up for this lacking? We copy over types from backend to frontend, we hardcode them, we duplicate and debate them. They become outdated (or were never accurate to begin with) and downstream a bug emerges that annoys our users (and hopefully they don’t unsubscribe because of it).</p><blockquote>Simply put: it’s not a system, it’s chaos.</blockquote><h3>The Solution</h3><p><a href="https://ts-morph.com/">ts-morph</a> to the rescue!</p><figure><img alt="ts-morph to the rescue!" src="https://cdn-images-1.medium.com/max/1024/0*oNLZI9gWlmWKkqEi" /><figcaption>Photo by <a href="https://unsplash.com/@neilthomas?utm_source=medium&amp;utm_medium=referral">Neil Mark Thomas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The <a href="https://github.com/dsherret/ts-morph">ts-morph library</a> wraps the TypeScript compiler API so you can very simply and quickly extract interfaces from your NestJS classes and publish them as a types package to share across projects.</p><p>An example of what that code looks like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eab7fe1e3abc66c03f55a76fa5d2f6b7/href">https://medium.com/media/eab7fe1e3abc66c03f55a76fa5d2f6b7/href</a></iframe><p>You can do the same for type aliases and enums. You can even omit problematic properties, exclude members, recursively include base class interfaces, and convert enums to type unions.</p><blockquote>ts-morph is a powerful library!</blockquote><h3>Basic Developer Steps</h3><ol><li>npm install ts-morph in your NestJS project as a dev dependency</li><li>Create a .ts file for your first morph</li><li>Run ts-node ./my-first-morph.ts (create a script in package.json)</li><li>Import Project from ts-morph and get files from your NestJS project</li><li>Extract interfaces, type aliases, and enums into a new file</li><li>Typecheck new file by running tsc</li><li><a href="https://medium.com/cameron-nokes/the-30-second-guide-to-publishing-a-typescript-package-to-npm-89d93ff7bccd">Publish the new types file as a package</a></li></ol><h3>The Outcome</h3><h4>Rocket Fuel 🚀</h4><p>We have a major initiative at Flo — to build the Next Gen experience for our subscribers and be the ESSENTIAL DESTINATION for all things related to your favorite sport! With this ambitious initiative comes GOALS. We needed rocket fuel to get there and thankfully, this sped up development across our web app teams, making it easier and quicker to ship three major features this past quarter.</p><blockquote>Our Next Gen experience is more lit because we shared types across two projects. Imagine if we shared types across our ENTIRE engineering ecosystem? 🔥</blockquote><h4>Developer Experience 😄</h4><p>Developers also seem happier because they no longer have to hunt through API code to find the class models and then manually type out interfaces. Now you npm install the latest types package and you go on your merry way!</p><h3>Pro Tips</h3><h4>Warning ⚠️</h4><p>As the name implies, ts-morph can easily morph project code. It’s a library commonly used for large-scale, programmatic refactors. For this use case, our goal is to only mutate the new types file. So, be careful kids, and keep an eye on your changed files before committing.</p><h4>Human-free 🤖</h4><p>Automatically generate the types file and publish the types package any time a new tag is created as part of a hands-free (and human-free) build pipeline. The goal is an improved developer experience, so set up an automatic publish of the types where no one is required to do anything, only the bots.</p><h4>Set Boundaries 🙅🏻‍♂️</h4><p>Use TypeScript configuration files to control the scope and boundaries of your NestJS project vs. your types package as they live side-by-side in the same repository. For example, in your main project’s tsconfig.json, you should probably exclude the types package to avoid conflicts.</p><pre>&quot;include&quot;: [&quot;src&quot;],</pre><pre>&quot;exclude&quot;: [&quot;node_modules&quot;, &quot;dist&quot;, &quot;tests&quot;, &quot;types-pkg&quot;],</pre><h4>🐪 vs 🐍</h4><p>No doubt the published types will be camel cased, but the outputted JSON from the API could be snake case depending on the serialization. So the types might not match the JSON (datePublished vs date_published). We simply created an interceptor in our web app that used a <a href="https://www.npmjs.com/package/camelcase-keys-deep">camel-case package</a> to convert the JSON response.</p><h4>Decoding 🚮</h4><p>On the client, you might still want to decode API responses with the types from this new ts-morph generated types package. Throw out JSON that doesn’t comply since it’s still possible to get bad data from your persistence layer. This will give you 100% certainty. We use <a href="https://gcanti.github.io/io-ts/">io-ts</a> for this, a runtime type system for IO decoding/encoding. And you don’t have to throw out the ENTIRE response. For example, you can simply omit certain items in an array if they do not match the object schema.</p><h4>Mobile Types 📱</h4><p>We could take this to the next level and also generate Swift and Kotlin types from our new TypeScript file using the <a href="https://quicktype.io/">quicktype</a> library. Its TypeScript support, however, is experimental at the moment and, among other things, doesn’t support translating all type aliases. For example, it errors on <strong>Record&lt;string, string&gt;</strong>, which you would have to replace with <strong>{ [key: string]: string } 🙈</strong></p><p>However, once those kinks are ironed out, generating mobile types could be as easy as installing quicktype and running a command on your new TypeScript file.</p><pre>quicktype types-pkg/index.ts -o models.swift</pre><h3>Onwards!</h3><p>We’ve come a long way with TypeScript, but there are still so many opportunities for improvement when it comes to server and client sharing type information. The solution I proposed here is for projects in separate repos. For a monorepo solution, check out <a href="https://trpc.io/">tRPC</a>, end-to-end typesafe APIs made easy. In the future, it would be fantastic to have a code-less solution no matter how your source files are stored. Maybe with the right combination of configuration and innovation, we will get there soon. For now, ts-morph is a great way to get developers out of a frustrating cycle of type guessing every feature and on the front foot with product delivery.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fa7d543440" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/ship-more-frequently-4fa7d543440">Ship More Frequently 🚀</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taking the Pragmatic Engineer’s Developer Culture Test]]></title>
            <link>https://medium.com/flosports-engineering/taking-the-pragmatic-engineers-developer-culture-test-69baeb83927f?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/69baeb83927f</guid>
            <category><![CDATA[management]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[engineering-mangement]]></category>
            <category><![CDATA[engineering-culture]]></category>
            <dc:creator><![CDATA[Truong-An Thai]]></dc:creator>
            <pubDate>Thu, 14 May 2020 14:07:45 GMT</pubDate>
            <atom:updated>2020-05-15T01:43:13.389Z</atom:updated>
            <content:encoded><![CDATA[<h4>What Defines Places Where Developers Thrive?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9NBn94RWw4rvNZkuHs_Cfg.png" /></figure><p>Here at <a href="https://www.flosports.tv/">FloSports</a>, engineering leaders &amp; managers have been deep diving into various topics around building a high performing engineering culture. No, not about weekly catered lunch and tacos, ping pong tables or bring your dog to work-every day (FloSports <em>does</em> provide all of that).</p><p>We’re talking about things that truly matter when it comes to engineering productivity and happiness at FloSports — <strong>alignment, trust &amp; flexibility, building &amp; shipping &amp; production monitoring, learning and growing</strong>. Topics ranging from <em>improving our engineering career laddering docs, engineering-wide standards &amp; technical workflows, decision making process, consistency in quality and documentation, how tech debt is prioritized, </em>are just few of<em> </em>many other aspects that helps us to become “one engineering” at FloSports.</p><h3>Knowing where we’re at guides us where to go next.</h3><p>We partner with our People team to send out eNPS surveys at least every other quarter as a way to measure employee satisfaction, retention and engagement. Won’t deep dive into what <a href="https://medium.com/@SurveySparrow/how-does-employee-nps-matter-the-ultimate-guide-to-enps-8865b76a2088">employee Net Promoter Score</a> is here, but what’s a <a href="https://www.reflektive.com/blog/enps-hr-data/">good</a> score you might ask?</p><blockquote>An eNPS can range from -100 to 100. Anything above zero is acceptable, though companies have varying standards. In general, a score of 10–30 is considered good, and a score of 50 is excellent.</blockquote><p>Our engineering eNPS score last round was <strong>+45</strong>. Pretty solid by any standard. As engineering leaders at FloSports, we are proud of our team and have put in a ton of care and work to build a strong engineering culture. Know there is always something that can be improved (heck, even maintaining that level of employee satisfaction takes ongoing work). Nevertheless, we set a goal to achieve +50 next round.</p><h3>Let’s take the test and do a bit of reflection!</h3><p>The <a href="https://blog.pragmaticengineer.com/the-developer-culture-test/">Developer Culture Test</a> by <a href="https://blog.pragmaticengineer.com/">Gergely Orosz</a> was published on April 13, 2020 — super timely and relevant when the article showed up in my inbox a few days ago.</p><blockquote>I’ve talked with dozens of software developers about what they like and dislike about their workplace — team, and company — professionally….I’m surprised to see not much done to quantify these observations in 2020. We have <a href="https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-steps-to-better-code/">the Joel test</a> that is still attached to the Stack Overflow job listings, …but the Joel Test, written in 2000, feels too outdated and doesn’t address things that are important for productive developers in the 2020s, like autonomy, code reviews, or continuous professional growth. So I took a step back and re-imagined what a test like a Joel-test would be in the 2020s: predictors of a workplace that has a great developer culture.<br> — Gergely Orosz, The Pragmatic Engineer blog</blockquote><p>The test focuses on 3 areas with 5 questions each for a healthy organization, where developers thrive. Gergely states that from his experience, any decent tech company should have the 3 basic points nailed, and cover at least 4 out of the 5 points in each area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*SKw1TETMvqOLm6t1TncdMA.png" /><figcaption>Outline of the <strong>Developer Culture Test </strong>from <a href="https://blog.pragmaticengineer.com/the-developer-culture-test/">The Pragmatic Engineer</a></figcaption></figure><h4>Let’s see how we assess ourselves below! ⬇</h4><h3>Basics</h3><blockquote>“These are things that all decent companies have in place.”</blockquote><h4>1. Psychological safety and a blameless culture. ✅</h4><p><strong><em>Psychological safety.</em></strong> From 1–1s, code reviews, sprint retrospectives, guilds, architectural and RFCs discussions, to department-wide meetings, we want people to feel safe being themselves and voicing their opinions, even if they might disagree with each other. There’s no right or wrong when it comes to building software, just better or poorer solutions. Disagreements and conflicts will arise, but know that we encourage team members to confidently deliver feedback to each other and with their managers, while also graciously accepting feedback.</p><p><strong><em>Blameless culture. </em></strong>When something goes wrong, we run a <a href="https://engineering.flosports.tv/embracing-a-blameless-culture-because-nobody-wins-the-blame-game-4af86ab0791f">blameless postmortem</a> process (aka learning reviews), which focuses on systemic root cause over who caused it. We desire to foster a culture that aims to improve our systems quickly through ownership, openness, and a willingness to share information about outages and technical issues without fear. We’ve done countless blameless learning reviews since October of 2017 and they have always been helpful and well adapted. Perhaps we can incorporate more “pre-mortems” to reduce “post-mortems?”</p><h4>2. Fair compensation. ✅</h4><p>We partner with our amazing People Team (thank you Paige, Ashlee and Ryan!) as well as our Senior Leadership Team on ensuring our engineers are paid a fair wage, that’s competitive with the local market. We also have a process to evaluate merit increases as well as market adjustments annually while referencing the salary band we have for each engineering level.</p><h4>3. Common-sense flexibility on working hours. ✅</h4><p>100% no butt in seats here. We have Engineers based out of our Austin HQ, Orlando, and various remote locations. Engineers can work in a flexible way that fits their team as well as for them. The focus is on work getting done over what time people start or end the workday.</p><p>We have reasonable WFH guidelines such as ideal “core hours” where collaboration can overlap synchronously. We are highly flexible on short-notice schedule changes and personal circumstances. Some engineers work 10am–6pm in the office, some few hours earlier, some will relocate mid-afternoon to beat traffic. On rare occasions, devs opt to stay up late at night to ship something or handle an incident off-hours; they have the flexibility to start the day a bit later or take a day off.</p><p>Heck, sometimes you just have to make an appointment to get a haircut, your car doesn’t start, your kids are sick — We understand, life happens!</p><p>What’s the common-sense behind this? <strong>Just communicate it via the right channels, be respectful of your own time, and the time of others on your team and those you integrate with.</strong></p><p>Since Coronavirus (COVID-19), we’ve been able to instantly transition to 100% WFH during this time with little friction as the flexibility has already been a part of our DNA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*aN5PjHypP9P1CBJvbS-u0A.png" /><figcaption>Employee Review on <a href="https://www.glassdoor.com/Reviews/Employee-Review-FloSports-RVW17068067.htm">GlassDoor</a></figcaption></figure><h3>Clarity, Autonomy and Collaboration</h3><blockquote>“Companies that get this right will have innovative and autonomous people thrive. Those who don’t will see these people leave over time.”</blockquote><h4>1. Understanding the “why”. ✅</h4><p>One of our core values is <strong>“Make Stuff Fans Love: Authenticity.” </strong>We encourage engineers to learn more about FloSports’ business while seeking an understanding of how users interact with our product/services. This helps engineers understand how they are contributing to their team, department, and organization-wide success.</p><p>Our process to share the business reasons for work to be done with the engineers is kicked off quarterly within the Product-Engineering department. We get company goals from the CEO &amp; Senior Leadership Team, which then cascades to Product department goals and each Product-Engineering team will define their own goals/initiatives and prioritize items on their roadmaps.</p><p>Product leadership does Monday kickoffs where we alternate between product-engineering goal updates and company-wide goal updates throughout the quarter. We also encourage product managers to review goals within their team on at least bi-weekly cadence, share how the team’s work is helping the business, etc.</p><p>At FloSports we recently launched a book club as part of our “FloGrow” initiatives and kicked off with the book “<a href="https://www.amazon.com/Start-Why-Leaders-Inspire-Everyone/dp/1591846447">Start with Why</a>” by Simon Sinek (<a href="https://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action">great Ted Talk if you missed it</a>).</p><h4>2. Backlog/roadmap and engineers contributing to it. ✅</h4><p>All teams have bi-weekly or weekly refinement/planning meetings to discuss and prioritize the work to be done towards quarterly goals. We have visible roadmaps and sprint goals. While product managers own the vision for the product and maintain the roadmap, engineers are encouraged to bring suggestions to the table that end up on the team’s roadmap to support the “why”. Sometimes this means identifying and advocating for addressing tech debt (or <a href="https://firstround.com/review/forget-technical-debt-heres-how-to-build-technical-wealth/">building technical wealth</a>) that needs to be prioritized alongside sprint work.</p><p>Overall, we believe the product-engineering department does a pretty good job here in making it easy to answer “what we will work on next, and why?”</p><p>We can improve on tech debt conversations as it is inconsistent between teams today in how it gets discussed and prioritized with product managers. We want to do better in coaching up engineers to bring up tech debt as part of the engineering work estimation.</p><h4>3. Direct communication in solving problems. ✅</h4><p>Engineers at FloSports are encouraged to go directly to engineers on other teams to solve problems rather than requiring devs to go through their manager, who talks with another manager.</p><p>As an example, one of our codebase has 9 developers across 3 teams (Revenue, Acquisition and Engagement/Retention) that contributes to it even though each team works towards their individual team goals. One way we support direct communication in solving problems is through <em>code-base specific</em> slack channels where devs can ask questions, surface up PRs for code reviews or help unblock each other. We also have hybrid “<a href="https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/">guilds/chapter</a>s” Spotify-like community where problems/ideas are discussed within and cross-teams.</p><h4>4. Cross-functional collaboration. ✅</h4><p>Our developers work directly with product managers, designers and other stakeholders without having to rely on a proxy such as their manager. In some cases, a new engineer may not have all the organization context or a developer wants to stay heads-down so that’s where their manager could come in to support &amp; unblock, facilitate some of those conversations, and enhance the collaboration without being a bottleneck.</p><h4>5. Celebrating people taking initiatives. 🌱</h4><p>Another FloSports’ core value is <strong>“Raise the Bar: Innovation” — </strong>as engineers, we know that everything can be at least a little better, the best solutions are often the simple solutions as we gain more experience and that we want to build systems that are reliable and efficient while consuming the least resources to solve a business problem.</p><p>Where we can do better as a department is to celebrate and reward those who take initiatives behaviors more often (even the small wins). There are aspects where it could feel like a distractions, especially when it isn’t clear to a product manager or even another developer on the business value.</p><h3>Sustainable Engineering Culture</h3><blockquote>“Get this right, and developers won’t burn out or get endlessly frustrated.”</blockquote><h4>1. Distinguishing between functionally complete vs. ready for production. ✅</h4><p>We differentiate between prototypes/MVP/functionally complete and production readiness state of code by these definitions:</p><ul><li><strong>Prototypes or POC’s. </strong>Often code that does just enough for us to evaluate a solution or to learn something towards making a decision.</li><li><strong>MVP. </strong>Typically version one of a feature. It may be functionally complete but only a sub-set of the fully desired set of features which may come in a later phase.</li><li><strong>Functionally complete: </strong>AKA “dev complete” is code that has all the planned end user features/requirements, but may not be ready to ship due to bugs or performance issues.</li><li>Production-ready<strong>.</strong> Code meets functional requirements, performance requirements, etc.</li></ul><p>We are working on a more formal checklist for what additional quality bar means for something to be production-ready that could be shared among teams consistently.</p><h4>2. Code reviews and testing. ✅</h4><p>Automated testing and code reviews is an essential process for software quality and is a part of our everyday software development.</p><p>We do reviews using Github. A common workflow is developers would put up a PR and request reviews in the appropriate slack channels.</p><p>For automated REST API testing and JS end-to-end, we’ve standardized across most teams by using our in-house built tool <a href="https://engineering.flosports.tv/automated-rest-api-testing-with-flagpole-a85fad28a925">Flagpole</a>. Some projects also use <a href="https://www.cypress.io/">Cypress.io</a>, Runscope, and Ghost Inspector. Unit testing tools vary across backend services, frontend web, and native iOS/Android projects.</p><p>On top of code reviews and unit/integration/UI tests, we are also building out a load/performance regression testing using <a href="https://k6.io/open-source">open source k6.io</a>.</p><h4>3. CI and CD or developers deploying to production. ✅</h4><p>At FloSports we’ve been doing CI many years back but began our CD (continuous delivery) journey in mid-2018 (<a href="https://engineering.flosports.tv/embrace-the-continuous-delivery-culture-by-doing-things-that-dont-scale-9326353ddf39">Embrace the Continuous Delivery Culture by Doing Things that Don’t Scale</a>). We were able to transition a few of our largest projects (with the highest # of developers) to a “developer-release” process where devs push code they own to production after CI is complete (currently use Jenkins, CircleCI, Google Cloud Build across different projects).</p><p>Some projects have “review apps” support where developers pushing up a PR will get an automatically generated ad-hoc environment, and a merge into master will auto-deploy to staging while leaving it up to a “business decision” for production deploy.</p><p>It’s really beautiful. That said, we do have a few more projects to transition the culture+process+tools towards supporting full CI/CD/Developer Releases.</p><h4>4. Healthy oncall. ✅</h4><p>We have a process &amp; tools in place today to support both on-call and escalations when there is a critical issue that was mostly formalized in December 2019. Each team manages their own on-call schedule that works for their team. For each critical issue, we make our best attempt to fix the issue so that the same issues do not happen repeatedly causing on-call responder burnout.</p><p>We use PagerDuty to manage services, schedules, and escalation policies as well as integration into Slack for human triggers. DataDog for automated monitoring alerts.</p><h4>5. Internal open source. 🌱</h4><p>We haven’t fully adopted an internal open-source model where any developer can read and contribute to any other codebase. All devs do have access, it’s just that we have not been intentional nor consistent in supporting this model.</p><p><strong>A recent example pointing us in this direction: </strong>Our infra team initially built a Kubernetes based job scheduler service. An engineer on another team (let’s just call him Harold) needed to enhance the service for a particular use case. Our infra team as current owners of the code could do the work, but the team’s plate was already really full, so Samir our Infra team lead decided to let Harold build it, discussed architecture together and pushed up a PR. Harold was able to unblock himself to deliver value, plus we now have additional knowledge shared in this service/codebase.</p><p>The question for engineering is do we want to encourage this? What is the business value in enabling this model? I believe we do.</p><p>But we’ll need to have appropriate code ownership in place, have more standards &amp; consistency that matters between team/projects within reason.</p><h3>Career Progression</h3><blockquote>“People who are driven want to keep growing throughout their career. Does your company have a track for senior developers growing outside of moving into management, and is professional growth supported in a variety of ways?”</blockquote><h4>1. Technical managers who build trust. ✅</h4><p><strong>Technical managers. </strong>All of our current development managers are technical, have done software development at some point in their career (or still does as “Player/Coach” managers) and have been at least Sr. Software Engineers themselves. While it is totally possible for non-technical managers to be great managers, having hands-on experience means they can better relate to the development struggles, be more effective advocates for sustainable engineering, and more capable of mentoring other software engineers.</p><p><strong>Regular 1:1s.</strong> All engineering managers do regular 1:1s with their team members, either weekly or bi-weekly cadence. <a href="https://getlighthouse.com/blog/your-1-on-1s-development/">While every 1-on-1 is different and can have various “stages”</a>, this is a set time for managers and their team members to <a href="https://engineering.flosports.tv/step-one-to-effective-1-on-1-meetings-efc25aaad249">build rapport &amp; trust</a>, give and receive feedback, discuss career development &amp; goals, discuss ways to improve the team and company and general happiness check-ins.</p><h4>2. Career ladder. ✅</h4><p>We created our first FloSports <a href="https://engineering.flosports.tv/rolling-out-engineering-job-title-ladders-1394e3ebde0d">engineering career ladder &amp; growth framework</a> back in August 2018 which included 5-levels (SE1, SE2, Senior, Staff, and Principal), scope of impact, and expected behaviors at each level. Since then, we’ve used it as a tool for engineers and their managers to discuss growth as well as evaluation for promotions. Engineering managers are now getting together as of this writing to improve on the framework with the goal of creating more clarity into the promotion criteria and process.</p><h4>3. Parallel IC &amp; manager tracks. ✅</h4><p>While we have not yet formally published an engineering manager (people track) career ladder, we do have parallel IC &amp; management career paths. Mainly, engineers do not have to become managers to grow professionally or to increase their scope of impact and compensation at FloSports. In other words, Senior/Staff/Principal IC Engineering levels have parallels to Manager/Sr. Manager/Director/VP level in terms of leadership, influence, and compensation.</p><h4>4. A culture of feedback. ✅</h4><p>We partner with our People team on performance reviews which includes 3 types of reviews:</p><ul><li>360 reviews where peers give feedback to each other</li><li>360 where directs give feedback to managers</li><li>Manager reviews of employees</li></ul><p>From a company-wide perspective, our People team does employee-based NPS surveys at least twice a year, from which the feedback collected is shared with and acted on by the company and managers.</p><h4>5.<strong> Investing in professional growth</strong>. ✅</h4><p><strong>Mentorship.</strong> In Q4 of 2019, we hired 7 additional software engineers across 6 teams (iOS, Revenue, Acquisition, Sports Data, QA, and Infrastructure). While we don’t have a formal mentorship program in place, we’ve supported both on-boarding specific type mentoring as well as informal mentorship that generally happens everywhere. When a new engineer joins the team, they typically pair up with the Dev Lead on the team to help them understand the new environment, assist with local development setup, ship their first line of code to production, goes over systems, designs, and process, etc.</p><p>The more natural mentorship happens when engineers work and collaborate together. This happens every day through code reviews, planning meetings, architecture and whiteboarding discussions, retros, etc. Learning happens naturally when devs are working on projects together.</p><p><strong>Professional development stipend for books/trainings. </strong>Engineers can expense books or online training courses (such as Udemy) with a manager’s approval. We’ve also worked with our partners such as Amazon and Google to set up workshops.</p><p><strong>Regular tech talks. </strong>We have various regular meetings where Engineers can learn from each other through sharing.</p><ul><li><strong>Tech demos. </strong>Engineers take 3–7 minutes to show-off what they or their team have built/shipped. Opportunity for engineers to work on their presenting skills as well as learn what other teams are working on.</li><li><a href="https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/"><strong>Guild</strong></a><strong> meetings. </strong>Engineers across the department can present and discuss all tech topics. Think of it as a community of members with shared interests sharing knowledge. On some occasions, we’ve blended these meetings with more “Chapter” like discussions that focus on a particular team/code base’s technical decisions and request for comments.</li><li><strong>2–3 day long hackathons. </strong>Valuable for teams to learn something new either from customer/product perspective or technical perspective. Typically end with presentations by all teams as well as prizes for top winners.</li></ul><h3>Final thoughts and what’s next?</h3><p>Based on my experience, this engineering culture test list is <strong>spot-on </strong>as<strong> </strong>predictors of a workplace that has a great developer culture for the 2020s. Each area is one that FloSports Engineering has intentionally worked on over the last few years and actively being improved.</p><h4>In summary:</h4><ul><li><strong>Basics (</strong><em>safety, fair compensation &amp; flexibility)</em><strong> <br> — </strong>3/3 ✅ ✅ ✅</li><li><strong>Clarity, Autonomy, and Collaboration <br> — </strong>4/5 ✅ ✅ ✅ ✅ 🌱</li><li><strong>Sustainable Engineering Culture <br> — </strong>4/5 ✅ ✅ ✅ ✅ 🌱</li><li><strong>Career Progression <br> — </strong>5/5 ✅ ✅ ✅ ✅ ✅</li></ul><p>I’d say FloSports engineering is a pretty <em>decent</em> place to work. Yea, I know this is a self-assessment from an engineering leadership perspective, but our most recent eNPS score of <strong>+45</strong> backs it up!</p><p><strong>Where do we go from here? </strong>Continue building teams and building software of course! Let’s discuss, learn, iterate, and improve upon FloSports engineering culture.</p><p><strong>What questions do you have for us? Do you think the test criteria is spot on?</strong></p><p><strong>Where does your organization stand? Take the test and share with us your results!</strong></p><p><em>Big thanks to our engineering leaders &amp; managers at FloSports: </em><a href="https://www.linkedin.com/in/jasonbyrne/"><em>Jason</em></a><em>, </em><a href="https://www.linkedin.com/in/kalebdf/"><em>Kaleb</em></a><em>, </em><a href="https://www.linkedin.com/in/nowacek/"><em>Charlie</em></a><em>, </em><a href="https://www.linkedin.com/in/karl-snyder-9b64a23/"><em>Karl</em></a><em>, </em><a href="https://www.linkedin.com/in/steve-green-3546304/"><em>Steve</em></a><em>, </em><a href="https://www.linkedin.com/in/kodiakfurr/"><em>Kodiak</em></a><em>, and to all of our engineers for being an important part of making FloSports an amazing place to deliver value to our fans, ship code, learn and grow together.</em></p><p><em>Also thanks to Nick Schirmer, Jason Byrne and Kaleb Fulgham for fixing my spelling, grammar and passionate mistakes 😃</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69baeb83927f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/taking-the-pragmatic-engineers-developer-culture-test-69baeb83927f">Taking the Pragmatic Engineer’s Developer Culture Test</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross-Cloud CDN Edge Scripting for Cloudflare + StackPath]]></title>
            <link>https://medium.com/flosports-engineering/cross-cloud-cdn-edge-scripting-for-cloudflare-stackpath-738a6a85b2c7?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/738a6a85b2c7</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[stackpath]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cloudflare]]></category>
            <dc:creator><![CDATA[Jason Byrne]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 18:57:58 GMT</pubDate>
            <atom:updated>2020-04-27T19:23:26.523Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJ3yRgKxVMtkNnVNzd_l7A.png" /></figure><h4>Edge-side scripting is the future of CDNs and serverless. But, for companies wanting to be multi-cloud, can we develop shared code that can be deployed to multiple clouds?</h4><p>My readers know by now that I am a <a href="https://engineering.flosports.tv/what-is-edge-side-scripting-9f875d0e431">big proponent of edge-side scripting logic</a>. It is fantastic to run as much logic as you can as close as you can (physically and network topographically) to your user. Being able to customize the behavior of your CDN is also a huge value-add. This is the next logical evolution of the serverless movement.</p><p>All that being said, at some point in your growth toward scale, super high reliability, and failover you want to be able to span multiple cloud and CDN providers. The pain is having to develop that same logic in many flavors, across the different service providers you want to support.</p><p>Previously, we deployed a solution for some of our video-on-demand that used <a href="https://engineering.flosports.tv/authentication-at-edge-with-stackpath-86106e33f5d1">StackPath as the CDN with edge-side authentication</a> logic in front of it. This gave us an efficient means to secure that content behind our paywall. We are quite happy with the job StackPath has done for us in this use case.</p><p>Currently, we are adding Cloudflare as a CDN for our live streams. A big driver in the decision to use Cloudflare was their amazing Workers product. They were one of the very first to launch an edge-side scripting product (along with Amazon Web Services) way back in 2017. They were true pioneers, and it also means the product is very mature and stable.</p><p>In building out the proof of concept (and eventually production-ready code) for Cloudflare, I couldn’t help but notice how similar the code was to what I had written for StackPath EdgeEngine. In fact, it looked almost identical!</p><p>Both are able to use TypeScript/JavaScript and run on the open-source Node V8 engine, created by Google. The request that comes into each service uses the Service Worker API, and it goes out to the backend with the Fetch API. It’s very easy to understand too! Essentially something like this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68bdee0f1df1e9ab9812c96e2bf92332/href">https://medium.com/media/68bdee0f1df1e9ab9812c96e2bf92332/href</a></iframe><p>A similar offering by AWS (called Lambda@Edge) also supports JavaScript, but its code seems much more convoluted and distinctly different format. Here is an example of that.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/977033bb35a5bd02c9ce7da31fb438bc/href">https://medium.com/media/977033bb35a5bd02c9ce7da31fb438bc/href</a></iframe><p>Now I’m not saying it’s not possible to create some libraries that allow you to leverage <strong>some</strong> of the same code to Lambda@Edge. What I am saying is that it is not possible to deploy literally the <strong>same</strong> code to both.</p><p>What I sought out to prove or disprove is, given the virtually identical-looking interfaces, could I literally deploy the <em>exact same</em> code to both Cloudflare Workers and StackPath EdgeEngine.</p><p>Spoiler: the answer is “yes” (with a few caveats).</p><p><strong>Work-Around #1 — Different handling of response.body</strong></p><p>The first gotcha that I ran into was that, for my use case, I need to modify the response body and/or headers that come back from my origin. Let’s say you want to add a custom header.</p><p>With CloudFlare Workers this was really easy. First of all, with both of them, the response is immutable so you have to clone the response as a new response before you can modify it. So that’s why you see me create a new response below, rather than simply add the header to the existing response.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c510e3be3d37b746c1e47a17f7a816c6/href">https://medium.com/media/c510e3be3d37b746c1e47a17f7a816c6/href</a></iframe><p>However, when I ran the above code on StackPath, my response would come back <strong>without a body</strong>! The headers themselves were fine, and the status code was fine. However, there was nothing in the body.</p><p>The workaround turned out to be pretty easy. It seems response.body with StackPath is, for whatever reason, an unfulfilled promise at this point in its lifecycle. So without having the body yet, the cloned response is empty. The code below seems to do the trick and works on both Cloudflare and StackPath with all types of content.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce3956bf1cbf234d785e8fa8dc2b1f51/href">https://medium.com/media/ce3956bf1cbf234d785e8fa8dc2b1f51/href</a></iframe><p>If you are returning text content await response.text() would also work, but await response.body did not seem to work as expected. I decided to use arrayBuffer() though because that will work for both text and binary data or other types of encoding.</p><p><strong>Work-Around #2 — Set the Content-Length Header</strong></p><p>Once I got over that first hurdle, I thought it would be smooth sailing. <em>Not so fast there, J-Byrne!</em> The next thing that I noticed was my content body was getting cut short. We are modifying the response body itself; it gets customized for each user. When I did this, I would see that the last part of the body was cut off on StackPath (but it worked on Cloudflare).</p><p>After a little digging, I noticed that it only happened when I <strong>added</strong> to the body. If the modified body was shorter than the original, all was well. Then I noticed that the body was getting cut off at <strong>exactly</strong> the number of bytes of the original response body. It was an easy leap from there to see that the Content-Length header was not getting updated automatically by StackPath to match the new body length, but Cloudflare was updating it.</p><p>Easy fix.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d49863c8b3569644bf2c11f17dbc64e/href">https://medium.com/media/5d49863c8b3569644bf2c11f17dbc64e/href</a></iframe><p><strong>Work-Around #3 — Fetch so that we hit the edge cache</strong></p><p>I thought I was done, but alas there was one more hiccup. Everything was working fine, and my content was coming through great. However, upon doing a little closer quality assurance (looking into the response headers) I noticed that while Cloudflare was showing a “HIT” on the edge cache, StackPath (with a bit <a href="https://support.stackpath.com/hc/en-us/articles/360001212783-CDN-Caching-Deep-Dive">harder to read</a> X-HW header) was showing me that we were missing the cache layer completely.</p><p>On Cloudflare, we were using the domain of our backend origin server, which was different from our own domain. (We secure this origin so that only certain hosts can pull from it and it is not open to the public, by the way) Using Cloudflare Workers, it did not preclude this request from the CDN caching layer. However, with StackPath, if you request a different domain it acts as a direct fetch from the edge script.</p><p>For StackPath, they want you to pass the original request domain through, and it will resolve it to the proper origin based on the origin settings in the CDN configuration.</p><p>Our origin being an AWS resource bucket, we must pull it as custom host. Let me clarify… say our public-facing CDN domain is <a href="https://cdn.flosports.tv/">https://cdn.flosports</a>.tv and the underlying content lives at <a href="https://video-flosports.s3.amazon.com/">https://video-flosports.s3.aws.c</a>om, Amazon relies on that video-flosports part to know what bucket to pull from, and it usually gets that from the host of the request. So you need to pull from that domain.</p><p>There is a known work-around for this. You can have the request come from your custom <a href="https://cdn.flosports.tv/">https://cdn.flosports.tv</a> domain but set the host header as your AWS domain video-flosports.s3.aws.com. Fortunately, StackPath gives you full control to modify this header in your settings on the CDN layer. Yay!</p><p>Unfortunately, Cloudflare does not. They only let you set the custom host header to a domain that you control (i.e. *.flosports.tv) for supposed security reasons. So that meant with Cloudflare I could not pass through my original request domain to the CDN layer, but on StackPath I had to do so!</p><p><em>Bummer.</em></p><p>After beating my head against the wall for a couple of hours, I decided it was 6PM and time to call it a day. By morning the solution hit me, and it was really simple. I could simply detect which CDN the request was on and customize the domain we use to fetch the asset from the origin.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00735f61df756b3af02d29c4e6528c27/href">https://medium.com/media/00735f61df756b3af02d29c4e6528c27/href</a></iframe><p>I mean, sure, this was the exact thing I was trying to avoid. I did not want to have to write forks of different code to handle each CDN. I wanted to deploy the same, simple code to both and have it “just work.” But in the grand scheme of things, this logic is extremely simple and non-intrusive.</p><p><strong>Bonus Caveat</strong></p><p>We found a few more differences in caching behavior and configuration.</p><p>Cloudflare allows you to override the cache rules in code, in the form of a cf object you can pass to the fetch function. I really prefer this. Being able to configure this in code, source controlled, and deploy changes through the normal process is a huge win. With StackPath you need to manually set your “EdgeRules” in the console. Trevor, please accept this as my formal feature request ticket!</p><p>Also, by default, Cloudflare caches 404s and similar non-200 responses for five minutes. By default, StackPath does not cache them at all.</p><p>With Cloudflare when you set the cacheTtl setting in code, it does NOT apply to everything as you’d expect. Instead, that only applies to 2** response. There is a separate cacheTtlByStatus property you need to set in order to apply the TTL to other status response ranges. This is totally unclear in the <a href="https://developers.cloudflare.com/workers/archive/reference/cloudflare-features/">Cloudflare Workers documentation</a>. We only caught it thanks to the hyper-diligence of our NOC team to bring the issue to our attention.</p><p>Similarly, in the StackPath EdgeRules console apparently you also need to set a separate rule to apply to non-200 responses. Otherwise, those 404 requests are always going wind up hitting your origin.</p><p>This is why we QA so intensely!</p><p><strong>Conclusion</strong></p><p><em>Now… it works great!</em></p><p>It took me about a day of working through the frustration to make this work quite well. Now we have the same edge-side script that can be painlessly deployed to both edge scripting providers. This logic can be deployed either manually or as part of your automated CI/CD pipeline with the <a href="https://www.npmjs.com/package/@cloudflare/wrangler">Cloudflare Wrangler</a> and the <a href="https://www.npmjs.com/package/@stackpath/serverless-scripting-cli">StackPath sp-serverless</a> CLI.</p><p>Finally, I want to acknowledge the hard work of our live engineering team. They did the fast-paced work to get us ready for a transition to these new CDNs on short notice. That team is Niels Brunsgaard, Steve Green, Jen Saylor, Justin Kruse, and Harold Waters. Also thanks to our QA team for helping us get everything verified, Danny Cartagena and Josh McQuillan. Lastly, our NOC team was so helpful in putting up with issues and helping us put together reproduction steps, once we did the soft launch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=738a6a85b2c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/cross-cloud-cdn-edge-scripting-for-cloudflare-stackpath-738a6a85b2c7">Cross-Cloud CDN Edge Scripting for Cloudflare + StackPath</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating From RxKotlin to Kotlin Coroutines]]></title>
            <link>https://medium.com/flosports-engineering/rxkotlin-to-coroutines-43fd77c4264c?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/43fd77c4264c</guid>
            <category><![CDATA[rxkotlin]]></category>
            <category><![CDATA[xr]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin-coroutines]]></category>
            <dc:creator><![CDATA[Peter Graham]]></dc:creator>
            <pubDate>Sun, 15 Dec 2019 05:33:52 GMT</pubDate>
            <atom:updated>2020-06-23T18:34:32.580Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzDjaNj8iLt0FdZXPr4d3Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@rolandsvarsbergs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rolands Varsbergs</a> on <a href="https://unsplash.com/s/photos/rivers?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>The Rx library is a powerful set of tools for asynchronous reactive programming. It comes with many benefits and, when done right, can produce predictable and stable outcomes in asynchronous flows. With that said, it can also be a pain to work with, difficult to read and write and produce head scratching error messages.</p><p>Enter <a href="https://kotlinlang.org/docs/reference/coroutines-overview.html">Kotlin Coroutines</a>. They offer a different way of thinking about asynchronous programming. They have the end result of not dealing with your data in the form of Observables and streams but as plain data.</p><p>At FloSports, when building version 1.0 of the Android app, we relied heavily on the battle-tested Rx toolchain. Our team already knew a good amount of Rx from other projects and it was easy to get started. We were still interested in Coroutines and, in simpler situations, we wrote asynchronous logic using Coroutines so we could try out both and see which one worked better for us.</p><p>After 1.0 we evaluated the two tools and found that Coroutines fit our needs better and produced more readable code. We decided to replace every instance of Rx logic with Coroutines. This allowed us to rip out the Rx toolkit entirely and maintain more consistent asynchronous patterns. In replacing Rx, we got the diff for free so I present to you, a side-by-side comparison of Rx vs Kotlin Coroutines.</p><p>Let’s start with <a href="https://developer.android.com/topic/libraries/architecture/room">Room</a>, which is an Android library facilitating access to the onboard SQLite database. Generally, client databases are light and queries should execute quickly. However, it’s possible that queries could take a while. You’d never want to tie up the main thread running a query, so move it to the IO thread and introduce asynchronous logic. Room supports both Rx and Coroutines out of the box so the transition was pretty smooth for most things.</p><p>The simplest transition was for one-off queries. At the DAO layer, you define your query function and what type the query should return. For one-off queries in Rx, we used Single types.</p><pre>@Query(&quot;SELECT * FROM VideoOnDemandPlaybackProgress WHERE videoOnDemandId = :videoOnDemandId&quot;)<br>fun getByVodId(videoOnDemandId: Long): Single&lt;VideoOnDemandPlaybackProgress&gt;</pre><p>Using Coroutines, we expect straight data to come out of the function but to acknowledge its asynchronous nature, we tag the function as suspend. This enforces that the function must be called in a Coroutine scope. Notice that in the Coroutine example, we defined the output as nullable but we didn’t in the Rx example. Rx Single requires the result to be of the type defined, not null. This can be tricky when dealing with something that is nullable in the database. In this example, the user may not have watched this video and therefore not have a row for this query. More on this later. Here’s the Coroutine implementation.</p><pre>@Query(&quot;SELECT * FROM VideoOnDemandPlaybackProgress WHERE videoOnDemandId = :videoOnDemandId&quot;)<br>suspend fun getByVodId(videoOnDemandId: Long): VideoOnDemandPlaybackProgress?</pre><p>Now that we’ve defined the query, let’s see about its usage. In Rx, we’d subscribe</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06e81bf3e7ff899a3f433ac025f347d7/href">https://medium.com/media/06e81bf3e7ff899a3f433ac025f347d7/href</a></iframe><p>First the compositeDisposable is something we made on every Activity/Fragment to gather all of our subscriptions so we can clean them up when the Activity/Fragment gets disconnected to prevent memory leaks.</p><ul><li>We need to observeOn the mainThread so we can do UI actions.</li><li>We need to subscribeOn the ioThread to take the listener off the main thread.</li><li>We can now set the title based on the vodProgress output. The onSuccess case is only for instances where the query returned a result. Rx considers a null result to be an error. Because of this, we handle the null case in onError.</li></ul><p>Now for Coroutines…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e97ffbdf19b5a318634464e8206020f8/href">https://medium.com/media/e97ffbdf19b5a318634464e8206020f8/href</a></iframe><p>You might notice some things missing. We don’t need the compositeDisposable because Coroutines attached to the scope of the Activity/Fragment are automatically cleaned up. We don’t need to subscribeOn the io thread because Room automatically puts the database operations on io for us. We don’t need to observeOn the main thread because the scope we’re on is the main already (although we could change this if we wanted). In the event that getByVodId is null, we use the null-safety operator ? to just return null in that spot.</p><p>The Coroutine implementation is definitely cleaner here because we don’t have to handle the valid nullable input in the case of Rx’s onError. However, Rx’s code is still pretty readable and it’s not that bad of a tradeoff to maintain its power. Let’s get into something a little bit more complicated…</p><p>Here’s what we were trying to accomplish:</p><ul><li>When we ask for sites from the site repository, it should check the in-memory cache for sites</li><li>If there are sites in-memory, return them and stop</li><li>Else, ask the database for sites and return them</li><li>If there are no sites in the database, ask the API for sites</li><li>Set the API result to the in-memory cache and add the sites to the onboard database</li></ul><p>Not too bad right? Here’s our Rx implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/727e6939e2bde640d4c9453d8240115d/href">https://medium.com/media/727e6939e2bde640d4c9453d8240115d/href</a></iframe><p>Let’s walk through this. getSites needs to return data once so it will return the Single type of a list of sites. Anything we’d get from the database or the api would come in a Single type, so even though cachedSites has the data we need right now, make it a Single with Single.just. If cachedSites doesn’t have what we need, ask the database with siteDao.getAll() and if it gets sites back set the cache. Now we’ll use flatMap to merge this Single in with the api call.</p><p>Here’s the Coroutine implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7a4f0f3eaccb2e8b554963e48d0ebc3/href">https://medium.com/media/b7a4f0f3eaccb2e8b554963e48d0ebc3/href</a></iframe><p>Note the suspend tag on the function definition which allows us to do asynchronous operations synchronously. Also note that this function does not return an Observable or Single. It simply returns the List&lt;Site&gt; object we need.</p><p>Let’s walk through the First, we check the cachedSites object to see if there’s sites available for us. If so, we return them right there. If there’s nothing in the cache, check the database and set cachedSites to it’s output. No database sites? Get the sites from the api and return them. Be sure to put the api call on the io thread. If we can’t get sites from anywhere, return an empty list.</p><p>The Coroutine implementation is far more readable because it allows the data to remain flat. We don’t need to wrap anything in a Single. Just use and return the data.</p><p>Up until now, we’ve been doing asynchronous operations that only return data once. This is what Coroutines were made for. However, what about data that needs to be observed and updated?</p><p>In the following example we need to get sites and determine if they should show up in the “My Sports” section. Simple enough using Rx:</p><pre>compositeDisposable.add(<br>    siteRepository.getAllSitesWithFavoriteInfo()<br>        .subscribeOn(ioThread())<br>        .observeOn(mainThread())<br>        .subscribe(<strong>{ </strong>siteList <strong>-&gt;<br>            </strong>determineMySportsVisibility(siteList)<br>        <strong>}</strong>, <strong>{ </strong>throwable <strong>-&gt; </strong>Crashlytics.logException(throwable) <strong>}</strong>)<br>)</pre><p>siteRepository.getAllSitesWithFavoriteInfo returns an Observable with the site information. Room will automatically push updates for us which we subscribe to.</p><p>If we were to use Coroutines again, they would only return the result once and stop listening. For subscribing we must use <a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/">Flow</a>, which is reactive streams compliant and will operate in much the same way as Observable.</p><pre>try {<br>  siteRepository.getSites().<em>mainCollect</em>(this) { siteList -<strong>&gt;<br>    </strong>determineMySportsVisibility(siteList)<br>  }<br>} catch (e: Exception) {<br>    Crashlytics.logException(e)<br>}</pre><p>Done! The data will continue to be observed on until the outer Fragment gets closed (hence the this that got passed into the mainCollect) and any exception will bubble up to the outer scope for which we can use a try/catch.</p><p>This usage of observables was pretty simple, and I’m sure other apps have much more complicated use cases for which they need more tools to manage many complicated reactivate streams. For our app, the asynchronous operations we needed were fairly simple, and there were only a couple of times we needed to continue to stream data instead of just listening once.</p><p>We decided to fully embrace Coroutines and rip out all of RxKotlin. Surprisingly it only saved us 100kb of final bundle size. We may end up adding back Rx in some spots if the asynchronous nature of our app gets more complex. However, for the current state of our app, replacing Rx with Coroutines and Flow made our logic much simpler and easier to maintain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43fd77c4264c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/rxkotlin-to-coroutines-43fd77c4264c">Migrating From RxKotlin to Kotlin Coroutines</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[False Cliche: Every Journey Begins with a First Step]]></title>
            <link>https://medium.com/flosports-engineering/false-cliche-every-journey-begins-with-a-first-step-f0bac2f04e41?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/f0bac2f04e41</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[career-paths]]></category>
            <dc:creator><![CDATA[Jason Byrne]]></dc:creator>
            <pubDate>Tue, 27 Aug 2019 17:58:19 GMT</pubDate>
            <atom:updated>2019-08-27T18:08:56.719Z</atom:updated>
            <content:encoded><![CDATA[<h3>False Cliche: Every Journey Begins with a Single Step</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0qk_b_lZ5FCFu4sYW6W0dQ.jpeg" /></figure><p>Chinese philosopher Laozi is known as the father of Taoism. He was born around 600 BC and is credited with writing the foundational book “<em>Tao Te Ching,”</em> which helped launch the religion.</p><p>Chapter 64 of that work says, in part:</p><blockquote>A tree as great as a man’s embrace springs from a small shoot;<br>A terrace nine stories high begins with a pile of earth;<br>A journey of a thousand miles starts under one’s feet.</blockquote><p>This has been boiled down into the common cliche: “A journey of a thousand miles begins with a single step.” The phrase seems objectively true and has served as motivation for countless people toward getting off their butts, picking themselves up by their bootstraps (to leverage another cliche), and just stop making excuses!</p><p>It’s a great phrase. I love it! But it’s also <strong>absolutely false</strong>.</p><p>Every journey does not, in fact, begin with the first step. It begins long before that. Taking that first or second or 1000th step without a clear plan in mind is likely to take you to some place you don’t want to go… or worse.</p><p>There is another age-old bit of wisdom that says people lost in the woods often walk in circles. They actually did a scientific study about this in 2009. The Max Planck Institute for Biological Cybergenetics did extensive research with interesting results that verify the claim.</p><p>Nearly all of the participants, that were either in a forest on an overcast day or walking in the desert at night (therefore without benefit of the sun or other landmarks), found themselves eventually looping back on their path.</p><p>The study further observed how blindfolded people would behave when asked to walk in a straight line. It showed that they walked in a circular pattern as soon as 66 feet into their journey! And, when repeated, they did not always circle back in the same direction… sometimes it was clockwise and other times counter clockwise. As their quest to walk straight continued, their circular patterns often tightened into smaller concentric patterns.</p><p>The scientists concluded that it was not due to a genetic flaw nor the curvature of the earth nor even one leg being longer than the other. Instead, they reasoned, it is due to the summation of many micro-miscalculations of the brain. Without the benefit of visual guides, these small mistakes mount up to eventually bring us back to where we began.</p><p>Celebrated American author Stephen Covey wrote his many-time bestseller “7 Habits of Highly Effective People” in 1989. It is still an incredibly impactful self improvement book now 30 years later.</p><p>In it Covey talks about everything in your life having two creations: the first is the mental creation and the second is the physical manifestation. We have to envision the thing we want to achieve (and plan for it) before we start taking the steps to make it a reality.</p><p>That thousand mile journey will be a wandering and fruitless one if you do not first decide the destination, plot the route you plan to take, fill up your gas tank, and bring the map (or GPS) and other needed supplies. So, no, the journey didn’t start with the first step — it started with a goal and then a plan.</p><p>I often talk to friends, family or co-workers (and not just young ones) about their goals and life plan. All too frequently they don’t have one. They don’t know where they want to be in their career in five years — let alone 25. They don’t have a plan for retirement or how to get out of debt or build a nest egg. They don’t really know their aspirations at all.</p><p>Sometimes, as a manager, during one-on-one meetings I get asked where I see their career going. It’s not that I’m bothered by this question, and I will often let people know the track I see them currently on or the momentum they have to the next promotion. However, it’s actually really misplaced to look to someone else tell you what your goals should be.</p><p>I can’t tell you what you to aspire to in your career or what you should want out of life, any more than I can tell you where you should go on your next vacation. I can make a suggestion or tell you what’s worked for me, but it’s different and unique for every person.</p><p>Just like not everyone should aspire to be an entrepreneur, not everyone should aim for being a manager, nor the same subject matter expertise. We all have different passions, different gifts, different motivations, different expectations and work ethics. Your path is not my path and is not the same as any of your co-workers. You are unique.</p><p>A good manager should be there to guide you to chart a path toward your individual goals (once you set them). A mentor can help you unlock your potential or help you see what is possible or realistic. But nobody can set them for you. <em>That’s all on you, buddy!</em></p><p>Every journey of a thousand miles starts with a goal.</p><p>Then with planning and preparation.</p><p>And finally… with the first step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0bac2f04e41" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/false-cliche-every-journey-begins-with-a-first-step-f0bac2f04e41">False Cliche: Every Journey Begins with a First Step</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Alone Own Your Career Path]]></title>
            <link>https://medium.com/flosports-engineering/you-alone-own-your-career-path-a65a93f0881b?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/a65a93f0881b</guid>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[running]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[career-paths]]></category>
            <dc:creator><![CDATA[Jason Byrne]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 05:33:16 GMT</pubDate>
            <atom:updated>2019-07-22T14:29:04.265Z</atom:updated>
            <content:encoded><![CDATA[<h4>Often people believe their manager is responsible for their career progression. Truth is it’s all on you!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*L15LZQZ4F7ukH-pn.jpg" /><figcaption>Two-time state champs Winter Park bank a ten-miler over the summer in the hills of Clermont.</figcaption></figure><p>There is a popular saying within top-ranked high school cross country teams: “Champions are made in the summer.”</p><p>The high school cross country season runs from September through November. The first day of practice is usually in mid-August, once school starts back up. It’s then that the coach tries to mold a band out of shape teens into endurance warriors, who will laugh at the lactic acid burning in their legs by the time the state qualifying series rolls around.</p><p>But, be assured, back in June any coach worth their salt handed each athlete a carefully crafted, personalized summer training plan. They were given mileage goals to hit based on their fitness level. For the cream of the crop athletes that probably meant logging as much as 1,000 miles over the three months of summer.</p><p>The teams that find themselves on the podium come November are the ones who took that seriously. Away from the eyes of their coach they woke up at the crack of dawn to beat the heat. They hit their long slow distance days, their harder mile repeats, and honored their rest days for recovery. With no coach yelling at them to do so, they recorded their splits, tracked their improvement, and entered their mileage into a log book.</p><p>Champions are made in the summer. The coach can’t do it for them. Each one of those runners must take it upon themselves to return that first day of practice fitter than they were the last day of track practice the spring before.</p><p><strong>Racing into Shape</strong></p><p>When a cross country runner comes back from the summer and clearly hasn’t done their off-season work, they are at a severe disadvantage. The first race of the season will be in just two weeks. Reluctantly the coach will sigh and resign that this kid will just have to “race into shape.”</p><p>Many employees expect that they will naturally round into shape simply by doing their job. They believe that the projects they are handed will get steadily harder as they progress, just like the workouts through the cross country season, and this will allow them to improve.</p><p>While assuredly that is true, the rate of that improvement and the upper bound of that performance is going to be severely limited. It is almost impossible for an out-of-shape runner to become a state champion by racing into shape through the season; it is similarly difficult for you to develop your career into being a senior leader by only learning from the tasks that are handed to you each sprint.</p><p><strong>Building a Base</strong></p><p>A high school cross country race is typically 5K (that is 3.1 miles for you Americans). So it might surprise people that the best runners will put in over six miles on most days and usually over ten miles once or twice a week.</p><p>Wouldn’t it just make sense to go out there and run your 5K race distance over and over? Trying to get faster at it each time? No, that’s not the way it works. Runners work to put in solid base mileage, especially over the summer, so that when race day comes that 3.1 miles seems like nothing!</p><p>Similarly, we should all work to become subject matter experts on what we do during our scheduled work week. Just like cross country runners are trying to hone their specialty of a 5K race. We want to be great at that task!</p><p>However, just like the runner is laying that foundation of fitness, we must broaden our peripheral skills of indirectly related technology. That wider knowledge base will end up making our race day seem so much easier.</p><p>The “long slow distance” (or doing LSD as runners jokingly say) that adds to a huge part of that base training isn’t usually done in a regular team practice. That mileage is usually put in over the weekend. The athlete has to take on the responsibility to build out their base on their own time.</p><p><strong>Cross Training is Critical</strong></p><p>Besides simply running, the top cross country athletes also do other things to get into form. They swim. They bike. They lift weights. They even play ultimate frisbee!</p><p>These other activities do a three key things:</p><ol><li>They can mix things up to keep it fun and interesting.</li><li>They reduce injuries of too much slamming of foot into pavement.</li><li>They help you develop different muscles that running alone can’t.</li></ol><p>Similarly, there are other muscles that you need to develop in order to move along in your career path. If you are a software developer there is more to becoming a senior engineer than just being able to write code excellently.</p><p>There are skills to learn about architecture and scalability. You need to learn how to mentor, help with hiring, and become a leader. And you also need to protect yourself from burn out by doing other tangential activities.</p><p>So after you do successfully build that base, start to branch out into other areas. It may seem odd or awkward at first (shouldn’t I be running??), but in the long term that’s going to be what helps you be at your best.</p><p><strong>The Role of Your Coach (Manager)</strong></p><p>So does this mean that the coach has nothing to do with your success?</p><p>Absolutely not! There is a reason that there are dynasties in high school cross country. The same schools often occupy the top spots in the rankings year after year. Why?</p><p>Surely not because there is something in the water fountains that breeds faster runners. The tradition may play a role, but ultimately it is because the coach has successfully inspired them and given them the road map of how to become successful in their sport.</p><p>But at the end of the day, it is the runners who put in the mileage. It is the athlete who takes the advice from the coach and applies it every single day. Not just when the coach is watching. Not just when teammates are around. Nor do they just give their best on race days.</p><p>The top runners go out and execute the plan on their own. They sneak in a second evening run, after having already ran normal practice that morning. They pound out that LSD day on Saturday and cross-train on Sunday.</p><p>The coach has a huge role. They will give you a personally crafted map to become successful. The caring coach will provide you thoughtful advice, sometimes about race strategy and sometimes just about life.</p><p>Usually top athletes will go back to the coach wanting more. They’ll say “Hey Coach, I feel really good after this workout. What extra can I do?” And the coach will tell them to hit a faster split on the next mile repeat or say add a couple extra miles to the long run this weekend. Or whatever the coach knows the runner needs to take it to that next level.</p><p>The good runners beg for more. The good coaches either eagerly give it to them or, other times, sagefully advise them to take a day off.</p><p><strong>Go Forth and Be Coachable</strong></p><p>One of the top qualities in athletes who are lauded by college recruiters is when they are deemed “extremely coachable.” That means the athlete will buy into the program’s philosophy and follow the plan. They go out and get it done, even when they don’t understand it, because they trust their coach.</p><p>Now that only works when you have a good coach! If you don’t think you can buy into what the coach is selling, well maybe you need to change teams.</p><p>But if you believe your coach knows what he/she is doing. And you believe they have your best interest at heart. Then ride that partnership all the way to new heights in your career.</p><p>Ultimately though, the coach can’t run the workouts for you. Your manager can’t read that book for you, make you step out of your comfort zone, or force you to take up a side project.</p><p><strong><em>YOU</em></strong> must take ownership of your own progress. Because no one else can log those miles for you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a65a93f0881b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/you-alone-own-your-career-path-a65a93f0881b">You Alone Own Your Career Path</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step One to Effective 1-on-1 Meetings]]></title>
            <link>https://medium.com/flosports-engineering/step-one-to-effective-1-on-1-meetings-efc25aaad249?source=rss----b517ac6fa4a8---4</link>
            <guid isPermaLink="false">https://medium.com/p/efc25aaad249</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[meetings]]></category>
            <category><![CDATA[engineering-mangement]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[leadership-skills]]></category>
            <dc:creator><![CDATA[Jason Byrne]]></dc:creator>
            <pubDate>Sat, 22 Jun 2019 16:51:26 GMT</pubDate>
            <atom:updated>2019-06-22T16:51:26.469Z</atom:updated>
            <content:encoded><![CDATA[<h4>Building a happy team all starts with caring enough about your reports’ wellbeing to ask them.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*bBxadtsN1_gAdb4PAiMZ3w.gif" /></figure><p>Here at FloSports we focus a lot of attention on employee happiness. We know that when folks love to work at a company, it has positive effects on every aspect of the business.</p><p>It fosters a great culture, results in a better product for end users, and makes it easier to recruit new talent. Additionally, since on-boarding new employees is a costly drain on both time and money, finding ways to reduce turnover can magnify those impacts exponentially.</p><p>“Great!” you say, “But how?”</p><p>There are entire books written on this subject, but one prerequisite to improve anything is to measure it. So, first things first, our HR team has become diligent in measuring internal NPS. Once we know that baseline and gather the feedback, we can actually work to make improvements.</p><p>Our engineering team has led the way at FloSports with the highest internal NPS score. Because of our scores averaging in the enviable 40–65 range, managers in other departments have pinged me that are curious about what practices they might be able to implement with their teams.</p><p>My first tip is to really really care about it. The Flo Engineering leadership team meets regularly to discuss pertinent issues. We use each other as sounding boards, and we collectively seek ways to make the experience of our team better.</p><p>Just like gardening, a plant won’t grow unless you water it regularly! Focus on being a better manager, get a group together and work through ways you can learn from each other, and it will start to happen.</p><p>But secondly, one of the most important tools in a manager’s toolbox is having regular 1-on-1 meetings with each of your direct reports. However, in the experience of many, these meetings can become redundant and ineffective at accomplishing that task. They often morph into little more than project status updates and, at best, you end up giving them some advice with a task they’ve been struggling to complete.</p><p>And that’s great, but if that’s the bulk of the meeting, then you’re both missing out on an opportunity.</p><p>In this article I’m going to stick to just one thing, so don’t expect this to be a complete guide to everything you should be doing in one-on-ones. Maybe we’ll expand upon that some other time.</p><p>The first and most important question that I ask… and I generally open every meeting with this question is… wait for it…. “How are you doing?”</p><p>Not exactly revolutionary, right? The thing about me asking my report that simple question is I don’t mean it in the flippant way that it’s often used. We say “how’s it going?” as we pass someone in the hall, without ever actually waiting for an answer. It’s basically just “hello” in common speech.</p><p>But when I ask them how they’re doing, I do it with a tone that they know I mean it seriously and I want a serious answer. And I don’t want necessarily an answer about work. I want to know how their life is going. Are they wrestling with a tough life decision? Is a family member sick? Did they do something really fun over the weekend? Did their kid win an award?</p><p>The power of asking “how are you doing” and really meaning it, is that it lets them know that you care about them as a person. And you can’t try to just fake it… you really actually have to care!</p><p>Too often employees feel like just cogs in the wheel. Their manager only really cares about if their being productive little worker bees and closing tickets.</p><p>Good managers take a personal interest in their reports and invest themselves into their wellbeing. When you begin to let them know that you honestly care about them personally, you’ll find a whole new world opens up to talk about how they’re doing professionally as well.</p><p>It builds up the trust that they have in you to share things with you. They’re going to be more apt to tell you about the thing that they’re struggling with. They’re going to let you know that they’re feeling stuck in a rut, wondering what their future is, or thinking about looking for another job. They’re going to share with you the person who is bringing the team morale down. And, hopefully, they’re also going to feel comfortable enough to give you feedback on things you could be doing better as well. (and you better be receptive!)</p><p>But it all starts with genuinely asking: “How are you doing?”</p><p>Try it in your next one-on-one. And if they give you a flip answer like “fine” or they start talking about work… stop them… and ask again. Not the job. Not superficially. How are you really doing personally? Start with that, and then build from there!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efc25aaad249" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flosports-engineering/step-one-to-effective-1-on-1-meetings-efc25aaad249">Step One to Effective 1-on-1 Meetings</a> was originally published in <a href="https://medium.com/flosports-engineering">FloSports Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>