DEV Community

Cover image for 🧼 Help, I Have Clean Code OCD – A Functional Programming Horror Story
Yashodhan Singh
Yashodhan Singh

Posted on

🧼 Help, I Have Clean Code OCD – A Functional Programming Horror Story

"Hi, my name is Yash, and I haven’t mutated a variable in 147 days."

They say the first step is acceptance. But how do you accept that your life has become a series of pure functions and monads? That you've spent more time refactoring than writing actual features? That you once rejected a PR because someone used a let instead of a const?

Welcome to my story — a tale of one dev’s descent into the rabbit hole of functional programming and clean code purity.


đź“– The Backstory: I Was Just a Developer Once

I used to write code that worked. It wasn’t elegant, but it was honest. We called APIs. We mutated objects. We had deeply nested conditionals.
It wasn’t beautiful — but it shipped.

My files were big, my variables were vague, and my linter? Mostly decorative.

And then one day... I discovered eslint --fix.

That led me to Clean Code. Then FP. Then a YouTube video where someone used a curried function to build an entire REST API. I was horrified… and inspired. I thought, “If this guy can refactor CRUD into existential math, so can I.”

What started as a pursuit of better code quickly became a full-blown personality trait.

Last night, I spent two hours to refactor something that already works. Why?


🚿 It Started Innocently…

Like all good horror stories, mine began with a desire to do better. One day I saw a talk by Uncle Bob and thought, “Yes, I too want my codebase to be so clean it could do surgery.”

So I started small:

  • No console.log in production code âś…
  • One function per concern âś…
  • No mutation ever âś…

But once I read about functional programming, that's when everything changed. I was already in the cult.


🌀 The Pure Function Spiral

At first, map and filter were fun little tools. Like new LEGO pieces.

Then came:

  • Composing functions like an orchestral symphony 🎼
  • Refusing to write a single if đź’€
  • Judging colleagues for using variables with more than one responsibility

Eventually I was:

  • Turning state management into a philosophical debate about immutability
  • Writing code that passed all linter rules... and failed all human readability tests
  • Creating tiny functions with 100% test coverage that did absolutely nothing useful

I even had a function called normalizeData that was composed of 11 smaller functions — none of which were longer than 3 lines. Beautiful. Useless. Like modern art.


đź§  The Symptoms

You may also be infected with Clean Code OCD if:

  • You have more types than actual data
  • You use the word “side effect” in casual conversation
  • You believe null is a personal insult
  • You’ve said, “I can’t approve this PR; it’s not referentially transparent”
  • You get physically uncomfortable around uncurried functions

Worst of all, this obsession spreads. One code review at a time. One Slack thread about "function purity" at a time. I've seen strong, pragmatic devs fall under its spell after just a single exposure to fp-ts.


meme

They say perfect is the enemy of done. But in software, perfect is often just a clean code compulsion hiding behind eslint.

So here’s to all of you who’ve spent two hours renaming variables for the sake of clarity — may your purity bring you peace, or at least pass CI.

And if your teammates start repeating your patterns, just remember: Clean Code OCD is contagious.

Top comments (0)