TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Documentation isn’t the best place to be DRY

5 点作者 jameskerr将近 2 年前

2 条评论

armchairhacker将近 2 年前
This is actually an area to improve: documentation <i>should</i> be DRY as-written, just not as read. Repeating documentation is all good until you have to change something, and forget to change all instances. The author even mentions:<p>&gt; What happens if the person updating it doesn’t know to look for these additional instances? Then, three instances don’t get updated and end up leading someone in the wrong direction<p>but then seems to &quot;resolve&quot; this with<p>&gt; Only because the alternative is worse.<p>What about the third option: documentation with <i>inlined</i> references that expand to what they reference? This presents its own set of problems: setting up these references takes extra effort, and many developers may simply end up repeating themselves. But with the help of a smart IDE or documentation editor and some good tools (maybe even AI which can identify similar sentences), in particular an editor which lets you edit an instance anywhere rather than always having to jump to the original source, maybe we can write documentation which isn&#x27;t overly terse <i>and</i> stays accurate.
jameskerr将近 2 年前
I think it’s easy to change a few duplicated instances. It just depends on how often they change. Once a year? Easy. Once a week? Not fun.