<?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: Tual Maxime (@filozofer)</title>
    <description>The latest articles on DEV Community by Tual Maxime (@filozofer) (@filozofer).</description>
    <link>https://dev.to/filozofer</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F457658%2F18cc9621-8bc2-4803-bd61-df2e97f4113e.jpg</url>
      <title>DEV Community: Tual Maxime (@filozofer)</title>
      <link>https://dev.to/filozofer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/filozofer"/>
    <language>en</language>
    <item>
      <title>I was asked to delete my comments before committing</title>
      <dc:creator>Tual Maxime (@filozofer)</dc:creator>
      <pubDate>Sun, 22 Mar 2026 01:20:22 +0000</pubDate>
      <link>https://dev.to/filozofer/i-was-asked-to-delete-my-comments-before-committing-5437</link>
      <guid>https://dev.to/filozofer/i-was-asked-to-delete-my-comments-before-committing-5437</guid>
      <description>&lt;h1&gt;
  
  
  I was asked to delete my comments before committing
&lt;/h1&gt;

&lt;p&gt;I've worked in IT for 12 years now — as a full-stack developer and lead dev.&lt;/p&gt;

&lt;p&gt;Recently I was confronted with a problem I had never faced before in my career: my team members asked me to remove all my comments before committing code.&lt;/p&gt;

&lt;p&gt;We discussed this. Some of them believe that the presence of comments in code almost always indicates that the code isn't clear enough on its own, and that this is therefore a sign that it needs to be rewritten so that comments are no longer necessary.&lt;/p&gt;

&lt;p&gt;And I get that. &lt;br&gt;
I've read &lt;em&gt;Clean Code&lt;/em&gt;. I've adopted some of the principles described in the book. But I've also read &lt;em&gt;A Philosophy of Software Design&lt;/em&gt;, and what I read about the concept of deep modules versus shallow modules really resonated with me. That's not the focus of this article, so I won't say more about it — except to note that the debate over the use of comments isn't over in our profession (will it ever be?).&lt;/p&gt;

&lt;p&gt;Back to the situation. I explained to my co-workers that I was using a narrative approach when coding, which can be called "comment-driven development". First I put all my comments, modify them, refactor them, &lt;em&gt;then&lt;/em&gt; I write the code below the comments.&lt;/p&gt;

&lt;p&gt;These comments help me structure my thoughts. They are an extension of my working memory. Working without them is like having part of my cognitive abilities taken away from me. Once they're written, I still use them when reading the code later during evolution: they are my navigation links. My brain is used to this, so it quickly scans through these comments in a function to figure out where I need to make a change or debug.&lt;/p&gt;

&lt;p&gt;They listened to me, they tried to understand, but their final decision remained: they want a clean codebase without this kind of comment. In their view, these comments aren't useful, won't be read by the team, and certainly won't be maintained. In a nutshell: no noise.&lt;/p&gt;

&lt;p&gt;But for me, those comments weren't noise.&lt;br&gt;
They were how I think!&lt;/p&gt;

&lt;p&gt;The only compromise they came up with was to delete my comments before committing. That solution didn't sit well with me. It was too frustrating and would result in too much wasted mental energy down the line. At the same time, I need to be pragmatic and respect the team's decision.&lt;/p&gt;


&lt;h2&gt;
  
  
  Go deeper into the problem: the issue is not the comments themselves
&lt;/h2&gt;

&lt;p&gt;Git doesn't distinguish thinking from sharing.&lt;br&gt;
Git doesn't distinguish between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;code I write to &lt;strong&gt;think&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;code I share to &lt;strong&gt;collaborate&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if I follow my co-workers' rule, every time I want to commit, I have to clean everything up.&lt;/p&gt;

&lt;p&gt;Remove my comments.&lt;br&gt;
Polish the code.&lt;br&gt;
Make it "presentable".&lt;/p&gt;

&lt;p&gt;And for some of that it's fine… until I realize what that means for my way of thinking and coding.&lt;/p&gt;


&lt;h2&gt;
  
  
  Deleting the comments was deleting my thinking
&lt;/h2&gt;

&lt;p&gt;Every time I committed, I would delete:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;my navigation links&lt;/li&gt;
&lt;li&gt;my reasoning&lt;/li&gt;
&lt;li&gt;my half-formed ideas&lt;/li&gt;
&lt;li&gt;my doubts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My Git history would be clean.&lt;br&gt;
But my thoughts would be gone.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I lose context when I come back later&lt;/li&gt;
&lt;li&gt;I lose the trace of why decisions were made&lt;/li&gt;
&lt;li&gt;I lose part of my cognitive process&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For me, that wasn't acceptable.&lt;/p&gt;


&lt;h2&gt;
  
  
  So I built a workaround
&lt;/h2&gt;

&lt;p&gt;At first, it was just a few scripts inside my project.&lt;/p&gt;

&lt;p&gt;A way to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;keep my comments&lt;/li&gt;
&lt;li&gt;generate a clean version before committing&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  But very quickly, I realized something bigger: this is not just a workaround. It's a pattern.
&lt;/h2&gt;

&lt;p&gt;I wasn't just solving a personal problem.&lt;/p&gt;

&lt;p&gt;I was formalizing something deeper:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Code for thinking ≠ code for collaboration&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are two different activities.&lt;/p&gt;

&lt;p&gt;They have different needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;thinking needs freedom, messiness, exploration&lt;/li&gt;
&lt;li&gt;collaboration needs clarity, structure, readability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trying to force both into the same branch creates friction — not just in the codebase, but between the people who work on it.&lt;/p&gt;


&lt;h2&gt;
  
  
  Introducing the Shadow Branch Pattern
&lt;/h2&gt;

&lt;p&gt;We’ve optimized code for readability.&lt;br&gt;
But we’ve never optimized it for thinking.&lt;br&gt;
Maybe that’s the real problem.&lt;/p&gt;

&lt;p&gt;The idea is simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;shadow branch&lt;/strong&gt; for thinking (&lt;code&gt;feature/x@local&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;public branch&lt;/strong&gt; for collaboration (&lt;code&gt;feature/x&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You work freely in the shadow branch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;your comments&lt;/li&gt;
&lt;li&gt;your experiments&lt;/li&gt;
&lt;li&gt;your unfinished ideas&lt;/li&gt;
&lt;li&gt;your own scripts&lt;/li&gt;
&lt;li&gt;your own workarounds&lt;/li&gt;
&lt;li&gt;your own notes / documents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And when you're ready, you publish a clean version to the public branch.&lt;/p&gt;


&lt;h2&gt;
  
  
  git-shadow
&lt;/h2&gt;

&lt;p&gt;To make this usable in real life, I built a CLI:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/filozofer/git-shadow" rel="noopener noreferrer"&gt;git-shadow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work on a local "thinking branch"&lt;/li&gt;
&lt;li&gt;keep your comments and reasoning&lt;/li&gt;
&lt;li&gt;publish clean commits to your public branch&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  A quick example
&lt;/h2&gt;

&lt;p&gt;Start a feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git shadow feature start my-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Work freely in your &lt;code&gt;@local&lt;/code&gt; branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// Get user from database&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findUnique&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Invalid credentials&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;/// Verify user password&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isPasswordValid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;bcrypt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;passwordHash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isPasswordValid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Invalid credentials&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;/// Build session for user&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="na"&gt;createdAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&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;Publish clean code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git shadow feature publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your public branch receives this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findUnique&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Invalid credentials&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isPasswordValid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;bcrypt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;passwordHash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isPasswordValid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Invalid credentials&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="na"&gt;createdAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&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;Your thinking is preserved locally. The &lt;code&gt;///&lt;/code&gt; comments are kept in a separate commit on your shadow branch only.&lt;/p&gt;

&lt;p&gt;You can also commit entire notes, scripts, or local environment tweaks using commits prefixed with &lt;code&gt;[MEMORY]&lt;/code&gt; — these are never cherry-picked to the public branch. Useful for local dev shortcuts, AI memory files, or anything that belongs only to your context.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;This is not about comments.&lt;/p&gt;

&lt;p&gt;It's about cognition — and how we actually work.&lt;/p&gt;

&lt;p&gt;Coming back to a feature three months later, I don't want to reconstruct the context from scratch. The &lt;code&gt;///&lt;/code&gt; comments are the trace of my reasoning: &lt;em&gt;why did I split things this way? what edge case was I thinking about?&lt;/em&gt; Without them, the code is there but the thinking behind it is gone.&lt;/p&gt;

&lt;p&gt;There's also a dimension I didn't anticipate when I started: this pattern works remarkably well with AI coding assistants. The shadow branch can hold architecture notes, domain context, and AI memory files — all things that help an AI tool understand your codebase better, without polluting the shared repository.&lt;/p&gt;

&lt;p&gt;Code for thinking. Code for collaboration. They're not the same thing, and maybe we shouldn't force them into the same place.&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing thought
&lt;/h2&gt;

&lt;p&gt;When I was confronted with this team decision, I thought I just had a "weird way of working".&lt;/p&gt;

&lt;p&gt;Now I think the tools are missing something.&lt;/p&gt;

&lt;p&gt;Maybe we've been forcing ourselves to hide the way we actually think for too long?&lt;/p&gt;




&lt;p&gt;If this resonates with you, I'd love your feedback.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git-shadow&lt;/strong&gt; is available cross-platform and version 1.0.x is ready to use.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/filozofer/git-shadow" rel="noopener noreferrer"&gt;https://github.com/filozofer/git-shadow&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>productivity</category>
      <category>developer</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
