The Joy of Web Design: Plugins Versus the Power of DIY
I’ll just say it, I love plugins. Those little lovely bits of pre-formed code that is the result of one persons ingenuity and invention help reduce development time. Plugins extend the normal functionality of a given framework (let’s say WordPress for instance). Here’s how it works:
- Bob the Developer needs to add certain functionality to a site like add the lyrics to Hello Dolly to the admin dashboard
- Bob writes some code that spits out Hello Dolly lyrics into the dashboard UI
- Bob wants to share the code with Jill who shares it with Nan who shares it with the chess team
Plugins shouldn’t be thought of as a replacement for learning how to do something.
This bit of code could save the developer hours of time recreating the same thing. The amount of time writing the logic, determining the user experience, writing the code, and then testing, Testing, TESTING!!! It can be a lot for a developer to produce in a short time frame some times. That’s when the developer looks for a plugin. The developer has now saved the client time, and more importantly money.
The problem is that plugins aren’t always the right thing for the job. They are great in that they can add functionality not originally present. The downside is they can add to code bloat, conflict with other plugins, and are not always without their conflicts. I’m not saying that all plugins are bad. I use several plugins to beef up WordPress, and I use a number of jQuery plugins to add layers of interaction (or fix browser issues). However, there are times that I have found it is better to actually write your own code.
Why Use Plugins
1. Plugins save time
There I said it. Plugins save time, which makes your client happy, your family happy, and your country happy. You fulfill the American dream by Respecting the Lazy, and finding a ready made solution. Now you can bill eight hours and finish playing Call of Duty. That’s a win win win.
2. Plugins usually have some sort of support feature
Typically the plugin creator will take time out of his/her busy day to answer questions about the plugin, and trouble shoot any possible bugs found. It is in his/her best interest to do so. The developer may even give tips on customizing it, or ask for your help in keeping it updated (it could happen). Donate five bucks for a beer, and you have a friend for life in some cases.
3. Plugins have been previously tested (I hope)
Most developers, the ones who do their job dilligently, won’t let a plugin leave their computer before they have tested it. They may even get their friends to help test it to make sure it is cross-browser compliant.
Why Roll Your Own
1. It’s your project, you know how you want it to be marked up
The amount of time writing the logic, determining the user experience, writing the code, and then testing, Testing, TESTING!!!
Some plugins add their own flavor of markup, resulting in many a nested
DIV. This becomes cumbersome when you try to theme the output, and have it bend to your will. Yeah, there’s Firebug and other developer tools that help make the element easier to style, but sometimes you have a particular way you want the element to be formatted that may conflict with some of the parent elements.
2. Plugins add extra weight and increase page load time
Since everybody is all a flutter about page load time, it is important to remember that when you add a function or a plugin you add code, which adds weight, which adds time. Doesn’t matter how you cut it, you are going to have to do it anyway. You either write the code yourself, or you use a plugin. Sometimes the code you right may be 12 lines long as opposed to 45 lines if the plugin is not compressed.
3. You really need to learn how to do it the right way (after all it is about the craft).
Conclusion: It’s Entirely Up to You
It really is a situational dilemma when choosing a plugin over something home grown. There are a lot more aspects to touch on in this topic, and I have only scratched the surface. However, these are points that we as developers need to think about daily, and need to encourage in the upcoming batch of developers.
I try not let the monumental task of creating my own function scare me away from doing the work myself, but there are times when I need quick, dirty and tested. Plugins help in that area. If you start using a lot of plugins you start to get a good idea of what to look for in terms of standards, testing, and reliability. Eventually, you even know the names of the developers to keep an eye out for. The flip side to that is that by making your own plugin you have done the work yourself
*Before anyone says anything, Hello Dolly is the greatest WordPress plugin EVER!!!