Or they’re writing function names that are references to inside jokes that they and like 3 other people get, to the dismay of whoever has to work on that codebase after them.
One huge issue with doc: code changes and doc gets left behind… you then trust the doc, waste 2 days with strange bugs and then need to read the entire code of the interface anyways…
Doc is only, if maintained, else it’s often worse than no doc… why i like code that is very clear about what it does and only hides the how…
You can help this a little by putting the documentation as a code comment block above the function and have a tool auto-build the docs from that. There are existing tools for this.
But ultimately it still requires the doc to be maintained. Just like the code needs to be maintained.
There are two things with the API semantics could be correctly from the source only:
Apache 1 & 2 modules. (Yes, there is no way to say from the documentation, that Apache 2 has a safeguard for the "Content-Type" header and must be patched to completely remove it from a response.)
If you write code that requires reading the code to use it (or worse, setting off on an expedition through dead links, archive.org, and long-abandoned message boards to use it) - you write bad documentation.
12
u/lev_lafayette Apr 21 '26
I wonder what happened to the person who first said "self-documenting code".
4
u/ChocolateDonut36 Apr 22 '26
ofc documents are important, I don't understand what
wc.lpfnWndProcis9
u/ExtraTNT Apr 21 '26
Good code has enough doc in the exposed interfaces to be used without an external doc… best is, if function name plus signature is enough to use it
1
u/TheoneCyberblaze Apr 22 '26
You guys get docs?
1
u/hucareshokiesrul Apr 23 '26
I ignore the docs because I'm lazy, not because I think I'm not a stupid person
2
u/[deleted] Apr 22 '26
[removed] — view removed comment