3 ms·
This is really interesting! Encapsulation might be a more appropriate word in most cases, since abstraction doesn't tell you what specifically you're abstracti
by eternityforest 5y ago
This is really interesting!
Encapsulation might be a more appropriate word in most cases, since abstraction doesn't tell you what specifically you're abstracting away from.
Coming from OOP, I've always thought of abstraction as just "A thing that hides the real nature of something and presents it as a standard and simplified model, and lets you ignore more things than the non-abstract truth allows".
drawImage(file, x, y) is an abstraction, because I don't need to know how it works or how it knows what decoder to use.
One might even say a toilet is an abstraction because what goes into it is(Presumably) dealt with in a sanitary manner by professionals.
Things like monads and composition are abstractions in the colloquial sense, objects far from some concrete thing like a car or a pen, but using them effectively requires understanding the logic, so in a sense they are leaky, because the act of using them "leaks" the mathematical logic, and subjectively nothing like that comes to mind when I think of abstractions in programming.
They're definitely abstractions, but they are used to reveal and illuminate a program's structure, not to hide it in a black box.
- reidjs 5y ago> They're definitely abstractions, but they are used to reveal and illuminate a program's structure, not to hide it in a black box. In my mind, abstractions are used to reveal the program's interface and intent more than its structure. The functions, data structures, variables, and ultimately the source code reveal the program's true structure.