The abstraction is either good or it isn't. Some stuff just does not abstract well. A function or an API is not necessarily "an abstraction".
The abstraction is either good or it isn't. Some stuff just does not abstract well. A function or an API is not necessarily "an abstraction".
Since there are many ways to abstract the same concepts, splitting them into two categories (good, bad) where all the good abstractions are equally good and all the bad abstractions are equally bad seems an unrealistic and impractical way of looking at things.
To a degree, yes. But they're not always introduced for that reason. There are cases, where the caller is expected to fully understand the implementation of a function, yet it may still provide value, for example, by:
- ...reducing the mental demand for understanding the calling code by making it easier to visually scan.
- ...reducing the mental demand for understanding the called code by narrowing the scope of the logic through parameters / encapsulation / etc...
- ...preventing repetition by being callable from multiple places