Just wanted to put in that I agree with you. My system is that programs are documented at the end, and libraries are interleaved.
The difference being to me that programs are designed to be used and understood by non-programmers, so the docs often have little or nothing to do with any specific code. Libraries on the other hand are designed to be used by programmers, and each function should be documented on what it does (or, at least, what it is documented to do...) anyway, so the interleaved docs can often serve both purposes: Telling users how to use functions/methods, and telling maintainers what those functions/methods are intended to do.
Otherwise I'd have to write both a comment and documentation, and they'd have to both be maintained in parallel. Interleaving them I only have two things to maintain: the docs and the code.
|