DEV Community

Cover image for Why I hate dependencies!?
R Z
R Z

Posted on

Why I hate dependencies!?

So many of you do like to install dependencies, but I hate this and I'm going to explain why!

First things first, I'm not going to make someone reinvent the wheel. Moreover, it would be stupid if you tried to do something like this, but, anyway, you have to be smarter people who use libraries, utilities and sh**t like this for every single project.

Let's imagine that you're building a website for a client who wants to save money. Of course, your main goal is to make a shitty project and take money because he is greedy enough and you don't give a damn about his project! In this case, you can probably use libraries to achieve your goal in an easy way, but if you're making a site for yourself or for a client who's ready to pay decently, then you should avoid using all kinds of shit like libraries...

Disadvantages

Unification

Any project must be unified and each new library that you use has its own programming style and it means that interaction with other component will be different. By unification I don't mean indents or something like this, I means variable naming and everything like that. In fact, there's a lot of stuff.

Bundle Size

It's an obvious fact that when you install a library, it will have redundant functionality that you will most likely never use, and this increases the final file size and takes longer for a browser to process all of this.

DRY (Don't Repeat Yourself)

Let's imagine that you need a library that crops an image and send the cropped image to a server. What does this lib consist of?! It has utilities measuring sizes, calculating coordinates, and so on. It's okay. Now you need some another lib that allows to move an element around. Of course, this lib will has identical utilities that do the same things. What about if you need a tooltip? Again, its lib will has the same utilities and many other similar code. This list can be much longer.
But if you used your own solution with your own utilities, you would save a lot of space and enhance performance, because you would use one util everywhere as an internal dependency.

Performance

Many libs have performance issues. I MEAN it! Some popular libs also have these issues. I did some tests and I was really surprised.

Support For Old Browsers (Aka IE (donkey))

There're so many libs that support old dead browsers. A lot of dead code is good!!! /s

Many Dependencies, Many Updates

If you have a lot of dependencies, you need to keep an eye on new releases and change your code when necessary, because updates can be related to security, performance, and so on. This may require a lot of extra effort, and you probably have a lot of other things to do.

Outdated

What about if your favorite library gets outdated?! Can You imagine how much work you need to do to move from one library to another?

Bad Documentation

You will have to spend a lot of time to understand how it works because of sparse documentation. Moreover, you get more problems if another member of your team has to work with this lib.

Accept It As It Is

Sometimes one or the other library can't cover all the necessary functionality and just accept it as it is, sacrificing what we might come in handy. In our own solution, you can do whatever you want.

Today One, Tomorrow Another

Let's imagine that you have found a library that satisfies you, but after a while you will realize that this library does not meet all your requirements, and you need to find some alternative, because you can't just make changes to an existing library, but if it was your solution, you would make any changes you want.

Coding Experience

When you do something with your own hands, you get some new experience, your coding level increases, and you can solve many tasks that seemed impossible to you. You just get better as a programmer. With these skills, you can solve more complex tasks and make more money.

Many Other stuff

Actually, I can list disadvantages forever, but I'd prefer to keep this article as short as possible. I guess, it's enough for the first time.

Advantage

Build As Fast As Possible

This approach can save you time. You can build a website much faster because you don't need to write anything from scratch.

Popularity

There is a high probability that a popular library will be protected from bugs (but it's not exactly), because a lot of developers using it reporting bugs which, in turn, are fixed.

Beginning Developer

If you're a beginner and want to build something on your own and quickly, then it's a good thing to go this way.

But don't forget to learn the language itself.

Learn From Others

Third-party libraries can also be useful when you need to make your own solution, you just can go through the code written by other developers and adopt experience and many other interesting things.

Many Other stuff

I'm sure, advantages might be more than this, but it's 3:15 AM and I can't think straight. I've just listed main advantages.


Conclusion

I don't encourage anyone to reinvent the wheel! If you want to use the framework, go ahead, it's a good idea.
I can't imagine my life without frontend or backend frameworks. I personally use some great libraries, but the thing is, I do my best to use my own solution when necessary.

Happy Coding, Guys, I Love You :)

Top comments (1)

Collapse
 
codemouse92 profile image
Jason C. McDonald

I don't encourage anyone to reinvent the wheel!

I often do. Third-party dependencies have their uses, but they can also contribute quite a lot of "flux", as you have quite astutely pointed out.