<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aabid Gatenby</title>
    <description>The latest articles on DEV Community by Aabid Gatenby (@aabidgatenby).</description>
    <link>https://dev.to/aabidgatenby</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4258621%2Fa8053e32-6b6a-4394-97a1-db191c8cf369.jpg</url>
      <title>DEV Community: Aabid Gatenby</title>
      <link>https://dev.to/aabidgatenby</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aabidgatenby"/>
    <language>en</language>
    <item>
      <title>A small text comparison that keeps a business feature honest</title>
      <dc:creator>Aabid Gatenby</dc:creator>
      <pubDate>Sun, 22 Nov 2026 11:09:58 +0000</pubDate>
      <link>https://dev.to/aabidgatenby/a-small-text-comparison-that-keeps-a-business-feature-honest-5617</link>
      <guid>https://dev.to/aabidgatenby/a-small-text-comparison-that-keeps-a-business-feature-honest-5617</guid>
      <description>&lt;p&gt;When an interview subject sends a corrected document, I want to know what changed before I rewrite the story around it. Did they fix a spelling mistake? Replace an estimate with an actual result? Move the reporting period? Those changes deserve different responses, even when they arrive in the same attachment.&lt;/p&gt;

&lt;p&gt;I work on business features and newsletters, and this is one place where a small programming tool earns its space on my desk. It helps me compare two plain text files. It does not decide which version is correct. That part still belongs to the reporting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4frxtwbi91u24gxuk9z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4frxtwbi91u24gxuk9z.jpg" alt="A writing desk with a laptop showing a text comparison" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with two clear snapshots
&lt;/h2&gt;

&lt;p&gt;My first step is ordinary housekeeping. I save the earlier text as before.txt and the updated text as after.txt. I keep the original documents separately. Copying a table into a text file can change its spacing, and I need a way to return to the source if a number looks strange.&lt;/p&gt;

&lt;p&gt;Each snapshot should cover the same material. Comparing an entire report with one paragraph from a later email creates noise. If I am checking a revenue explanation, I extract that explanation from both versions and label the files with the date I received them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let the computer show the difference
&lt;/h2&gt;

&lt;p&gt;Python includes a comparison module called difflib. I can use it without installing a separate package. A short script reads both files, compares their lines, and prints a unified diff. Lines beginning with a minus sign come from the earlier version; a plus sign marks the replacement. Nearby unchanged lines provide context.&lt;/p&gt;

&lt;p&gt;Here is the compact version I use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;difflib&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;unified_diff&lt;/span&gt;

&lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"before.txt"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splitlines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"after.txt"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splitlines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;unified_diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fromfile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"before"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tofile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"after"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lineterm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I keep this comparison local when the files contain unpublished interview material. I also check my permissions before sharing the output. A convenient file format does not change the promises I made to a source.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiamz98h04t1nazm9y1af.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiamz98h04t1nazm9y1af.jpg" alt="Hands checking printed documents beside reporting notes" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the changes as questions
&lt;/h2&gt;

&lt;p&gt;Suppose a sentence changes from “sales rose during the quarter” to “orders rose during the quarter.” The software will flag the words. It cannot explain whether the business changed its measurement, corrected an error, or supplied a clearer description. My next step is to ask.&lt;/p&gt;

&lt;p&gt;I record the answer beside the change, with the date and the name of the person who explained it. If a figure moves, I check the units and reporting period too. A difference in wording can be more consequential than a difference in punctuation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the tool small
&lt;/h2&gt;

&lt;p&gt;I do not need a dashboard for every editorial task. Two snapshots, a comparison, and a short question list are often enough. The aim is to spend less time hunting through versions and more time understanding the material.&lt;/p&gt;

&lt;p&gt;Before publication, I return to the source documents once more. The comparison helps me notice a change. My notes explain what I did about it. Together, they give me a clearer path from a corrected file to a sentence I can stand behind.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>tools</category>
      <category>writing</category>
    </item>
  </channel>
</rss>
