<?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 Sergio Cinos on Medium]]></title>
        <description><![CDATA[Stories by Sergio Cinos on Medium]]></description>
        <link>https://medium.com/@scinos?source=rss-f1f0258b21e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SbeLi8gNHp8noLqI.</url>
            <title>Stories by Sergio Cinos on Medium</title>
            <link>https://medium.com/@scinos?source=rss-f1f0258b21e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 02:35:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@scinos/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[Do we have to fix this problem now?]]></title>
            <link>https://medium.com/@scinos/do-we-have-to-fix-this-problem-now-b2ac049689ee?source=rss-f1f0258b21e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2ac049689ee</guid>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sergio Cinos]]></dc:creator>
            <pubDate>Sun, 19 Aug 2018 21:09:58 GMT</pubDate>
            <atom:updated>2023-01-24T10:03:21.338Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>UPDATE: </strong>an<strong> </strong><a href="https://scinos.dev/posts/2018-08-19-do-we-have-to-fix-this-problem-now/">updated version of this post</a> exists in my blog, <a href="https://scinos.dev/">https://scinos.dev/</a>. Please, check it out for more content like this post.</p><p>Something I’ve learned in my career is that is much more valuable to pick the wrong solution for the right problem, than the right solution for the wrong problem.</p><p>It is very tempting to start thinking about solutions when presented with a problem. But it is more valuable to think about the problem first, without wondering about potential solutions.</p><p>In particular, thinking about the problem helps with prioritisation, which in a world with a finite set of resources (read, engineers and time), it is critical to achieve success.</p><p>This is a sentence that I use to think about the problem: <strong>do we have to fix this problem now?</strong></p><p>Each word there focus on a different aspect of the problem. Let me expand on that:</p><p><strong>“this problem”</strong></p><p>Is very important that we fix the right problem. What we see, is it the root problem or a symptom of an underlying problem? Is this thing caused by a different, deeper problem?</p><p>Is it even a problem? Maybe it is a conscious trade-off we made.</p><p>“<strong>fix</strong>”</p><p>Not all problems require a fix. Some problems will fix themselves if you leave them. For example, fixing some minor functionality in IE11 could be a waste of resources if we are going to drop support for IE11 soon.</p><p>Even if it won’t fix by itself, we still might choose to not fix it. Some fix are very complicated, and no fix is totally risk-free. Maybe the fix requires a huge investment and the economics of the situation just doesn’t make sense.</p><p>“<strong>we</strong>”</p><p>Even if we find the right problem, and we decide it should be fixed, it doesn’t mean we (as in, ourselves our immediate team) have to do it. There could be someone else more qualified to do it.</p><p>A few years ago, I was assigned a relatively small issue to fix in our product’s backend. At the same time, a fellow backend developer got assigned a frontend issue. This was for downloadable software, so we had strict deadlines: if you fix doesn’t land master by this date, it will have to wait until the next public version that could be months down the line. We both spent 3 days just trying to set up the environment to do our fixes, with no success. The 4th day we decided that the situation was too stupid and we interchanged the issues. Both were fixed that same day.</p><p>Yes, we everybody want to grow and learn new things, and we want to support them. But the reality is that some bugs are very critical (or very urgent) and they need a domain expert. If we are not that expert, we should focus our efforts on finding and helping that expert instead.</p><p>“<strong>now</strong>”</p><p>Ok, so we found the root problem, we decided it has to be fixed and we are the right people to do it. It doesn’t mean we have to do it now. For everything we decide to do now, there is something else we decide to postpone (aka opportunity cost).</p><p>If the problem is critical enough, we might choose to take some technical debt in the form of a quick workaround to contain the problem so it doesn’t get worse, but don’t invest on a full solution right now.</p><p>So the next time you find something broken, something you’d like to fix, or prioritising your backlog, ask yourself: “Do we have to fix this problem now?”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2ac049689ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[De-duplicating yarn.lock]]></title>
            <link>https://medium.com/@scinos/de-duplicating-yarn-lock-ae30be4aa41a?source=rss-f1f0258b21e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae30be4aa41a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[package]]></category>
            <dc:creator><![CDATA[Sergio Cinos]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 21:27:12 GMT</pubDate>
            <atom:updated>2023-01-24T10:02:00.732Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>UPDATE: </strong>an<strong> </strong><a href="https://scinos.dev/posts/2017-07-25-deduplicate-yarn-lock/">updated version of this post</a> exists in my blog, <a href="https://scinos.dev/">https://scinos.dev/</a>. Please, check it out for more content like this post.</p><p>I have been using <a href="https://yarnpkg.com/lang/en/">yarn</a> since version 0.18. I’ve used it in experiments and toy projects, but also in very big projects with thousands of dependencies. It is a very nice tool with lots of great features. But not everything is peaches and cream.</p><p>As you probably know, merges in yarn.lock are not always very clean, and you have to either solve the errors by hand, or re-apply the set of package updates that both branches did. And if you choose to solve it by hand, you’ll start to notice some package duplication here and there. For example, from React’s yarn.lock:</p><pre>debug@^2.1.1, debug@^2.2.0:<br>  version &quot;2.6.6&quot;<br>  resolved &quot;<a href="https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a">https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a</a>&quot;<br>  dependencies:<br>    ms &quot;0.7.3&quot;</pre><pre>debug@^2.6.3:<br>  version &quot;2.6.8&quot;<br>  resolved &quot;<a href="https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc">https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc</a>&quot;<br>  dependencies:<br>    ms &quot;2.0.0&quot;</pre><p>yarn.lock lists all dependencies in the project (both direct and transitive). For each dependency, it includes the version requested in package.json, the actual installed version of the package, and the dependencies of such package.</p><p>For example, in the above code, we have that some package of our project depends on debug ^2.6.3, but yarn installed debug 2.6.8. This is fine, because 2.6.8 can satisfy the requirement of ^2.6.3 and it is more modern.</p><p>In the next block we see that some package depends on debug ^2.1.1, and some other package depends on debug ^2.2.0. But in this case yarn installed debug 2.6.6, even when debug 2.6.8 (which is already installed!) could satisfy the dependencies as well. What we have here is package duplication: our project uses two different versions of debug when in fact we only need one to satisfy all requirements.</p><p>This is not only duplicated information in yarn.lock. You can actually see both packages in node_modules/:</p><pre>$ cat node_modules/debug/package.json | grep version<br>  &quot;version&quot;: &quot;2.6.6&quot;,</pre><pre>$ cat node_modules/istanbul-lib-source-maps/node_modules/debug/package.json | grep version<br>  &quot;version&quot;: &quot;2.6.8&quot;,</pre><p>Package duplication has a few bad consequences. Your dependencies will take longer to install and, probably more important, if you are bundling your duplicated dependencies and serving them to a browser your bundle will be bigger than it should be.</p><p>I wrote a tool to help you identify and resolve those dependencies. It is called <a href="https://www.npmjs.com/package/yarn-tools">yarn-tools</a>. Right now it has two sub-commands: list-dependencies and fix-dependencies. Both should be self-explanatory but if you want to read more, check the <a href="https://bitbucket.org/atlassian/yarn-tools#readme">README</a>.</p><p>For completeness, these are all duplicated dependencies in React at the time of writing:</p><pre>Package &quot;ansi-styles&quot; wants ^3.0.0 and could get 3.1.0, but got 3.0.0<br>Package &quot;babylon&quot; wants ^6.11.0 and could get 6.17.4, but got 6.15.0<br>Package &quot;babylon&quot; wants ^6.13.0 and could get 6.17.4, but got 6.17.0<br>Package &quot;babylon&quot; wants ^6.15.0 and could get 6.17.4, but got 6.17.0<br>Package &quot;babylon&quot; wants ^6.17.0 and could get 6.17.4, but got 6.17.0<br>Package &quot;chalk&quot; wants * and could get 2.0.1, but got 1.1.3<br>Package &quot;debug&quot; wants ^2.1.1 and could get 2.6.8, but got 2.6.6<br>Package &quot;debug&quot; wants ^2.2.0 and could get 2.6.8, but got 2.6.6<br>Package &quot;fsevents&quot; wants ^1.0.0 and could get 1.1.2, but got 1.1.1<br>Package &quot;istanbul-lib-coverage&quot; wants ^1.0.2 and could get 1.1.1, but got 1.0.2<br>Package &quot;istanbul-lib-instrument&quot; wants ^1.6.2 and could get 1.7.4, but got 1.7.0<br>Package &quot;js-yaml&quot; wants ^3.5.1 and could get 3.8.3, but got 3.6.1<br>Package &quot;node-pre-gyp&quot; wants ^0.6.29 and could get 0.6.36, but got 0.6.34<br>Package &quot;node-pre-gyp&quot; wants ~0.6.32 and could get 0.6.36, but got 0.6.34<br>Package &quot;request&quot; wants 2 and could get 2.81.0, but got 2.79.0</pre><p>By no means this is applies only to React. I scanned yarn.lock files from the most starred packages in GitHub and others are affected too, like <a href="https://github.com/angular/angular.js/blob/master/yarn.lock">Angular.js</a>, <a href="https://github.com/facebook/immutable-js/">Immutable.js</a>, <a href="https://github.com/zurb/foundation-sites">Foundation for Sites</a> or, funny enough, even <a href="https://github.com/yarnpkg/yarn/blob/master/yarn.lock">yarn</a> itself!</p><p>So if you are using yarn.lock in your project, chances are you are affected too. Please share your feedback if you use <a href="https://www.npmjs.com/package/yarn-tools">yarn-tools</a>.</p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae30be4aa41a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>