in reply to
A third option
in thread Reusing code is good; reinvention might be better
I work on software for medical imaging applications. So they take quality a bit more seriously than most shrink-wrap software vendors.
I developed a set of standards for evaluating outside software and vetting it for use in our code. It includes the possibility of wrapping it with extensions to make it play nice with global names etc., and "quality extensions" to make it less brittle or handle errors better or things like that.
It also has a lot to do with documentation and correct use. For example, STL containers and iterators are neat, but they are like pointers in terms of their danger and should be used "internally".