Avoid using third-party libraries!

Published on

"You shouldn't reinvent the wheel, there is already a battle tested solution for this". I think many of us have heard something like this. While there is some truth in this, many people don't realize that third-party libraries have their share of negatives as well. What's more, some of these negatives are not even immediately noticeable. I'm not claiming you shouldn't use libraries at all, but I'm mostly criticizing this mentality of using libraries left and right.

Bloat

The most obvious downside of third-party libraries is the bloat. Usually you don't use most of the library's functionality. This means most of the library's code increases your application bundle size which can negatively affect the loading time and even the performance. This is especially true for web applications.

Limited control over the library code

This is the next thing that comes to mind. Usually you are not going or even permitted to patch the library code especially when the library is supposed to be installed via a standard package / dependency manager like Node's npm, PHP's composer or Flutter's pub.

Can be unsuitable for exotic requirements

Imagine you are developing an app for some customer and you decided to use a pin code library for the pin code input on the email verification page. The pin code input looks and works great. You show a demo to your customer. Because the pin code has many digits (let's say 7) the customer now wants to be able to easily correct some number without clearing the numbers that come after it. Unfortunately, the library author didn't think about this and didn't provide any advanced customization mechanism.

Such things can easily turn into frustrating situations where you have these options:

Bugs

Libraries can also have bugs. Working around them can be hard. This makes working with libraries really frustrating, especially when you know and able to implement the thing correctly but you are forced to use some buggy library.

Compatibility issues and maintenance costs

While libraries might help you to finish the project very quickly, they can add problems in the long run. Libraries and the code that relies on them might also need maintenance since libraries are constantly updated and can introduce breaking changes. Additionally, libraries can also depend on some other libraries, frameworks, languages, etc. which can introduce breaking changes as well. This dependency hell can turn into a real nightmare if it gets out of control.

Can prevent from learning how things work

Over-reliance on libraries makes you unaware of many things. This can prevent you from learning how things work under the hood. When you first start by using only high-level libraries, you may miss important fundamentals.

They remove the challenge and the fun

Sometimes you need interesting and challenging tasks to improve your skills. While this may not be the best option for the business in the short term, it will give you more experience and skills in the long term. Good programmers are often motivated by interesting and challenging problems, so, if there are no interesting and challenging problems, there is usually less motivation.





Read previous


This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: Privacy & cookies.