With the recommendation, or with the reasoning? I did not dispute the
former.
That is a one of the thousand other reasons I acknowledged.
But maybe, I just misunderstood what James had in mind when he
was saying "visible by all users". I took that to refer to
human users not files that include the header.
I should have been clearer. I was talking about compile time
coupling. Quite frankly, it didn't even occur to me that human
beings would read a header file (other than to modify it).
In practice, it sometimes does go beyond just the compiler,
however. I've worked on projects where the header files were
all automatically generated (by Rational Rose), and the
"average" developer couldn't even check them out from the source
code repository; he only had read access to them. But that's
still another issue.
[...]
I thought, it was clear from my topic sentence that I have no
problem with the recommendation per se to put the
implementation into a different file. I just question the
particular rationale.
Perhaps I didn't express the rationale clearly. I was definitly
thinking of the fact that when you compile code, you read the
header file. (Or at least the compiler does.) And the fact
that most build systems have a granularity of the file; any
modification to the file triggers the recompilation of all the
source files which include it, directly or indirectly. Adding
implementation to the header means that client code (the object
files, if you prefer) are coupled to the implementation, and not
just the "contract".
(Note that sometimes, you exploit this coupling intentionally.
If change the contract of a function in such a way that it might
invalidate existing code, e.g. by making the pre-conditions
stronger, you also change something in the signature, so that
will not only be recompiled, but that it will fail to recompile
until it has been reworked to accept the new contract.)