跳到正文
DEV Community· Versyka·· 24 分鐘前AI 評分37

5 個維護者習慣今年挽救了你的程式碼,卻無人致謝

5 maintainer habits that saved your code this year (and nobody thanked them for)

AI 導讀

五種維護者習慣今年幫助避免程式碼維護問題,卻很少得到感謝。清楚標示棄用項目的替代方案、明言破壞性變更、提供 codemod,以及如實遵守語義化版本,都能簡化升級工作。AI 供應商提前數月公佈模型停用日期,則有助預先安排遷移。

正文

Cover image for 5 maintainer habits that saved your code this year (and nobody thanked them for)

Versyka

Versyka

Posted on Nov 26 AI-assisted

5 habits saved your code this year. Nobody thanks them for it. Happy Thanksgiving. We spend all year reading changelogs, deprecation notices and migration guides, so here's who we're grateful for.

1. Deprecations that name the replacement

@deprecated Use validator instead. Four words, and an hour of searching saved. A deprecation that only says "deprecated" sends everyone to the issue tracker. One that names its replacement lets tools, people and AI assistants fix the call in place. Kotlin's ReplaceWith(...) goes one step further and lets the IDE do it.

2. Changelogs that say "breaking" out loud

Not "various improvements". Not "internal refactoring" for a change that renames a public function. A section titled Breaking changes, at the top, with before and after.

3. Codemods

A migration guide tells you what to change. A codemod changes it. Next.js, React and others ship scripts that rewrite the common call sites, which turns a week of edits into a review.

4. Shutdown dates announced months ahead

AI providers now publish model shutdown dates with real notice, on pages you can check. A date on a page, months out, is the difference between a planned task and a 2 a.m. incident.

5. Version numbers that tell the truth

A major when it breaks, a patch when it doesn't. Semantic versioning only works when maintainers resist the temptation to slip a breaking change into a minor, and most of them do, release after release.

All of this is unpaid, mostly

Most of these habits come from maintainers doing extra work they'll never be thanked for. So, a suggestion for today: open the repository of one package you depend on and leave a thank-you in its discussions. It takes a minute, and it gets read.

Which maintainer or project would you thank today?

來源:DEV Community · dev.to