This site uses third-party cookies, learn more or accept
dark light

Why I dislike plugins, but still use them

Written by Max Pelic on

I try to avoid using plugins for Javascript and server-side plugins/libraries. In this post, I'll overview the reasons I dislike them, and why I still end up using them sometimes.

Part 1: Why I avoid plugins

It seems like every day I'm hearing about a new Javascript plugin and why it's better than all the previous ones. Don't get me wrong, there are some great plugins and libraries out there. But let's consider the downsides to using plugins and/or libraries in your project:

Speed: This is a big one - JQuery and other libraries can slow down a site by at least 100 milliseconds. Now, 100 ms might not sound like a lot of time, but every little bit of load time has the potential to drive away customers and visitors to your website.

Security: This is mainly a concern for server-side dependencies, but can apply to client-side (Javascript) as well. Every bit of third-party code you add to your site has to be kept up to date with any security vulnerabilities, and when you update it you need to make sure your current code still works. Once you start adding multiple libraries, the task can become unbearable.

Dependencies also present another security risk - they make your site an easier target. Once someone finds an exploit in a plugin, they can attack multiple websites. If your website is using that plugin, you better hurry and downloads the patch before someone attacks your website.

Part 2: Why I still use them

Although plugins do present quite a few issues, there are some upsides to them. I do try to avoid using them, but there are some cases where the pros do outweigh the cons:

When working on someone else's code. If you start updating code that already has some dependencies, it's probably not worth going through and changing all the code.

When it saves time/money. I will admit, using a Javascript library does speed things up. When you're on a tight schedule or trying to save time, using a library might be the way to go.

When it's required. For some projects, you'll need to support third-party services that require a Javascript file or server plugin. In that case, the best you can do is make sure it's being served quickly and you keep it up to date.

When it gives you a competitive advantage. This site uses Google's AMP, which has advantages for page load times and search results. In the case of this site, I evaluated the benefits and limitations (trust me, there are lots), and decided it was worth the cost.

Closing thoughts

In closing, I think plugins are generally overused. There are definitely times when dependencies help more than they hurt. Just make sure you evaluate how necessary the library or plugin really is before jumping in and including it in your project.

Consider this - if the plugin is written in the same language you are programming in, you can definitely write code that does the same things the plugin can do. Not only that, maybe you can write the same functionality in a way that works better for your website.

Share this article:

Previous Article: Choosing a Color Scheme

Next Article: Chrome has a new Dark Mode - how to enable it