I’m using a library that makes frequent use of patching (replacing text in source code) for dependencies. I feel this is bad form, because, for example, that dependency may now conflict irreconcilably with another dependency of mine.
Am I right in thinking patching code is bad form?
This would depend on the language/ecosystem. It’s worse for C and C++ than for example Rust because of packaging policies and ease of distributability.
Hmmm, it’s C++
If your patching an external library, please try to do what you can in the moment to formulate the patch in such a way that the upstream can accept it.
Patching is a reasonable temporary solution while you are actively working to get the patch merged upstream. If you’re not doing that, a better solution is to fork. If you’re not doing that either, then you should be updating your resume.
Is this for a personal project or something to be distributed?
If this is a distributed project where reproducibility is important, modifying external dependencies will quickly and greatly complicate things. I think a preferred method would be forking if not doing a pull request, assuming those dependencies are open source. This way you can independently develop on the dependency and source it separately instead of relying on patches

