Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

QaFoo Blog:
When to Abstract?
May 18, 2016 @ 10:12:18

On the QaFoo blog they've posted an article that shares some of their thoughts on "when to abstract" in your code - essentially finding that point where abstracting out functionality makes sense.

One of the most difficult challenges in a developers life is finding the "right" abstraction, or at least the best one given the current circumstances. The core problem is that abstraction is a bet on the future development of the software and we know that future is volatile. The circumstances will change, so will the view on the best abstraction change.

But there is another dimension which influences this decision: What kind of software are you developing?

They start off by defining three different types of projects (internal, library and adaptable) and move into how this type changes when/how you abstract things in your code. They give a brief summary for each type and when it usually makes sense, including steps to take (concrete first, then abstract).

tagged: abstract code library internal adaptable type opinion concrete

Link: https://qafoo.com/blog/084_when_to_abstract.html