Using external libraries in your project

Using external libraries in your project

My thoughts

When it comes to front-end development, I prefer to avoid using external libraries to achieve my goals. It always seems easier and quicker to just npm install a library for the specific functionality you are trying to implement, however, they tend to come with some issues.

I prefer to write my code as much as possible because I would be writing just the amount of code that I need for my app. No need for some extra functionalities to suit a wide variety of apps. Also, my app would be lighter and probably run with a better performance.

Almost every feature you'll want to build has been done already thousands of times, so all you have to do is go online and learn.

For a while, every time I wanted to create a modal, I would install a package for it, and most of the time, the thing was very buggy and added a lot of complexity to my code. Later I learned how to make my models and my code became simpler, lighter, faster and most importantly, predictable.

But by far the worst part about using external libraries is the increased dependency on someone else's code. Technology changes, frameworks and languages get updated, weird obscure bugs appear, and if you are not careful, they'll catch you. It's important to be very picky when it comes to the library you choose.

When should I use a library?

In an ideal world, never. It will always be more efficient to program all of the stuff on your own, however, because of deadlines and limited time, this is simply not worth it sometimes. For me, libraries are usually a last resort. When the feature I am trying to implement is just too complex and I can't solve the problem, I go for a library. When I go online and the most popular solution for a feature is to install a package, I go for a package.