Friday, March 3, 2017

Choosing a plugin

I follow this checklist whenever choosing or reviewing a chosen plugin to use on a Fullstack Software Development project. E.g. Javascript plugin or nodejs plugin.

Checklist:
  1. Gather all requirements for a project that a plugin needs to support
  2. Support: Consider the current supported browsers for the plugin. Is the author still making updates to the plugin on github? Is there a branch of a plugin that is now more actively maintained by another author? Is this the best plugin in terms of support? Does the plugin need to be supported or is it sort of set in stone (an example of this is Datejs.. hasn't been updated in several years but it still works just fine)?
  3. Consider how you would write overrides for any changes you may need to make to the plugin.
  4. Consider taking from the plugin only what you need. ie: seek to understand the parts of the plugin code you find useful and then borrow parts to use in your application code.
  5. Decide right now: are you using the plugin to quickly prototype something with means to replace it later or, will this plugin be permanent? Will this plugin be used in one part of your application or will it be included in various parts of your application? What is the expected lifetime of your project? Could there be future project requirements that may affect your choice? Consider the risks based on those answers.
  6. Can pieces of your application code that reference things specific to a plugin also be written like a plugin? E.g. Mixing a js plugin with a frontend bootstrap or framework. How can your code that is specific to combining a plugin with another 3rd party thing (ie: plugin or framework) be encapsulated and made independent of the rest of your application's code? Ideally, you do this in a way where it will be easy to update your js plugin, remove your js plugin, or replace the thing your combining it with (ie: another plugin or framework). When that happens it should be easy to update or even just remove this additional code you made because your encapsulated code was very easy to locate at the moment you chose to change a related piece.

Implementing a plugin:
  1. Is your plugin code in the same location as other plugin code?
  2. Will it be dead easy to update your plugin later on? How about removing it? Replacing it?
  3. What will the folder structure look like if you have to hang on to multiple versions of a plugin?
  4. Are you plugin overrides included in a place where they can easily be located? Is it obvious what version of a plugin they're overriding and is it done in a way that is similar to any existing overrides you have for another plugin?

If you must update the actual plugin code:
  1. Are you willing to contribute to the plugin author's github project?
  2. How will you make it absolutely clear in your application that you modified some plugin code? Can those modifications be called out in a custom plugin overrides file even if you write about them in code comments?