I’ve made a few comments like this in readme’s and in code comments before. I am a big fan of long comments in codebases about why something exists or ways in which it could be improved. Big fan of explanatory commit messages, providing context around the history of things, and the avenues tried and discarded.
I used to not feel this way. But I’m really not sure now that I understand why. I would have probably said things like comments can be incorrect and/or misleading. But I guess I actually find that fact useful, rather than harmful. If the author thought their code did one thing and it actually did another, knowing that is good for me. Or if the code has changed its purpose overtime, I can discover that via that comment.
As I’ve had to fix more and more code, learning the history and purpose of the code is incredibly useful. Having to infer that san-comments is much harder. (It goes without saying that I don’t mean comments like “set x to 2”)
I am emphatically anti-external documentation. I think that is the single greatest way to make the documentation 1) not written 2) not read and 3) not helpful. External documentation means I have to know that I need to know something. When I’m reading code, why would I expect there to be something in a totally separate context telling me about this code?
(Linking is not and answer. I can’t how many times I’ve read “Please see CEH1282 for more explanation” just to find just to find out that CEH was the project management tool that the company got rid of 6 years ago.)
If you want to make these sorts of diagrams and are on the mac, definitely recommend https://monodraw.helftone.com/