<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by James Munro on Medium]]></title>
        <description><![CDATA[Stories by James Munro on Medium]]></description>
        <link>https://medium.com/@jdmunro?source=rss-5f685d02dd8c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*R1fgj_6LqSvI5ac3FQsgag.jpeg</url>
            <title>Stories by James Munro on Medium</title>
            <link>https://medium.com/@jdmunro?source=rss-5f685d02dd8c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:43:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jdmunro/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Moving to Monaco — A Journey to a Better Code Editing Experience]]></title>
            <link>https://blog.datacamp.engineering/moving-to-monaco-a-journey-to-a-better-code-editing-experience-8c2aa5360be5?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c2aa5360be5</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[datacamp]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[user-experience]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Mon, 19 Jul 2021 07:01:49 GMT</pubDate>
            <atom:updated>2021-07-19T09:00:50.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>Moving to Monaco — A Journey to a Better Code Editing Experience</h3><p>Last year, we deployed a major re-implementation of the core code editing experience of our interactive courses. In this article, we explore how our engineering team tackled the difficult problem of swapping out one of the major components of the DataCamp experience with minimal disruption to our users, whilst simultaneously reducing technical debt and laying the foundations for future success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*diTm6DByeTNG7Kwp5kc4lA.png" /><figcaption><a href="https://unsplash.com/photos/1CkSNmbT7J0">Image Source</a></figcaption></figure><p>Our journey is broken down into 6 steps:</p><ol><li>📍<strong> Our starting point</strong> — the “legacy” coding experience and its limitations</li><li>🗺️<strong> Choosing our destination</strong> — what does the new coding experience look like?</li><li>📝<strong> Planning our itinerary </strong>— how will we get to our destination?</li><li>🛫<strong> Bon voyage</strong> — a dive into the journey itself</li><li><strong>🛬 Final approach </strong>— incrementally delivering our new experience</li><li>🏖️ <strong>Arrival at our destination</strong> — a reflection on where we landed and our next steps</li></ol><h3>📍 Our starting point</h3><p>In order to put our journey into context, we need to understand our starting point. One of the core components of the <a href="https://campus.datacamp.com/courses/intro-to-python-for-data-science/chapter-1-python-basics?ex=2">DataCamp learning experience</a> is the code editor, where users can type in their code and see the output of its execution below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WL7j_YRlDySJc2kaAgKH2w.png" /><figcaption>The legacy DataCamp code editor</figcaption></figure><p>The starting point of our journey is a custom code editor built on top of the <a href="https://ace.c9.io/">Ace Editor</a> library. This editor had served as the reliable backbone of Campus — our interactive course application — for several years. Over time, the limitations of our existing implementation started to show:</p><ul><li><strong>Poor accessibility</strong>: We wanted to improve the accessibility of our coding experience. This was difficult to achieve with our current implementation due to the foundations it was built upon. Amongst other problems, it suffered from the “keyboard trap” — the focus of the keyboard would be swallowed by the editor and would essentially be impossible to escape — this was a severe limitation for users who use screen readers and navigate with their keyboards</li><li><strong>Poor abstraction</strong>: Due to how it was originally implemented, coupled with “code rot” over the years, the old editor was poorly abstracted and it was difficult to understand where it’s boundaries were within our application. Put more simply, the code was scattered around in different places and difficult to reason about. This made it difficult for us to maintain and build new features for</li><li><strong>A technological dead end</strong>: It was built on top of a mature, but “old school” code editing library from an earlier generation of JavaScript libraries, which no longer sees much in the way of active development — limiting future improvements to the user experience</li><li><strong>Bad page performance</strong>: Because of blurry component boundaries, it was difficult for us to find a suitable “seam” to split our code bundle. This meant that it was bundled into the main JavaScript bundle of our application irrespective of the type of exercise the user was taking, ultimately slowing down their experience</li></ul><p>With these problems in mind, it was time for us to imagine our destination and what that might look like.</p><h3>️🗺️ Choosing our destination</h3><p>With the problems of our previous implementation in mind, we set about dreaming of what our ideal destination would look like:</p><ul><li>Better accessibility for our users</li><li>A simple abstraction with clear boundaries</li><li>Modern underpinnings with continued development for the foreseeable future</li><li>An overall more simple implementation with less hacks and workarounds that is easier for us to reason about</li></ul><p>In most circumstances, we would lean towards doubling-down on an existing implementation and working to improve it slowly over time, an approach that we have seen great success with in the past. However, due to its overall state, in this case we preferred to start from scratch with better technological foundations, but with an emphasis on building and delivering this incrementally to avoid the pitfalls of a “big bang” re-write.</p><p>The most important decision we would make is which code editing library to build upon. Building a code editor from scratch is a monumental undertaking and not something we wanted to consider as we certainly wouldn’t do a better job than any of the existing dedicated libraries.</p><p>We evaluated several solutions along the way, but ultimately settled on building our editing experience on top of <a href="https://microsoft.github.io/monaco-editor/">Monaco</a>. Some of you may know Monaco as the sunny microstate host of the Grand Prix on the French Riviera — but it is also the open-source editor that powers <a href="https://code.visualstudio.com/">Visual Studio Code</a>, a vastly popular and well supported Integrated Development Environment.</p><p>Our reasons for choosing Monaco include, but are not limited to:</p><ul><li>Greatly improved accessibility support built-in</li><li>A more modern editing experience for our users, and a more modern API for us to work with, around which we can build a simple abstraction</li><li>It’s supported both by Microsoft and as an open-source project and likely to be developed for the foreseeable future</li><li>It’s modular and allows us to only ship the bits and pieces we need to power the DataCamp experience</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7E6qz0BxEBsJM8ABLdhhYw.png" /><figcaption>Monaco Editor — as used in Visual Studio Code</figcaption></figure><p>With our destination decided, we could now focus our efforts on developing the new editing experience.</p><h3>📝 Planning our itinerary</h3><p>Although it did a great job of powering the DataCamp coding experience, our existing code editor implementation was difficult to work with because it was not well encapsulated:</p><ul><li>It was split over several different packages in different repositories. This added cognitive overhead to understanding how it worked and also added friction to the developer experience</li><li>It was also a “leaky abstraction”. Though it was abstracted, there were also little bits of code, CSS and duplication scattered throughout the host application which made it difficult to find a true “seam” or boundary beyond which the module actually lies</li></ul><p>These problems made maintenance difficult, and we wanted to give ourselves the flexibility to be able to change the underlying editor in the future without needing to make sweeping changes to our codebase. As a bonus, it would also provide a great leverage point for asynchronously loading the code editor which allows us to defer loading the module until we really need it.</p><p>For our new implementation, we settled on the simplest abstraction we could use in this scenario: a React component, that we could drop into our codebase with a handful of props required to interface with the host application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2j9oTeUBbWB_kuubJWm2g.png" /><figcaption>We intended to fully encapsulate the complexities of the editor behind a simple component interface</figcaption></figure><p>Being able to integrate our editor into Campus with relatively few lines of code made it easy for it to coexist with the existing editor functionality. As mentioned before, we are aiming to build the new editor incrementally and avoid a “big bang” rewrite/release and having a well-encapsulated component made it pretty trivial to wrap the code path with a feature flag which would allow us to dynamically switch on/off the new functionality to specific users or a certain percentage of our user base (which we’ll discuss more later on!).</p><p>With our itinerary planned, we could now embark on our great journey!</p><h3>🛫 Bon voyage</h3><p>Now that we know where we’re going and how we’re going to get there, the next step of our journey was to build the new coding experience.</p><p>At DataCamp, we write most of our frontend code in React. In order to make Monaco more convenient to work with we used a simple wrapper, react-monaco-editor, which allows Monaco to render more easily as a React component.</p><p>We load the editor code bundle itself using <a href="https://github.com/microsoft/monaco-editor-webpack-plugin">monaco-editor-webpack-plugin</a>: this gives us more control over how the editor is bundled and allows us to pick the different elements of Monaco that we need. For instance, select only the language support that we actually use in our courses such as Python or R. By only loading support for select languages and features, we are able to keep the bundle size down which means it will load quicker in our user’s browsers.</p><p>Although much of the editor heavy lifting is provided by Monaco itself, we also have a large amount of custom logic that is essential to the DataCamp interactive coding experience:</p><ul><li>Custom keyboard shortcuts and behaviour: for instance, <em>Shift+Return</em> will execute the current line and move the cursor to the next line</li><li>Custom error highlighting: when you submit an exercise on DataCamp, the backend may return a code location which we can then use to render an error</li><li>Custom syntax colouring: the final version of the new editing experience would be shipped as part of <a href="https://www.datacamp.com/community/blog/new-brand">our 2020 brand refresh</a>, and so everything needs to look the part</li><li>Custom autocomplete behaviour: the code suggestions that you see while editing code on DataCamp is inferred both by tokenizing the exercise code, but also by executing commands on our backend</li><li>The removal of various Monaco features that are not required in our editing experience, for instance the built-in Command Palette</li></ul><p>We set about implementing the above without falling into the trap of our previous version: we made sure to implement the features as simply as possible and at all times kept them encapsulated within the confines of the interface that we defined above in order to avoid a “leaky abstraction” and a maintenance nightmare in the future.</p><p>Unfortunately, it was sometimes necessary for us to use “hacks” or workarounds required to implement some of the custom logic. However, we keep these to an absolute minimum and documented when they were required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GppdhB82-nT6KG_evi86Ig.png" /><figcaption>A necessary evil — but still well encapsulated!</figcaption></figure><p>There’s also another aspect of the DataCamp coding experience that we haven’t mentioned yet: the interactive console. The console is where users can type in ad-hoc commands/code and see the output in a scrollable buffer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGNXlcCcAMEM-L4wmyRUTg.png" /><figcaption>The interactive console</figcaption></figure><p>But why are we talking about this in the context of the code editor? If you take a closer look at the console component you’ll notice that there’s more to it than meets the eye. In order to create a unified user experience, the text input where the user types needs the same text editing experience as the main code editor — including the same autocompletion experience. You may be surprised to learn that that single line text input is also an instance of the Monaco editor!</p><p>Whilst the previous Ace implementation of the console component was also an editor instance, it also included a lot of ugly workarounds involving read-only cursor selections to manage the code output and history. This time around we were keen to keep the complexity to a minimum and so we opted to write a much simpler history buffer and used Monaco only for the actual command line where the user types.</p><p>We built our new code editor component incrementally over a couple of sprints (we typically use 2-week sprints) and by utilising the feature flag we were able to deliver the functionality incrementally and iteratively, which we talk more about as we begin our final approach to Monaco!</p><h3><strong>🛩️ </strong>Final approach</h3><p>With our new implementation in place and safely tucked away behind a simple abstraction, we were nearly ready to go live. However, with such a fundamental under-the-hood change, we were keen to mitigate any major problems.</p><p>Much like a plane reducing its altitude on final approach for landing, we opted to release our new editing experience in incremental stages:</p><ol><li>We first shipped the feature internally to gather feedback from staff</li><li>We then rolled out to 10% of our user base and increased this by a further 10–20% each week as our confidence in the new implementation increased</li></ol><p>Both of these steps were extremely valuable for us to gather feedback and iron out any last-minute quirks. We have several DataCamp employees who are also heavy users of the platform, and some of the most valuable feedback came from them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0p2RvWwWZG73Z7DBRX8bqA.png" /><figcaption>Whoops! Probably should fix that…</figcaption></figure><p>With a few course-corrections in place we then began to scale up to our wider user base and corrected any bugs or small changes in behaviour as they were reported.</p><p>The final 100% rollout of the new editing experience was coordinated to occur at the same time as our platform-wide brand-refresh of 2020. In October 2020 we finally flipped the switch and the new coding experience was live for our entire user base!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-6mYlIK6i-_Q0i6_9bHmA.png" /><figcaption>The new Monaco-based coding experience!</figcaption></figure><p>However, there was one final step to take. Due to the incremental rollout we had performed, the main codebase of Campus essentially contained two full code editors side-by-side: the legacy experience, receiving 0% of the traffic, and the new experience receiving 100%. The last step was simply to delete the old editor and all its code paths from our codebase!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ya9pFxKVaPe6k92biRYvDA.png" /><figcaption>Cleaning up!</figcaption></figure><h3>🏖️<strong> </strong>Landing at our destination</h3><p>It’s been a long journey, but we’ve finally arrived at our sunny destination! The sea is warm and the piña colada is cool. Let’s take a closer look at exactly where we’ve landed. But first, let’s quickly reflect on where we started:</p><ul><li>A codebase that was difficult to work with and change</li><li>An editing experience based on an older and not actively developed editing library</li><li>Limited support for accessibility features</li><li>A poorly abstracted implementation that had to be loaded synchronously with the main application bundle</li></ul><p>In contrast to where we are now:</p><ul><li>A simpler codebase that is well abstracted and easier to maintain</li><li>Built on top of Monaco, a more modern and actively developed editing library</li><li>Greatly improved accessibility features — and no keyboard trap (<em>Ctrl+Shift+M</em> on Mac, <em>Ctrl+Shift</em> on Windows/Linux)!</li><li>As a bonus, can be loaded asynchronously due to a clear abstraction boundary which helps us to manage performance</li><li>A better experience for our users!</li></ul><h3>🕶️ Eyes on the horizon</h3><p>Let’s take a look at some of the key learnings from our great journey and look towards the future.</p><h4>Pick the right abstraction</h4><p>One of the key problems with our previous implementation was that it was poorly abstracted. With a leaky, but also over-extracted design, it was difficult to find the boundaries of our previous implementation, and subsequently difficult to work with.</p><h4>Aggressively reduce complexity</h4><p>Due to limitations of the foundations that we built upon, our previous implementation contained many hacks and workarounds, when often there was a simpler approach available.</p><h4>Stand on the shoulders of giants</h4><p>Our original editing experience suffered from poor accessibility, and also few prospects for improving the status quo. By building upon newer and better supported foundations we are able to provide a better experience for our users for the foreseeable future.</p><h4>Build and deliver incrementally</h4><p>One of the key tenets of Agile is to build and deliver incrementally, and this project was no exception. Avoiding a “big bang” release allowed us to deliver value incrementally, incorporate feedback from our customers and ultimately mitigate the risk of changing one of the most fundamental aspects of the DataCamp coding experience.</p><h3>💭 Closing thoughts</h3><p>Though we find ourselves in a better place to where we started, our journey is not yet over. We have laid the groundwork for success but there is still much work to be done:</p><ul><li>Monaco is an extremely capable platform to build upon: though we get a lot for free, we have not yet begun to reap all of the benefits by way of innovating the core user experience of our editor</li><li>We have improved the accessibility of the code editing experience, but there is still a significant amount of things we could do better and will continue to do so in the future, not just within our courses, but across the whole DataCamp platform</li><li>We are taking a closer look at performance this year, and there’s no avoiding that Monaco is a large library to ship to a browser. This is especially impactful to our customers in developing territories where performance and bandwidth is more scarce. We have only scratched the surface of the improvements we can make to the amount of code that we ship and will be working on this in the coming weeks and months</li><li>Due to the requirement of supporting very old browsers, we are based upon an older version of the Monaco editor. We have recently dropped support for some older browsers which means we can now embrace the latest versions of Monaco.</li></ul><p>Overall, we’re happy with how this project played out and learned valuable lessons about swapping out a key part of the DataCamp learning experience with minimal disruption to our learners. We hope you enjoyed the trip!</p><p>By the way, <a href="https://www.datacamp.com/careers">we are hiring</a>! There are a lot of open positions across many departments including Data Science and Engineering. Come and see, we’re eager to meet you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c2aa5360be5" width="1" height="1" alt=""><hr><p><a href="https://blog.datacamp.engineering/moving-to-monaco-a-journey-to-a-better-code-editing-experience-8c2aa5360be5">Moving to Monaco — A Journey to a Better Code Editing Experience</a> was originally published in <a href="https://blog.datacamp.engineering/">DataCamp Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips for effective remote communication]]></title>
            <link>https://blog.datacamp.engineering/tips-for-effective-remote-communication-12642517eab0?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/12642517eab0</guid>
            <category><![CDATA[slack]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[company-culture]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Mon, 15 Mar 2021 10:03:23 GMT</pubDate>
            <atom:updated>2021-03-15T11:45:14.073Z</atom:updated>
            <content:encoded><![CDATA[<p>Being a remote worker, or working with remote teams forces us to be more intentional about when and how we communicate. Over the last few years I’ve either been working as a fully remote employee or with remote teams. This has been a humbling experience and I’ve learned a lot about what does and doesn’t work when it comes to communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUHEsRyQdSRw95L9XuiE2w.png" /><figcaption><a href="https://unsplash.com/photos/FlPc9_VocJ4">Image Source</a></figcaption></figure><p>In this article, we’ll take a look at some simple guidelines and practical advice which can be useful for remote teams, or teams who have remote workers, to enable both to communicate more effectively. By the end of the article, I hope that you will be encouraged to consider writing a shared team document that describes your team’s communication principles — or at least to be curious about how your team currently communicates and whether there are improvements you could make. Let’s dive in!</p><p>One of the biggest paradigm shifts in remote work is that natural opportunities for synchronous communication between your peers becomes harder, and asynchronous communication becomes the norm. In your remote team setup, no doubt you are using tools such as Slack. At <a href="https://www.datacamp.com/">DataCamp</a>, we use Slack, and whilst it’s become an essential tool, it also requires us to adapt the way we think about communicating in order to make it work for us.</p><h4>⏲️ Don’t expect immediate responses</h4><p>When messaging people via such tools, you should not expect to receive immediate replies to your messages as you would with in-person communication. Unfortunately, typing a quick message to a colleague is not the same as walking over to their desk and having a quick chat in person.</p><p>There are numerous reasons your colleagues may not respond immediately. At DataCamp, we encourage engineers to block out sections of their calendar for <a href="https://www.calnewport.com/books/deep-work/">Deep Work</a> in order to foster focus, and it would be unreasonable to expect people to be constantly monitoring Slack during that time. Similarly, someone might be away from their keyboard, in a meeting, or simply in another time zone.</p><p>As the recipient of a message, it is courteous to acknowledge that you have seen or handled a request with a response or an emoji reaction such as 👍, especially as the original sender may be in a different time zone and might not revisit the message until the following working day.</p><p>If you find yourself needing immediate responses from people, most likely your request is urgent (is it really?), and you might not have a suitable process for escalation in place. In these situations, typing a message in Slack may not be the best approach.</p><h4>🗣️ Be highly effective with synchronous communication</h4><p>For those urgent situations (are you still sure it’s urgent?), or for situations where a discussion with real-time interactions might be more effective, then synchronous communication is required.</p><p>Within our teams at DataCamp, we typically have at least a 30 minute slot each day where high context topics can be discussed in a video call. We encourage anyone in the team to bring topics for discussion during this time, especially those which are more urgent and cannot be resolved in an asynchronous manner.</p><p>To help facilitate this, some teams have a Slack channel which serves as the agenda for the meeting. Sometimes during an asynchronous conversation it may become clear that it would be more effective to bring the topic to a meeting for further discussion — we use a predetermined emoji reaction that shares the topic into our meeting channel using the <a href="https://slack.com/intl/en-gb/blog/productivity/a-new-way-to-share-messages-across-channels-using-emoji">Reacji Channeler extension</a> — and the topic can then be picked up at the next daily meeting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sJvSEEnEH03PLqKh" /><figcaption>A message shared as a meeting agenda item</figcaption></figure><p>Sometimes, these topics end up being too large for the regular meeting. In these situations, it can be more effective to spin the discussion out into a separate meeting of its own.</p><p>We also have scheduled meetings on specific topics where interaction is much more dynamic, such as a collaborative brainstorming session. In these circumstances, the session should be booked with both sufficient notice and a clearly defined agenda with desired outcomes, plus any upfront preparation required by the participants.</p><p>On very rare occasions, some things are simply too urgent to wait and we encourage people to break out into video calls on-demand — however, this should be the exception and not the norm. Ideally, there will be a shared understanding within your teams on how to handle such situations — for example, having a handy /zoom shortcut to trigger a zoom call within a message thread.</p><p>The key take-away is that synchronous discussion is highly valuable and that team members should strive to be intentional and highly efficient with the time — you might just find that you need less meetings than you expect.</p><h4><strong>🎬 </strong>Default to action</h4><p>Another useful technique in remote teams is to default to action, or exhibit a bias to action. For example, if as an engineer, you feel unable to proceed due to a lack of clarity on a functional requirement, use your knowledge of the product strategy to make a best effort attempt to resolve the issue until further input can be received using one of the other methods.</p><p>Use your discretion: if there is significant engineering or other cost at stake, err on the side of caution. This may occasionally mean a wrong -call is made, however this may be indicative of an underlying team alignment issue more so than the individual’s judgement.</p><p>While this approach does require a certain degree of trust between team members, it also encourages strong alignment on direction and is a tradeoff to reduce potential dependencies and bottlenecks. Ultimately, the vast majority of decisions are reversible and it’s unlikely to cause significant setbacks. However, you should always retrospect on situations where this occurs to distinguish whether or not the right call was made.</p><h4><strong>📝 </strong>Leave a paper trail</h4><p>As so much of our communication has shifted over to asynchronous communication with Slack, it can be hard to keep track of all of the decisions that have been made. To counter this, it is essential to keep a paper trail of decisions and outcomes.</p><p>As a remote team member, it can be frustrating to stumble upon Slack threads and discussion where something important was discussed, and yet the resolution is missing. However, there are simple techniques to counter this.</p><p>One simple trick is to make sure to revisit threads and make sure that when a decision or outcome is reached, that it is stated in the thread. On top of this, you can mark the thread as resolved by adding a predetermined reaction emoji such as ✅. This way, anybody reading over a discussion will clearly be able to see that the thread is resolved, and more importantly, the action that was taken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4iqMvaovq9KzGrSY" /><figcaption>Resolved threads, denoted with ✅</figcaption></figure><p>You can also combine this approach with the <a href="https://slack.com/intl/en-gb/blog/productivity/a-new-way-to-share-messages-across-channels-using-emoji">Reacji Channeler</a> extension to keep a team decision log: mark decisions and outcomes with a specific emoji that will be automatically shared into a decision log channel to create a centralized location for all decisions.</p><h4><strong>🚨 </strong>Have a plan for handling emergencies</h4><p>The best way to handle an emergency is not to have one in the first place! However, sometimes Murphy’s law applies. Be prepared for these situations, and have a clear protocol for handling emergencies.</p><p>For instance, you might use a tool such as <a href="https://www.pagerduty.com/">PagerDuty</a> to ensure that somebody is always on call for a given service in your stack. By using multiple levels of support, you can ensure that emergencies and incidents can be escalated and that somebody is always on hand to help resolve the problem — don’t rely on trying to nudge people on Slack.</p><p>All of these guidelines require diligence and a shared understanding between team members, which leads on nicely to the next point — writing down your communication principles.</p><h4><strong>🧠 </strong>Foster a shared understanding</h4><p>At this point, all of these guidelines are becoming difficult to remember. Additionally, none of this is much use if only <em>one</em> team member is following the advice. The best way you can encourage efficient communication is to build a <em>shared understanding </em>of what works for you and your team.</p><p>A simple way of achieving this is to agree on and write down your communication principles in a team-owned shared document. In fact, this article was inspired by and paraphrases sections of the communication principles documentation of one of the engineering teams at DataCamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_ZgOljZc_OBM2_yV" /><figcaption>An example of a communication principles document</figcaption></figure><p>Ideally, everyone in the team needs to understand this document as it will serve as their guideline on how to work together effectively. Not only is it a useful resource for existing team members, it serves as a great onboarding resource for new team members to quickly get them up to speed.</p><p>Now that you have your shared communication principles, everything is perfect and set in stone, right? Wrong!</p><h4><strong>➰ </strong>Learn and adapt</h4><p>If there’s one key message to take away from this article, it’s that you should introspect and be curious as a team about how to work effectively remotely. No doubt, most teams will have experienced some teething troubles and you should not accept the status quo as being the way things will always be.</p><p>In your team, you most likely already have a process for continuous improvement (such as an Agile methodology). A simple way to learn and adapt is to include any communication mishaps or triumphs as part of your retrospective ceremony — what went well and what didn’t go so well with regards to communication — and how can you factor this into your next working iteration?</p><p>Embrace that this way of working does not come naturally to some, and will be a new experience for many people. There is always more to learn. Take a look at what does and doesn’t work for your situation and adapt as necessary, and be sure to keep your shared communication principles document up-to-date.</p><p>To conclude, the advice in this article can be distilled into a few key points:</p><ul><li>Use the right tool for the job (synchronous vs asynchronous discussion)</li><li>Build strong team alignment and encourage a default-to-action approach</li><li>Keep a record of important decisions and outcomes</li><li>Have a plan for escalating in emergency situations</li><li>Learn from your mistakes and adapt your approach</li><li>Foster a shared understanding of how to communicate effectively</li></ul><p>By the way, <a href="https://www.datacamp.com/careers">we are hiring</a>! There are a lot of open positions across many departments including Data Science and Engineering. Come and see, we’re eager to meet you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12642517eab0" width="1" height="1" alt=""><hr><p><a href="https://blog.datacamp.engineering/tips-for-effective-remote-communication-12642517eab0">Tips for effective remote communication</a> was originally published in <a href="https://blog.datacamp.engineering/">DataCamp Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Surfing the JavaScript Wave: Embracing Incremental Change in Real World Software Projects]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/swlh/surfing-the-javascript-wave-embracing-incremental-change-in-real-world-software-projects-e6b044161c75?source=rss-5f685d02dd8c------2"><img src="https://cdn-images-1.medium.com/max/1600/1*-nmG6nDat6fhTsVlwMpIjA.jpeg" width="1600"></a></p><p class="medium-feed-snippet">The JS ecosystem moves forwards at a break-neck pace. New paradigms, frameworks and tools are released seemingly every day.</p><p class="medium-feed-link"><a href="https://medium.com/swlh/surfing-the-javascript-wave-embracing-incremental-change-in-real-world-software-projects-e6b044161c75?source=rss-5f685d02dd8c------2">Continue reading on The Startup »</a></p></div>]]></description>
            <link>https://medium.com/swlh/surfing-the-javascript-wave-embracing-incremental-change-in-real-world-software-projects-e6b044161c75?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6b044161c75</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Fri, 25 Oct 2019 05:01:02 GMT</pubDate>
            <atom:updated>2019-10-25T05:01:02.917Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Porting Practice to Web: react-native-web in Production at DataCamp]]></title>
            <link>https://medium.com/front-end-weekly/porting-practice-to-web-react-native-web-in-production-at-datacamp-c009daf2cbb4?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c009daf2cbb4</guid>
            <category><![CDATA[react-native-web]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Thu, 14 Feb 2019 18:18:40 GMT</pubDate>
            <atom:updated>2019-02-14T18:18:40.778Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This article is part of a short series in which DataCamp’s Practice &amp; Mobile Team describe the process of porting a mobile application to the web. In this second article, we go in depth on our experiences of working with react-native-web on a production application.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RLmMNKqu-_s5aHtoA9syyw.png" /><figcaption>Practice on Web: our mobile app ported to web using react-native-web 🔧</figcaption></figure><p><a href="https://medium.com/front-end-weekly/90-code-reuse-in-production-with-react-native-for-web-how-datacamp-ported-their-mobile-app-to-593e712e07a3">In the first article of this series</a> we described how our journey began with a proof-of-concept of the mobile app running in the browser. Getting this up and running involved following the <a href="https://github.com/necolas/react-native-web/blob/master/README.md">official documentation for react-native-web</a>. This involves setting up Webpack to compile a new web target from the mobile source code, and aliasing react-native so that it uses the react-native-web implementation instead. So far so good. However, we soon stumbled into another problem: the mobile source code makes references to ‘native modules’ which do not have web counterparts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Ff%2F788447%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2F788447%2F&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/18214d8333adbb5668f31791a3202b60/href">https://medium.com/media/18214d8333adbb5668f31791a3202b60/href</a></iframe><h3>Bridging The Gap</h3><p>A native module is a bit of native code that is compiled into your app’s binary and then bridged with JS to allow interoperability with React Native.</p><p>In our case we had multiple such modules that needed to addressing. One such example is <a href="https://www.datacamp.com/community/tech/react-native-linear-gradient">react-native-linear-gradient</a>: a simple library that allows the user to render linear gradients, which is not provided by React Native core.</p><p>We had a couple of options to solve this problem:</p><ol><li>Branch the code so that it selectively used the native module, inline in the source code.</li><li>Creating a wrapper component that abstracted this branching away</li><li>Aliasing the native module so that no branching is required</li></ol><p>In our case we opted for option 3 as Webpack already provided a convenient way to alias modules (such as react-native itself), and this also requires less change to the application source code itself.</p><p>Setting up a <a href="https://webpack.js.org/configuration/resolve/#resolvealias">module alias in Webpack</a> is simple:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbfe5574413dff0c29742ef207f0dfa3/href">https://medium.com/media/dbfe5574413dff0c29742ef207f0dfa3/href</a></iframe><p>And our mocked module implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73b761bfe9530efe329e8e7af16feee2/href">https://medium.com/media/73b761bfe9530efe329e8e7af16feee2/href</a></iframe><p>We repeated this process for the remaining native modules in the project. Some of them required a genuine implementation as above, whereas for others it was sufficient just to stub out the bits of the API we used and effectively doing a no-op. This was useful for modules such as <a href="https://github.com/Microsoft/react-native-code-push">react-native-code-push</a> which we had no requirement to support for the web target:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a81fb41e1abcb35946a49d79287d19a/href">https://medium.com/media/8a81fb41e1abcb35946a49d79287d19a/href</a></iframe><p>With the proof-of-concept now up and running, we turned our attention to the task of turning it into a real production application. The main task at hand was optimizing the mobile screens to be better suited for display and interaction on the web.</p><p>The dream of React Native Web is that you can reuse your mobile application’s source code on the web. As soon as you start to rewrite logic and components, you start to reduce the amount of reuse and thus the benefit of using the same codebase is diminished. In order to maximize the amount of reuse we achieved we devised a couple of strategies to aid us in our journey.</p><h3>Strategies for Code Reuse</h3><p>Whilst the overall designs had been optimized for web, many of the components that appeared on the screen could be reused between web and mobile. In many cases, we required only very trivial changes to the component in order to adjust the style for web.</p><h4>Branching Within Components</h4><p>In such cases we opted for a very simple solution of basic conditional branching within our components. For instance, to conditionally apply a style we can simply check the current operating system using Platform.OS:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0a613356cf64de5ddb7511afcce63f9/href">https://medium.com/media/e0a613356cf64de5ddb7511afcce63f9/href</a></iframe><p>However, rather than using ternary statements we preferred the declarative approach of Platform.select:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc5cf9656fbb81b1e8a489e23bc58586/href">https://medium.com/media/cc5cf9656fbb81b1e8a489e23bc58586/href</a></iframe><p>A limitation that we found with Platform.select is that it is mainly intended for switching behaviors between iOS and Android. So, in cases where we want to branch on web and mobile but not discriminate between iOS and Android, we found ourselves having to repeat ourselves:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/012dbf95074b5b725e2b659825abb1ca/href">https://medium.com/media/012dbf95074b5b725e2b659825abb1ca/href</a></iframe><p>To solve this problem, we implemented our own variation of Platform.select, that we call selectOnPlatform. This allows us to discriminate between mobile and web but easily fallback to different Android and iOS behavior too if you wish.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/588b1824a8f17556222ac88aaf31cefb/href">https://medium.com/media/588b1824a8f17556222ac88aaf31cefb/href</a></iframe><p>The full implementation of selectOnPlatform <a href="https://gist.github.com/jdmunro/b7bfe10dac089eab50d9ca43949d7b35#file-selectonplatform-js">is available here</a>.</p><h4>Component Branching</h4><p>Sometimes a component would require many changes to work correctly on each platform, and so a different strategy was required.</p><p>Instead of adding many conditionals into a single component file, we opted to branch at the component level using platform-specific files. We came up with a simple heuristic to decide when to split into platform-specific components: if a component required more than 2–3 branches then it was typically a viable candidate for refactoring into platform-specific files.</p><p>Creating platform-specific components is simple: if you have a component called MyComponent.js, you can create a new version of it (ideally with the same public interface) called MyComponent.web.js. Then make sure you have the correct resolve configuration in your Webpack config:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12df0424923f33a6338c5c4352136b3a/href">https://medium.com/media/12df0424923f33a6338c5c4352136b3a/href</a></iframe><p>The web version of your application will now resolve to MyComponent.web.js and the mobile version will not even be included in the compiled web bundle.</p><p>This technique was invaluable for solving some of the hierarchical differences in the way components are composed between web and mobile: on both platforms the app features a FeedbackView which displays feedback to the user based on whether they answered the question correctly or not. On mobile this is a ‘floating view’ that appears over the top of the activity, whereas on web this appears in the bottom bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLwyJ-CxiEOuD6PEBlrg4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiqu1lP7YCdpYvZ8NZJWxQ.png" /><figcaption>The component hierarchy on web vs mobile — leveraging Component Branching</figcaption></figure><p>In both cases, the root component here is a LearningScreen. This component is the same for both web and mobile. However, several of the sub-components you see have platform-specific implementations: ExerciseTopBar, ExerciseBottomBar, ExerciseBody and FeedbackView. These have been branched due to major differences in layout between the web and mobile versions, but many of the components they use internally are still shared 1:1 across platforms.</p><p>This also allows us to solve the differences in view hierarchy: the web version of FeedbackView is rendered inside ExerciseBottomBar, whereas on the mobile version it’s rendered inside Activity.</p><h4>Connecting it all together</h4><p>Sometimes we found it beneficial to branch at the screen level, for situations where the differences between a screen layout were large, or multiple screens shared the same props and bound action creators. However, there is still opportunities for code reuse at this level: in our app we use Redux as our state container. Screens are connected to the redux store using react-redux and connect calls. Connect calls are curried and can be partially applied: we found this useful for sharing selector and bound action creators between screens that had a different layout but the same or very similar functionality.</p><p>Here’s an example where we partially apply the connect call:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcd0beb7921d0fc1b03bb8ab6891f9be/href">https://medium.com/media/bcd0beb7921d0fc1b03bb8ab6891f9be/href</a></iframe><p>Then we can just import this and use it as needed, binding to each component as necessary:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01007c61716fb5fc59ed3c751405502d/href">https://medium.com/media/01007c61716fb5fc59ed3c751405502d/href</a></iframe><h4>Go with the Flow</h4><p>Another technique we found useful when paired with the component branching above was to share flow-types between the components. Ideally, platform-specific components will still have the same public interface (exposed via its props) so that other components can consume them in a platform-agnostic way, without needing to know which implementation is being used.</p><p>Rather than duplicating the types between the components, we found it useful to import the types from the original mobile component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33bdfd54f893b137ca1e3a0e28eb92eb/href">https://medium.com/media/33bdfd54f893b137ca1e3a0e28eb92eb/href</a></iframe><p>This allows us to easily share the types between the different components without any duplication.</p><h3>Next Steps — Ready For Production?</h3><p>The combination of these techniques allowed us to do most of the work to port our mobile application to web:</p><ul><li>Native module aliasing</li><li>Conditional styling</li><li>Component branching</li><li>Reusing connect calls</li><li>Shared Flow types</li></ul><p>However, we still had some way to go before we could consider our app to be production-ready: during the port we encountered some functional differences between mobile and web and the output JS bundle size was enormous — far too big to ship to the browser.</p><p><em>Stay tuned for part 3 to see how we brought everything together into the final shipped version! Interested in working with DataCamp? </em><a href="https://www.datacamp.com/careers/"><em>Check out our careers page!</em></a></p><p><em>Originally published at </em><a href="https://www.datacamp.com/community/tech/porting-practice-to-web-part2"><em>www.datacamp.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c009daf2cbb4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/front-end-weekly/porting-practice-to-web-react-native-web-in-production-at-datacamp-c009daf2cbb4">Porting Practice to Web: react-native-web in Production at DataCamp</a> was originally published in <a href="https://medium.com/front-end-weekly">Frontend Weekly</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The things I wish I’d known as a junior developer]]></title>
            <link>https://medium.com/free-code-camp/5-things-i-wish-id-known-as-a-junior-developer-a0c49ce13d11?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0c49ce13d11</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Sat, 02 Feb 2019 17:27:14 GMT</pubDate>
            <atom:updated>2019-02-13T18:03:58.797Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7XjCVim6sV0ma5Ao.jpg" /></figure><p>As a junior developer, I was often fraught with insecurity and imposter syndrome with regards to my technical ability. I actually postponed the beginning of my career by at least a year due to these feelings.</p><p>Over the years these feelings have diminished somewhat, although not completely. Whilst not all of these points are related to confidence, if I had a time machine, I’d go back in time and tell myself these things. Ah, the power of hindsight!</p><h3>1. You Don’t Need To Know Everything</h3><p>Companies that are looking for junior developers are not looking for experts. If they were, the job advert would be for a mid or senior level developer. As I was starting out in my career, I managed to convince myself that I didn’t know enough or have enough experience.</p><p>In reality, it’s all about your attitude. A junior developer should be motivated, curious and capable of learning new things. As long as you have a reasonable thirst for knowledge, everything else will fall into place.</p><p>If a company expects more from a junior developer, they might not be worth working for in the first place.</p><h3>2. Interviewers Aren’t There To Catch You Out</h3><p>Due to my inexperience at the time, I always had it at the back of my mind that any interviews for developer jobs would go terribly for me. I would imagine these scenarios over and over in my head. It would often involve some kind of whiteboard test where I’d cave in under the pressure. I would forget everything I knew. The unfriendly interviewer would flip over the table and shout, with an air of superiority: “Aha! I knew you didn’t know how to reverse a string, fool!”.</p><p>In reality, most interviews are nothing like this. The interviewers are not there to catch you out, or to prove you wrong. They’re simply there to find the best candidate for the position they’re recruiting for. Any company that has the unfriendly above attitude toward interviewing is almost certainly not worth working for in the first place.</p><h3>3. Don’t Be Afraid To Make Mistakes</h3><p>As I started my career, I somehow convinced myself that I must not make any mistakes, and would be hard on myself if I did. I fully expected the company I was working for to punish me and banish me to a life of unemployment.</p><p>As a junior developer, you will make many mistakes. You <em>should</em> make mistakes — as long as you learn from them — and they are not always due to carelessness. It’s human to make mistakes. Senior developers make mistakes all the time. Although they are much more likely to anticipate and diagnose problems due to their experience.</p><p>If you find yourself working for a company that has unrealistic expectations about making mistakes — or has a blame culture — consider whether this is the best place for you to be working.</p><h3>4. Embrace Change</h3><p>Early in my career, I became a diehard native iOS developer. I would preach the benefits of native development over web technologies, iOS over Android, Objective-C over Java. I felt threatened by a suggestion that there was any other way to develop apps.</p><p>How things change! These days, whilst still primarily an app developer, the face of the technological landscape has changed substantially. I no longer preach Objective-C over Java, or iOS over Android. In fact, I’m no longer a diehard native advocate either. My preferred stack for the last few years is Javascript based (React/React Native) simply because it is the best tool for the kind of problems I’m working on.</p><p>I embrace that this will one day change. I’m comfortable with the fact that I can and will need to learn new technologies to best solve the problems at hand.</p><h3>5. Figure Out What Inspires You</h3><p>As I started my career, I didn’t really have much of an idea of the kinds of things that inspired and motivated me. Your first few industry jobs will likely be a journey of discovery that will help you calibrate your motivational compass.</p><p>Some people enjoy focussing on technical problems. Others like to focus on building software that adds value to people’s lives (where technical problems are just things that need to be solved). Somebody else might just enjoy learning new things or managing a team. Indeed, it’s quite possible to enjoy all of these things!</p><p>Whatever the case is for you, it’s completely okay not to know this at the start of your career as a junior developer. These things will likely change for you over time anyway. Don’t be afraid to try new jobs, work on new projects within a company or with new teams to discover what inspires you.</p><h3>Summary</h3><p>These are a few things I wish I could have told myself at the tentative beginning of my career. Of course, the journey of the junior developer never actually ends. Rather, it’s the very start of a lifelong journey as a developer. Stay curious, embrace change, figure out what inspires and motivates you and have fun!</p><p><em>Originally published at </em><a href="https://jdmunro.net/posts/5-things-i-wish-id-known-as-a-junior-developer/"><em>jdmunro.net</em></a><em> on February 2, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0c49ce13d11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/5-things-i-wish-id-known-as-a-junior-developer-a0c49ce13d11">The things I wish I’d known as a junior developer</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[90% Code Reuse In Production with React Native For Web — How DataCamp Ported Their Mobile App to…]]></title>
            <link>https://medium.com/front-end-weekly/90-code-reuse-in-production-with-react-native-for-web-how-datacamp-ported-their-mobile-app-to-593e712e07a3?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/593e712e07a3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[datacamp]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 17:48:33 GMT</pubDate>
            <atom:updated>2019-02-14T17:07:56.496Z</atom:updated>
            <content:encoded><![CDATA[<h3>90% Code Reuse In Production with React Native For Web — How DataCamp Ported Their Mobile App to The Browser</h3><p><em>This article is part of a short series in which DataCamp’s Practice &amp; Mobile Team describe the process of porting a mobile application to the web. This first part covers the initial goals and motivation for the project. Stay tuned for parts 2 and 3 which go more in-depth on the technical aspects of the project.</em></p><p>Keen DataCampers may have noticed that we recently launched a new version of DataCamp Practice for Web. Beyond the slick new visual theme, many of the changes were technical improvements behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XaR3ujCi8boe0a0v.png" /><figcaption>New practice mode 🚀</figcaption></figure><p>The technical improvements are designed to help us iterate and innovate more quickly and ultimately deliver more value to users. The most exciting part is that it’s actually a near-direct port of the practice mode that features in our own mobile app: DataCamp’s practice mode now shares the same codebase for both mobile and web!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Ff%2F788447%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2F788447%2F&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/18214d8333adbb5668f31791a3202b60/href">https://medium.com/media/18214d8333adbb5668f31791a3202b60/href</a></iframe><h3>Are you mad?</h3><p>Whilst DataCamp already had a practice mode for web, it was in ‘maintenance mode’ (receiving bug fixes and patches) but no new features.. Meanwhile, we developed and launched a new version of practice for <a href="https://www.datacamp.com/mobile">DataCamp for Mobile</a>, which focuses on learning on-the-go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VZtTnbgs01t6L_mR.png" /><figcaption>The legacy practice mode</figcaption></figure><p>Practice is a core part (literally in the middle!) of DataCamp’s Learn -&gt; Practice -&gt; Apply approach to teaching data science. Recently, it became a strategic goal of the Mobile Team (now Practice &amp; Mobile Team) to take ownership of Practice in general at DataCamp in order to drive innovation and bring further value to our users.</p><p>Now with 2 separate application to maintain, the question soon arose of how our team could easily add new features to both web and mobile without duplicating our efforts (and bugs!) across 2 distinct codebases.</p><p>With limited engineering capacity in our team (just 2 engineers), it soon became clear that maintaining a single codebase was the best solution to our problem and we soon set about dreaming up a strategy to turn this idea into a reality.</p><h3>Bringing a mobile app to the browser</h3><p>At DataCamp we are heavily invested in the JavaScript ecosystem: many of our applications are written in JS for both the frontend and backend.</p><p>Our mobile app is no exception, we rely on many modern JS tools and technologies to build it. The backend is a NodeJS application which exposes an API via GraphQL and the frontend is the app itself which is written in React Native. Needless to say DataCamp are big React fans!</p><p>The legacy practice for web application was also written in JS, complete with its own backend. This posed a problem: our ideal solution would not involve maintaining 2 separate backends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N9DZPrTsvw8J0xpt.png" /><figcaption>A fragmented app architecture</figcaption></figure><p>Our recently developed mobile backend is capable of serving up practice content, but this would involve re-writing the legacy app’s frontend to use the existing backend. This would leave us with 1 backend but 2 distinct frontends. Better, but not ideal! There are also significant differences in how each app interacts with its backend which would have presented some difficult technical challenges: the legacy app is ‘online first’ whereas the mobile app is ‘offline first’ and is designed to interact with its content offline.</p><p>Instead of maintaining 2 frontends, wouldn’t it be ideal if we could reuse our mobile frontend on the web in conjunction with our existing mobile backend? This would allow us to take advantage of all the existing code we have and also re-use the backend that was currently serving the mobile app. A large obstacle that stood in our way: how can we get the frontend code running in a browser?</p><p>We previously mentioned that our mobile app is written in React Native. This is a powerful technology that allows developers to write native mobile apps using JS. Due to being JS and React-based, the amount of resistance in reusing the code in a browser environment is lower than it might seem at first.</p><p>Fortunately, there are JS community efforts to bring React Native apps to the browser. One of the front-runners is <a href="https://github.com/necolas/react-native-web">react-native-web</a>: a port of React Native that allows you to target the DOM instead of mobile devices using the same code. In theory, this would allow us to reuse our existing codebase with minimal modification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k-4706hvpwAESehW.png" /><figcaption>A unified app architecture</figcaption></figure><p>We set about working on a proof-of-concept and fell into a pit of success. We were able to get a super rough version of the mobile app in a browser running very quickly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JjnF5FyyBLB13jOd.png" /><figcaption>Early proof of concept — what can we improve 🤔</figcaption></figure><p>Whilst it was possible to get a proof-of-concept running quickly, the gulf between a scrappy proof-of-concept and a full-blown production app is quite large! Beyond the user interface, we had to reconsider several functional design aspects and also rework some of the underlying technical systems in order to optimise the user experience. The process of perfecting our port took a couple of months with 2 engineers and we learned a huge amount during this journey.</p><p>A separate article will explain some of the ins-and-outs of using react-native-web in production.</p><h3>Reflection and the future</h3><p>Overall, we consider our port of mobile practice to web to have been a complete success. Our early user feedback and analytics demonstrate that it is performing at least as well as the previous web version which was our initial goal. From here on, we can now rapidly innovate on our codebase and bring innovation to web and mobile simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*up7Et4VQh4nvItSv.png" /><figcaption>Practice completed! 🎉</figcaption></figure><p>We estimate that we were able to reuse 90% of our mobile components on the web and a similar amount of the business logic through our action creators, reducers and networking layer. In fact, the level of reuse was so high that early versions of the port had entire features of the mobile app accessible by the user, such as the dashboard and mobile Learn experience that we had no intention of bringing to the web.</p><p>The benefits of having a shared codebase go beyond basic code reuse. Part of the porting process involved adapting the user interface of practice to make better use of the horizontal screen space provided by modern widescreen desktops. This is quite a different aspect ratio to mobile phone screens which are optimised for vertical content and scrolling. However, tablets such as the iPad are much less focused on vertical content and so we also have the option in future of deciding which interface to use based on a device’s screen dimensions, rather than just on platform alone.</p><p>We look forward to bringing out new features and improvements for DataCamp practice for both mobile and web over the next weeks and months!</p><p><a href="https://medium.com/@jdmunro/porting-practice-to-web-react-native-web-in-production-f57c0ffb77a2">Checkout part 2 here!</a></p><p><em>Stay tuned 3 which go more in-depth on the technical aspects of the project. Interested in working with DataCamp? </em><a href="https://www.datacamp.com/careers/"><em>Check out our careers page!</em></a></p><p><em>Originally published at </em><a href="https://www.datacamp.com/community/tech/porting-practice-to-web-part1"><em>www.datacamp.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=593e712e07a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/front-end-weekly/90-code-reuse-in-production-with-react-native-for-web-how-datacamp-ported-their-mobile-app-to-593e712e07a3">90% Code Reuse In Production with React Native For Web — How DataCamp Ported Their Mobile App to…</a> was originally published in <a href="https://medium.com/front-end-weekly">Frontend Weekly</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Move Quickly With Your App By Adopting Feature Flags]]></title>
            <link>https://medium.com/@jdmunro/working-with-feature-flags-6646ee944bc0?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6646ee944bc0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[feature-flags]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Thu, 02 Feb 2017 20:59:06 GMT</pubDate>
            <atom:updated>2017-02-03T07:56:21.820Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve recently been involved with a mobile app project that required frequent public releases from a master branch that contained a mixture of complete, stable features and other features that are still under heavy development. The latter features are in no shape to be shipped to the public — so how do you keep these out of the public release but readily accessible for development?</p><p>One potential solution, and one that my younger naive self might have attempted, would be to maintain a feature branch for each feature that was in active development, with a view to keeping these branches un-merged until the entire feature is complete and ready to use. This is a viable solution and works for some teams, but is not without some problems.</p><h4>A Fork In The Road</h4><p>Branches become stale the longer they are open, and if there is a lot of commit activity on the master branch it becomes quite a burden to stay in sync with with the upstream changes. It also means that the resultant pull/merge request will be huge because a feature will have been developed in its entirety before attempting to merge back into the master branch.</p><p>You can and should use branches — but focus on continuously integrating with your master branch. This lends itself to much smaller merge/pull requests which can result in higher quality code reviews and less overhead of staying in sync with concurrent branches. How do we go about introducing incremental changes to a codebase without exposing partially complete functionality?</p><h4>Flagged For Completion 🏳️</h4><p>Feature flags are a simple solution to a complex problem. By offering up some basic boolean flags, you can hide partially complete features from the public eye, yet leave them readily accessible to other developers whilst leaving your master branch in a continuously deployable state.</p><p>In the project I recently worked on our feature flags took a very simple form in a centrally located file (examples given are ES6 but you can adapt this to any language):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93616eb72ad0a97c2e84fd090e205665/href">https://medium.com/media/93616eb72ad0a97c2e84fd090e205665/href</a></iframe><p>This file is then imported into the relevant places and used to show or hide functionality. In our case this was as simple as hiding menu items if the feature wasn’t currently complete:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91fe1d8e0f8428efc16efebfddd99943/href">https://medium.com/media/91fe1d8e0f8428efc16efebfddd99943/href</a></iframe><p>Granted, features aren’t always quite as clear-cut as this and will sometimes require checking the flags in various places.</p><p>This is a particularly basic example with hard-coded feature flags, but there’s plenty of scope for taking this further. For instance, in addition to hiding in-development features, you could:</p><ul><li>Read the feature flags from an external data source such as an API</li><li>Enable/disable features for certain users of your app</li><li>Use feature flags to A/B test complete features against subsets of users</li><li>Gradually roll out potentially risky features</li></ul><p>In my particular case, we’re taking advantage of feature flags to allow us to continuously integrate incomplete features into the master branch of an app that is frequently released to the public, however, I’m excited to explore the additional opportunities that feature flags offer.</p><p>However you decide to implement feature flags, I’d recommend starting with something simple and only build in the complexity as-and-when you need it — no doubt there are fully featured libraries for managing more complex scenarios.</p><p>Have you used feature flags in any of your projects?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6646ee944bc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Mostly Sensible Account of Testing a React Native App]]></title>
            <link>https://medium.com/@jdmunro/a-mostly-sensible-account-of-testing-a-react-native-app-aea8e9a6cae4?source=rss-5f685d02dd8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/aea8e9a6cae4</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[James Munro]]></dc:creator>
            <pubDate>Mon, 30 Jan 2017 21:02:51 GMT</pubDate>
            <atom:updated>2017-02-02T19:18:15.238Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently shipped an app written in React Native which took advantage of automated testing. In this article I’d like to explore the approach I took in the hope that it might be useful for your own app projects. It’s worth mentioning from the start that there are many different approaches and there’s no one-size-fits-all solution. Although I don’t claim to have any ground-breaking new strategies, I’d like to share my recent experiences.</p><h4>It Started With a Bug</h4><p>I began my journey into automated testing strategy after learning about its importance the <em>hard way</em>. Back in 2011 I was working for a mobile game developer on our own in-house products. At this stage in my career, I was interested in the idea of automated testing, however I’d never really successfully applied it to a real-world project. During some routine, well-intended refactoring work, I inadvertently introduced a bug into a game which essentially broke the core gameplay mechanic and unfortunately this was not picked up during our manual quality assurance process. From this day forward my approach to developing apps pivoted and I’ve never looked back.</p><h4>Finding a Balance</h4><p>I no longer work in the games industry, and in some ways this made it easier for me to embrace a quality-first mentality towards software development due to the mostly less ‘fuzzy’ nature of the kinds of business logic we implement.</p><p>For a while, I took things too far with a relentless test everything ’til you drop approach. One of the biggest lessons I’ve learned so far in my career is that there isn’t a one-size-fits-all solution for <em>anything</em> in software development. I’ve worked on projects that were rigorously tested and developed from scratch with extensibility and maintainability in mind, only for the project to receive a smattering of incremental updates over the period of a few years.</p><p>On the other side of the coin, I’ve also been involved with projects that were only ever intended as a proof-of-concept and so had little investment in terms of longevity and maintainability — very little in terms of automated testing — only for these projects to be scaled up at short notice into fully-fledged products. Speaking from experience, it is very difficult to retroactively introduce automated testing to a project that wasn’t designed with testability in mind.</p><p>This begs the question of how do you know how rigorous to be with your testing strategy? There are many factors involved, ranging from the life expectancy of the project to the budget and resources available to develop it. The simple answer is that there’s no right or wrong answer to this, however, there are sensible strategies that we can adopt and scale up or down as necessary.</p><h4>The Challenge</h4><p>For fun and to keep my skills sharp I developed a cross-platform app, <a href="https://play.google.com/store/apps/details?id=com.happyaccident.mealplan">Meal Shuffle</a>, in my spare time using React Native. During this project I’ve often struggled with determining the right level of automated testing to apply, but I’ve found a happy balance that worked for me.</p><p>I’m a big fan of TDD (test-driven development), and in a world that is embracing functional programming and purity, it is easier than ever to apply this approach to development. However, I think it’s very important to validate your ideas before you embark down this path. TDD generally works best when you already know what you’re developing, and in the early stages of a new project, we don’t always have the answers.</p><p>Before I jumped into developing any real business logic I did my best to validate my ideas by creating some prototypes. React Native provides a fantastic developer experience for this and its extremely quick and convenient to throw a barebones app together in a short space of time.</p><p>The app I wanted to develop is just a simple tool designed to help busy people with their meal planning. There are plenty of other apps out there that do this kind of thing but none of them worked in the way I wanted. I prototyped out some of the main screens of the app in order to begin collecting feedback and validating my assumptions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*oPjpMKJ92qkiLeQBqaYykA.png" /><figcaption>An early prototype. Clearly not going to win any design awards!</figcaption></figure><p>I spent some time collecting feedback from friends and family on the actual functionality of the app and then <em>threw all of the code away</em>.</p><p>There were various bits and pieces of functionality that I could have spent ages writing tests for, but the only code that matters is code that ships, and lots of ideas I’d had simply weren’t as useful to the end-user as I’d initially expected.</p><p>Prototype code is not production code and shouldn’t be bullied into being it.</p><p>With my ideas validated I was ready to begin the proper development of the app.</p><h4>Starting Over</h4><p>Now that I understood <em>what</em> I wanted to build it was easier for me to start building out the logic using a TDD approach: writing the tests first, followed by the code to pass the tests.</p><p>Adopting this approach is something I’m still very happy about. I mentioned earlier that this app is just a side-project around my full-time job and as a result, sometimes weeks can go by when I don’t spend any time on the project. Having the tests as documentation makes it much easier for me to dip in and out of the project. I guarantee that as time passes you forget not only <em>how</em> things work, but also <em>what</em> the code is supposed to do in the first place.</p><p>Being able to pull up the test file and understand what a past version of myself intended is one of the many benefits of having a good suite of tests around your project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9681ed20ddd868585be4c10a717cf21a/href">https://medium.com/media/9681ed20ddd868585be4c10a717cf21a/href</a></iframe><p>Choosing the right level of depth for your tests is another fuzzy thing that is hard to create a rule for. I would certainly recommend it for the vast majority of the business logic of your app. The real key is to have enough tests in place that you can move fast with the development of new features.</p><p>A test-first approach to writing the business logic of my app was good enough to get me to a 1.0 release. I could have gone a step further and layered in additional levels of automated testing, such as automated UI tests. These can be great because they allow you to perform end-to-end tests of features through UI interactions. However, although my idea had been validated against friends and family it was not yet in the hands of any real-world users.</p><p>Automated UI tests have their advantages, however, they can also be quite time-consuming to put together and can be flaky, and I was not yet ready to invest in them for my app.</p><h4>Snapshot Testing</h4><p>Over the last year we’ve seen a great increase in the ease at which we can write test for our React Native applications. Amazing tools like <a href="https://facebook.github.io/jest/">Jest</a> have seen significant investments in development by companies such as Facebook and this brought new testing techniques to the forefront.</p><p>One such example of this is snapshot testing. A great use of snapshot testing enables us to capture the state of a UI component written in React or React Native and serialize this to a file. This captured snapshot test now essentially serves as a regression test which will flag up any changes that occur to output and allows you to inspect whether or not this was an intentional change.</p><p>With the first version on my app on the store and my ideas now validated in the hands of real end-users I decided to explore the potential of snapshot testing to protect myself from regressions to my app’s UI. This has proven to be particularly fruitful in a React Native application: although relatively stable the framework itself is under constant development and has a version of less than 1.0. Breaking changes are becoming less frequent but recently there have been a few updates to the Flexbox handling which have caused my UI to appear differently at runtime depending on the version used.</p><p>One of the great things about snapshot testing is that we can exploit the tree-based nature of React-based UIs: you can go crazy by creating snapshots for each individual component of your app, or you can exploit the tree-based nature and target a root component such as a screen. Capturing the a snapshot of the root of a tree will also capture all of the leaf components, essentially allowing you to capture a top-down representation of the entire UI depending on the granularity to select.</p><p>In my app I decided to capture snapshots of the main screens of the app to help protect against regressions:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bec49c61ab5924ac70808199e1cbde8b/href">https://medium.com/media/bec49c61ab5924ac70808199e1cbde8b/href</a></iframe><p>This has been super useful in catching unintentional changes and regressions during continued development:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaxmgZLpSBu_lHwQVidI1Q.png" /><figcaption>Unintentional changes — caught by a snapshot test</figcaption></figure><p>With snapshot tests being so simple to write and by exploiting the tree-based nature of React-based UIs, you can get some really quick-wins. I highly encourage giving this a go in your app, even if you decide not to use TDD for your business logic.</p><h4>Moving Forwards</h4><p>Overall I’m very happy with the degree at which I decided to bolster my app project with automated tests. Over a couple of months, I’ve ended up shipping multiple updates and having a suite of automated tests has saved me from shipping bugs on several occasions due to refactoring gone wrong. Not only that, due to the side-project status and limited time I get to spend on the app, having a detailed documentation of <em>how</em>, <em>what</em> and <em>why</em> everything works has allowed me to dip in and out of the project as time permits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*ZJ9QoBJ3F_zBzKe_C1CQsg.png" /><figcaption>Meal Shuffle 1.0, supported with automated testing</figcaption></figure><p>The recent introduction of snapshot testing to Jest have allowed me to further protect myself from regressions, often caused by my own stupidity, at the UI level. This has proven to be particularly helpful whilst attempting to build apps on React Native, which is still under constant development.</p><p>Choosing the right level of testing for your project is not an easy question to answer. It’s not easy to do TDD when you don’t already know what you’re trying to build. However, throwaway prototypes can be a cheap way for you to validate your ideas before building a more robust version of your application.</p><p>In 2017, there’s such a great level of tool support for automated testing that there are lots of quick wins to be had, even if you don’t have a huge amount of development resource to invest. TDD isn’t for everyone and isn’t always the best solution. Automated UI tests can be great for end-to-end testing but can require a lot of proactive maintenance which can be especially difficult on a project that is constantly evolving. Snapshot tests strike a balance between the 2: they can be setup in just a few lines of code and can protect the UI from regressions, however they don’t help a great deal in doing the same for your business logic.</p><p>What kind of testing strategies have you applied in your app projects?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aea8e9a6cae4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>