<?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 Chen Roth on Medium]]></title>
        <description><![CDATA[Stories by Chen Roth on Medium]]></description>
        <link>https://medium.com/@chenroth?source=rss-204b3b840fed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qRUUFR_r6fvKSJOJ.jpg</url>
            <title>Stories by Chen Roth on Medium</title>
            <link>https://medium.com/@chenroth?source=rss-204b3b840fed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:03:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chenroth/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[The short sighted scope of /utils]]></title>
            <link>https://medium.com/torii-makers/the-short-sighted-scope-of-utils-f6ef4e55faad?source=rss-204b3b840fed------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6ef4e55faad</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Chen Roth]]></dc:creator>
            <pubDate>Sat, 24 Jun 2017 14:57:19 GMT</pubDate>
            <atom:updated>2017-06-24T16:30:24.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*b5xgmzCWE-saBLPr7cQ6_A.jpeg" /></figure><p>We’ve all been there. You work on a product, and there’s this bit of business logic which seems to be generic enough, say a function plural(x, noun), which takes a number x and a noun noun and returns the corresponding singular/plural form of that noun in quantity x</p><p>Now, this function would usually be conceived within the business logic that first required it, but evidently one would be inclined to infer:</p><p>“Hmm… this seems generic enough to serve as a <strong><em>utility</em></strong>. Let’s move it to /utils!”</p><p>Soon enough, you might find yourself with a cumbersome utils file, which holds together all these <em>utility functions</em>, which possibly have no common context.</p><p>Now, the diligent programmer might have split the utils file by logic domains, such as Math, string manipulation and database functions. However, this kind of split provides a false sense of modularity— the decoupling here is only that of file hierarchy, not necessarily that of code ownership. What do I mean? say you now have another project, which requires some of these utilities. In my experience, under real world terms of deadlines, workload or sheer laziness, one would likely just copy /utils over to the other project, thus committing the cardinal sin of non-<a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself"><strong>DRY</strong></a><strong> </strong>code!</p><p>In order to achieve true modularity, you would do well to divide and conquer this mess of utilities by extracting them to independent code modules, namely NPM packages for JavaScript or any type of packaging your language ecosystem offers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6ef4e55faad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/torii-makers/the-short-sighted-scope-of-utils-f6ef4e55faad">The short sighted scope of /utils</a> was originally published in <a href="https://medium.com/torii-makers">Torii Makers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>