Writing reusable code for the sake of reuse is a bad idea for the following reasons:

  1. It leads to far more complicated code. Specific code is simple, all code necessary is closer and simpler to understand.
  2. Most often we don’t know all the cases we need to handle. As we keep adding more cases, the code becomes more and more complicated.
  3. Generic code is many times, harder to write, understand and maintain.

Reusable code must always have a purpose. Following are some reasons:

  1. Make code or UI more consistent. We don’t want the same thing to be represented differently in different places.
  2. After writing lots of specific code, we realize that we need to handle a lot of cases in a similar way. We can then extract the common code and make it reusable.
  3. We don’t want to update the same code in multiple places every time. We can extract the common code and make it reusable.
  4. Good set of reusable abstractions can allow you to write code in a declarative way making your code easier to understand.

In essence, write specific code. Find abstractions. Create well defined abstractions. Write code in these abstractions in a declarative fashion.