Hacker News new | past | comments | ask | show | jobs | submit
Generating tonnes of documentation is easy, but it can easily get outdated and so much that no one would read it. Ideally, code should be the single source of truth. Documentation should be generated dynamically and upon request to not go stale. The amount of detail and how far to dig in should be up to the end user.
I recall, back in the AmigaOS days, we kept the documentation inline with the code. E.g. you had your exported API function in a shared library code's .c file, with the documentation right above it sitting in a special formatted comment. Easily kept in sync (code wasn't that convoluted back then either.) Afterwards, during the build phase, the documentation (for other developers) was extracted on-the-fly. There was a fixed format/style and the documentation was compact and actually useful too.

(aka "autodocs", for those who remember the term)

I simply added a documentation agent to my parallel code review skill. Automatically finds documentation drift.
loading story #48414635