协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
simplify【开发与工程】Code simplification for high-complexity files. Targets deep nesting, copy-paste patterns, and god functions.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Why: You cannot improve what you cannot quantify. Baseline metrics prove simplification actually happened and prevent subjective "it feels cleaner" claims.
Why: Named abstractions replace "what does this block do?" with "what does this function promise?" — reducing cognitive load per reading unit.
Why: Precise names eliminate the need for comments and make wrong code look wrong. A reader should understand intent from names alone.
Why: Every line of code is a line someone must read, understand, and maintain. Fewer lines with the same behavior means lower lifetime cost.
Why: Simplification that breaks behavior is not simplification — it is a regression. Tests are the safety net that makes structural changes safe.
| Excuse | Rebuttal | What to do instead |
|---|---|---|
| "We might need this later" | YAGNI. Code you don't need is code you maintain for free. Add it when you need it. | Delete it. When the need arises, write it with current context — not stale assumptions. |
| "This abstraction makes it more flexible" | Flexibility without a concrete use case is complexity. Simple code is flexible code. | Abstract only after you see the second use case. Two concrete examples beat one imagined future. |
| "It's already working, don't touch it" | Chesterton's Fence: understand why it exists first. But if it's needlessly complex, simplify it. | Understand it, write tests for it, then simplify it. Working code that nobody can read is a ticking bomb. |
Before claiming simplification is done, show ALL of these:
"I cleaned it up" without metrics = opinion, not simplification.