API/Library – When to Use and When to Write Your Own

javascriptPHPweb-development

I am working on a large website and having been thinking a lot about when I should be using a 3rd party API/Library and when I should be writing my own implementation from scratch. There is no Library out there that would incorporate all the functionality I need for my site but there are a number of libraries that would allow me to quickly implement different parts of the site's functionality.

I have a lot of programming experience and a good amount with PHP and Javascript, but I have never worked on anything this large. This is my own personal project and I know that to implement all of the functionality that I want from scratch would take more time that I would like to spend, but I would also like to keep my use of 3rd party APIs and Libraries to a minimum so that I can implement new functionality and fixes on my own without having to wait for someone else to release updates.

What are some of the criteria you use to decide when to use a 3rd party API/Library and when to write your own implementation?

Best Answer

I until recently worked on a large project, where we decided to use 3rd party stuff. In the beginning it worked fine. We got our stuff together. But as time went by, we discovered, that the libraries we used were too inflexible. We decided to replace the 3rd party libraries piece by piece with our own code, now knowing exactly what we needed and how to do it.

I left the project when we were nearly finished replacing all the 3rd party stuff with our own stuff. We got very far with the project in the beginning and had something working and running pretty soon.

Now, I work on a large software project in the company I am employed at. Our architect told me, that what ever we can build our-selfs is far better than the 3rd party libraries out there, well knowing, that it costs a lot of time (and money) to build something, that is already available.

My opinion is, that using 3rd party is fine for getting projects far in short time, but in the end, you should rely on your code. 3rd party libraries are often tested by a lot of people and sometimes not (depending on the source). If you work carefully and test your code, you can create everything you can dream of. Build your own little repository of snippets and classes and make them reusable. It will get you further in the end.

Related Topic