When writing a library, the best approach is the absence of dependencies on other libraries, the absence of dependencies on state data in general (of course, not using global variables for state and synchronization in the library), clean and simple interfaces and all the other basic principles of good software development.
What README for libabc provides is a pretty good list of all the ways that authors have found to make the library difficult to use or introduce various kinds of subtle defects.
What the authors say is that it is difficult to predict how your library will be used and the environment in which it will work, so you have to be paranoid about how you implement the functionality and what types of services from the operating system and any other libraries you can use.
For example, see Public Library Designer fails .
Or When (and how) are the C ++ global static constructors that are called .
Or the GCC constructor is NOT executed .
source share