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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
G
Google Developers Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
爱范儿
爱范儿
B
Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园_首页
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

ashishb.net

A day in Luxembourg - the richest country in the world I was asked to install malware during a fake interview Book summary: Breakneck - China's quest to engineer the future by Dan Wang Book summary: How to Teach Your Baby to Read Book Summary: The Discontented Little Baby Book by Pamela Douglas Introducing Amazing Sandbox - run third-party tools and AI agents securely on your machine Why software outsourcing gets a bad reputation? Book summary: The Natural Baby Sleep Solution by Polly Moore A day in Antwerp, Belgium Journey of online influencers Two days in Brussels, Belgium Shortcuts - when we love them and when we don't A visit to Rakhigarhi Three days in overhyped Paris Empty Japan, crowded Tokyo The real lock-in in GitHub is not the code, but the stars 11-day Norwegian Breakaway East Caribbean cruise Sanskrit and Sri Lankan Air Force Use REST with Open API The Achilles heel of American capitalism Costa Rica in 4 days At a juice stall in Sri Lanka A short stay at Warsaw, Poland Best practices for using Python & uv inside Docker Two days in Vilnius, Lithuania How IntelliJ IDEs waste disk space Pregnancy Why there aren't many digital nomads from India Two days in Riga, Latvia To keep your machine secure, run third-party tools inside Docker
Too much documentation is harmful
Ashish Bhatia · 2023-07-01 · via ashishb.net

As code changes, documentation becomes stale over time.

This happens at big companies. This happens at small companies. Unlike code, documentation is not compiled or tested. The code is executed. If the code execution fails or produces incorrect results, it is fixed with much higher urgency.

Too much documentation, like too many tests, is a bad idea. It slows down engineers who might not be well-versed in composing English proses. Further, if documentation is say about 90% accurate, it is useless for onboarding or training new engineers, as they won’t know what 10% portion is incorrect.

What’s a better approach?

  1. Minimize documentation - Like tests, write documentation along the axis of minimum change. Provide the overarching overview of the system. But don’t specify the database schema in the documentation, link to the code instead. Similarly, don’t specify precise tools like pip or yarn either as these tools keep evolving. Just link to the correct command file like Makefile or package.json. If the link fails to resolve, it would be an immediate indicator that documentation is obsolete.
  2. Automate documentation generation - Tools like pandoc, go docs and Java docs are great at generating automated documentation from the codebase. This is less likely to go stale. Even for external APIs like OpenAPI, one can automate documentation generation by adding relevant hooks directly in the codebase. For example, libraries like fizz (for Go) and swagger-autogen (for Node JS) can generate openapi.yaml and openapi.json spec directly from the code. Add a CI task to automate this generation and then the specification would never drift away from the source code.