Seems like an odd question, but I've been questioning this myself for some time now.
I've been told that, if you're working on a open source library/project, you should avoid adding dependencies for other external, open sourced, libraries because that'll make the software, that uses your libraries, become heavier with all the dependencies, inside dependencies, etc... But sometimes I'm a little on the fence about that. Do I really need to reinvent the wheel just to keep my library away from external dependencies?
For example, I'm currently building an Objective-C project that will be open sourced on Github and I need to use a XML parser to get data from — you guessed it — XML files. Apple's OS X already has a built-in API for XML parsing, but I'm not very fond of the way it works, it needs a lot of background processing and workarounds to get the data I really need, so I was thinking about using another XML parser to do a much cleaner job in terms of making my life easier, as the developer, but also by making the code a lot more legible for other developers.

What are your thoughts on this? Thank you.

  • depends on the licenses, if you depend on a GPL license then your lib needs to be GPL as well, other licenses have other requirements – ratchet freak Mar 28 '14 at 23:39

Xml Parsers are not something you should be building yourself, unless you want to for learning purposes or to make something specific for your needs. XML parsers are complicated enough that other folks already know how to write one better than you or I could (within a reasonable time frame).

One of the reasons for using XML is that libraries to read and write it are readily available. So, in the case of XML, I'd say go ahead and take the dependency. The library writer has already done the hard work for you, and it doesn't make sense to spend weeks or months writing something that's already readily available.


The whole point of open source is that you don't have to reinvent the wheel.

But you do need to understand the licenses of the libraries you use. Just including a library doesn't mean you have to use the same license for your project. But if you change the code in a library you would have to use a compatible license.

For example, I can use a LGPL library in a commercial product, provided I supply the LGPL and make the library source available. I don't need to supply my source. But if I change that library, I would have to release my code under LGPL and supply my code.

  • 1
    GPL is more restrictive than that, if your app relies on the GPL parts then your app must be GPL as well, with L-GPL you can just link it in – ratchet freak Mar 29 '14 at 0:16
  • @ratchet Thanks. Yes, my answer is imprecise. I'll edit to improve. Meanwhile the main message for the OP is to understand the licenses. – andy256 Mar 29 '14 at 1:19
  • Making a change to an LGPL library doesn't mean that you suddenly have to release also the code of an application that uses the library. Only the modification to the library needs to be made open. – Bart van Ingen Schenau Mar 29 '14 at 8:49
  • @Bart Yes, correct. – andy256 Mar 29 '14 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.