3 ms·
That something is the wrong abstraction is something you can only know after the fact, at the time you build the abstraction it is - or at least it should be -
by danbruc 3y ago
That something is the wrong abstraction is something you can only know after the fact, at the time you build the abstraction it is - or at least it should be - a reasonable choice. And later on as the code evolves there are two possible outcomes, the abstraction remains a good choice or the abstraction stops being a good choice and you have to change it. Maybe it can be saved with some refactoring, maybe at has to go completely.
But at the very least you had a working abstraction for some time and you can easily figure out all the places where this functionality is used and you have a single place to make changes when you have to make them instead of having to hunt down all the different places with slightly different implementations. Even if an abstraction breaks completely down and has to be split up into several implementations, each of those will usually have several usages which would all still be repetitions without the abstraction.