
Peter Dimov wrote:
Steven Watanabe:
AMDG
David Abrahams wrote:
Every dependency should be an informed and conscious decision on the part of a library developer.
Humph. It's not as though #includes mysteriously appear in your code when you're looking the other way.
They do, as part of bug fixes made by others and as indirect dependencies. This goes unnoticed because the test infrastructure always has the whole of Boost available. One needs to actively fight dependencies, or they do creep in.
They also do thanks to bad coding choices. I just had a job applicant doing a coding test today who opened his source file with a couple of dozen lines of includes and defines that he referred to as his "standard header" that he uses for everything. Unfortunately, only about 3 lines of it had anything to do with the coding problem he was supposed to be solving. One more way is by removing dependencies in the code. If a change or improvement eliminates the existing references to a header that lead to it being included, it is not always easy to know that and remove the include directive. Especially if this removal happens incrementally over a few changes. John