惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Recent Announcements
Recent Announcements
H
Help Net Security
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
小众软件
小众软件
Last Week in AI
Last Week in AI
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
V
V2EX
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I delete code on Fridays
Matthew · 2026-05-14 · via DEV Community

Matthew

Most weeks, the last thing I do before logging off Friday is open a file and delete something. Not refactor it. Delete it. A dead feature flag, a commented-out block somebody left "just in case" in 2022, a helper function with one caller that could just be inlined. Small stuff, usually. The point isn't the size. The point is the habit.

I started doing this maybe six years ago, after a particularly grim quarter on a service nobody fully understood anymore. We had a config loader that supported three formats. Two of them had no live consumers. I know that now because I eventually checked. At the time, everyone assumed someone, somewhere, depended on the YAML path and the INI path, so we kept carrying both through every change. Every bug fix had to be made three times. Every test had to cover three branches. The code wasn't complicated because the problem was complicated. It was complicated because we were afraid.

So now I delete things on purpose, on a schedule, when I'm calm and not under deadline pressure. Friday afternoon is good for this. The risky work is done, I'm not going to start anything new, and my brain is in a "tidy the workshop" mood instead of a "ship the thing" mood.

The rules I follow are boring, which is the idea. I only delete code I can prove is dead. That means I actually grep, I check the call sites, I look at the dashboards if it's a runtime path. If I can't prove it's dead within about ten minutes, I leave it and write down why I'm suspicious. The note matters as much as the deletion. Half the value here is building a paper trail of "this looked unused on 2026-03-14, here's what I checked." Future me trusts past me more when past me showed the work.

I also keep the deletions in their own commits. One commit, one removal, a message that says what it was and how I confirmed it was safe. If something breaks, the revert is trivial and obvious. Nobody has to untangle a deletion from a feature change. I've had exactly one of these deletions bite me in six years, and the rollback took under a minute because the commit was clean.

Here's what surprised me. The hard part was never the technical risk. Git remembers everything. If I delete something that turns out to matter, it's right there in history, and the build will usually tell me within the hour. The hard part was the feeling. Deleting working code feels like throwing away effort, even when the code does nothing. Somebody wrote that. It compiled. It passed review once. Removing it feels disrespectful in a way that's hard to articulate and completely irrational.

I've made peace with that feeling by reframing what the code costs. Every line in the repo is something a teammate has to read past to find the line they actually need. It's a branch a new hire has to mentally evaluate. It's surface area for a security scan to flag. Dead code isn't neutral. It's a small tax everyone pays forever, and nobody put it on the roadmap.

Twenty-some years in, I've stopped measuring a good week by what I added. Some of my favorite diffs are almost entirely red. A pull request that removes a whole module and the tests still pass is a genuinely satisfying thing to send, and it usually means I understood the system better at the end of the week than I did at the start.

It doesn't have to be Friday. It doesn't have to be weekly. Pick a rhythm you'll actually keep. But find a regular, low-stakes window to remove something you've proven is dead, and write down what you checked. The codebase gets lighter. So, weirdly, do you.