Well

One of the things that we – that is, developers and designers – hear more often than not is that plugins should “do one thing and do it well.”

But what does that mean?

I think that it sounds good in theory but I’m not convinced that if you were to ask each developer and/or designer separately what that means, then you’d get a variety of answers.

I think that there’s a reason that we feel this way, but I’m not really sure that we know what it even means.

For Developers

As far as developers are concerned, many of us tend to subscribe to the single responsibility principle.

Straight from Wikipedia:

In object-oriented programming, the single responsibility principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.

In WordPress – and even other languages and platforms – developers often extend this particular principle to lower-level components like functions.

After all, if each function has a single responsibility then they are easier to unit test, and if a class follows a single responsibility, then the overall understanding of the code should be improved as well its maintenance, cohesion, and the continued evolution of the software.

For Designers

I’m speaking a bit out of my wheelhouse here (so I’d love for a designer to chime in especially if I’m way off base), but there appears to be a strong effort for designers getting back to simplicity, less being more, and so on.

Dieter Rams is quoted as saying:

Less, but better – because it concentrates on the essential aspects, and the products are not burdened with non-essentials. Back to purity, back to simplicity.

In theory, it sounds easy to design for simplicity and to aim for less, but ask any high quality, professional designer and they’ll tell you that it’s a significant challenge to reduce something into it’s functionality simplicity all the while keeping it elegant.

“Do One Thing and Do It Well”

So from both a developer and a designer perspective, we have an idea as to what constitutes doing one thing well both at the microlevel – that being functions and smaller components of designer – and at the macrolevel – that being the overall software and layout, utility, or functional aspects of a product’s design.

But how do you guys determine what constitutes doing one thing?

For example:

  • Are plugins like Easy Digital Downloads and WooCommerce considered plugins that do one thing (that being commerce) or do they provide too many features involved in the selling of digital goods?
  • What about something like the WordPress Importer? It imports data, creates and/or maps it to other users, and brings in data. Those are three things each of which compose a single operation – importing. Should it technically be three separate plugins?
  • The Developer plugin, much like JetPack, serves as a front end for installing and managing a number of different plugins. Is it doing one – or many – thing(s)?

I have my thoughts on all of this, but I’m hoping to discuss it more in the comments. So, with all of that said, it’s your turn.

Category:
Articles
Tags:

Join the conversation! 4 Comments

  1. “Do one thing and do it well” is traditionally the unix paradigm. That’s why, when I want to install a text editor on Linux, it requires hundreds of packages that start with “lib”.

    With regards to WordPress plugins, I think many plugins are simply doing way too much. However, I don’t think it’s necessarily a bad thing. I think it’s only a bad thing insofar as the plugin suffers for doing too much. A couple of examples:

    Members by Justin Tadlock probably does too many things. But it does them all well.

    Ozh Richards’ YOURLS plugin (YOURLS to Twitter), for a long time, was the only competent plugin at integrating YOURLS shortlinks into WordPress, but you had to connect it with a custom Twitter App, even if you didn’t want to autotweet new posts. So Andrew Norcross wrote a new plugin that generates the shortlinks and pulls in statistics on clicks (technically, Alex King republished Ozh’s plugin without the twitter part first, but that fork wasn’t maintained). Now Andrew’s plugin is the official YOURLS plugin for WordPress.

    So sometimes plugins that do “too many things” manage to do it well anyway and be successful.

    I think the reason we have plugins that do “too much” is because of a lack of any dependency management in WordPress. It makes it very difficult to distribute plugins that depend on various pieces of functionality if they don’t package it.

    Can’t you just imagine the confusion? “What do you mean I have to install ‘lib-twitter’, ‘lib-edd-core’, ‘lib-ssl’ and ‘lib-all-your-bases-are-belong-to-the-GPL’ before I can install Easy Digital Downloads?! I thought it was supposed to be easy!”

    • You bring up some really good points and I especially dig the analogies to the *nix environment. It makes total sense.

      I still am a fan of the Single Responsibility when it comes to class design (and even function design, though I admit that I can be lazy about it).

      But I’m not no sure that you should take things all the way up to the product level. Sure, certain plugins do too much; others, on the other hand, seem to strike a balance. For example, like with the eCommerce plugins that I mentioned – they do “one thing” and that’s eCommerce, but they’re feature rich.

      Sometimes I think advanced users or developers equivocate “do one thing” with “a few features.” In some cases, I think that works; in others, not so much.

      Regardless, I really dig the analogy you provide – confusion may be an understatement ;).

  2. Well said! ‘Don One Thing but Do it well’ is a point worth mention irrespective of the segment you are. However, constant learning and evolution is also an impeccable concept that requires an important mention, especially when it comes to web designing and development. Being a web developer or designer, you should specialize in a single technology bit try to learn new things as technology my friend is dynamic in nature and shifts with time. Even I agree, a person who specializes in a single technology definitely has a sharp edge over the one who has limited knowledge of multiple platforms.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.