Let’s talk about abstractions. What is this abstraction anyway?
Abstraction (distraction) is the process of abstracting (abstracting) from certain characteristics of an object for their selective analysis; in this case, the observed object is replaced by its idealized theoretical image – an abstract object. Abstractions are a universal method of scientific knowledge, they are necessary for the formation of concepts, recognition and classification of research objects at all levels of knowledge formation.
Synonyms can be considered such words as abstract, speculative, theoretical.
The opposite word is concrete, actual.
Abstraction is when you take some complex object and remove those details that are not essential for understanding any property of this object.
Take the subway map for example. The subway map is a nice useful abstraction from the actual shape of subway tunnels. On the map there are no those bends of the tunnels that actually are. But when you arrive in some new city for yourself, you don’t look at the aerial photographs of hectares of city blocks laid out on the floor in order to understand where you need to get off the subway. It would be just ridiculous. You just look at the metro map and everything becomes clear to you right away. So is the rest.
Abstractions in software development
In the IT industry, in general, everything rests on abstractions. There are so many of them that at least stack them in stacks. Building up levels of abstraction is the main way to build software systems. They are in a hierarchy here.
Virtual memory is an abstraction from physical addresses. A virtual machine is an abstraction from a real physical machine (be it a phone, DeskTop, Server). Any programming language is a way to distract from insanely complex and boring machine codes. Every program has abstract data structures such as binary trees, queues, stacks, circular arrays, graphs, skew trees, hash tables. The file, like file systems, converts zeros and ones into convenient text files. The operating system is a way of abstracting away from specific hardware. POSIX (Portable Operating System Interface) is an example of a useful abstraction from the implementation of operating system functions. Thanks to POSIX, different operating systems have become compatible at the source code level. Hypervisors are needed to ignore how operating systems change. Bytecode is a distraction from the target platform for which the program is built. The Python language abstracts away data types. The OSI-7 model is a conditional representation of which layers data passes through on the Internet. Physical, channel, network, transport, presentation, session, application. DNS addresses are easier to remember than raw IP addresses.
In general, abstractions are very useful in programming. To develop software, it is necessary to have developed abstract thinking.
Abstractions in hardware
The fact that abstractions are very useful in programming is obvious and understandable to everyone. But the fact that abstraction is useful in hardware development has to be proved with fire and sword. Nevertheless, there are examples of good abstractions in the development of hardware.
For example, an automatic transmission abstracts from the real geometry of gear shifting – a very useful abstraction embodied in hardware. Or a stepper motor driver is a way to abstract away from how the rotation of the stepper motor shaft is actually controlled. The Verilog language abstracts from digital circuit design and describes a digital circuit as text. State machine circuits are an example of a distraction from the physical location of trigger circuits on an electronic board. The Princeton/Harvard microprocessor architecture is a speculative model for understanding the structure of a computer.
There is absolutely no abstraction in the PCB topology diagram. The PCB topology is as specific as possible. Therefore, it is always difficult to analyze the topology. A lot of distractions.
Therefore, people came up with electrical circuit diagrams. Circuitry is an abstraction from topology. However, the circuitry of modern electronic devices has also reached a high level of complexity. Circuitry in 40 … 100 pages is already generally the norm today. Therefore, people came up with block diagrams of electronic circuit boards. A block diagram is an abstraction from circuitry that operates at the 2nd level. Then I make network topology diagrams. This is at least the 3rd level of abstraction.
Follow the chain of the resulting levels:
Physics > Semiconductors > analog circuits > digital circuits > logic elements > ALU > processor > SoC > PCB > OS(system software) > Application software. At least 11 speculative levels!
Abstractions are not an invention of programmers. Abstractions appeared long before the advent of programming and electronics in general. This is a more fundamental concept. Most likely it came from art. Rock art, clumsy drawings of animals of primitive people. It all came from somewhere.
Probably abstractions appeared as a side effect of the knowledge of the world order in science. For example, the law of universal gravitation is an abstraction. Real forces are much more difficult to understand. This is proved by experiments on observing the displacement of the perihelion of Mercury. https://en.wikipedia.org/wiki/Mercury_perihelion_displacement
In the era of the Great Geographical Discoveries, the value of geographical maps appeared. A geographic map is an abstraction from the actual shape of the earth’s surface and coastline. There, the rivers are indicated by a smooth line, although in fact they meander like snakes and turn every 100-200 meters.
We always see abstractions in everyday life. Money is generally an abstraction from the type of labor activity. Whether it is the work of a bricklayer or the work of a baker.
Cartoons are a way of distracting from the actual appearance of animals.
Every self-respecting organization, company has a logo. This is a symbol that absorbs a huge number of aspects. What the company does, what its past is, where it is located, what the company’s goal is – all this is reflected in a good logo.
And out source companies are a notorious way of abstracting from hiring and the social controversy associated with it for product companies.
Do abstractions have disadvantages?
Yes. Abstraction layers take away some resources from the system. Java code runs slower than C code. Java compiler artifacts take up more disk space than C compiler artifacts. This is a price to pay for the ease of understanding and portability of programs.
What are the benefits of abstraction?
1–they help to understand complex things (the Bohr model of the atom, abstract data structures in programming, the law of universal gravitation).
2–they reduce the time to understand complex things (Metro map, electrical circuit diagrams)
3–they allow you to scale the complexity, decompose a difficult task. (automatic transmission, stepper motor driver).
4–they help to transfer objects to another coordinate system (Java programming languages, hypervisors, Docker containers)
5–They replace the complex with the simple (programming languages, file systems, DNS addresses).
6–They help avoid responsibility (out source companies, OSI-7 model)
The ability to think abstractly is a powerful evolutionary advantage. All these abstract concepts just came from the states that now constitute the central axis of the development of world civilization.
The ability to abstract helped them to build the most effective concise notation for their language of communication, drawings, mathematical expressions, and then programming languages. As a result, they gained the ability to design, develop and produce complex and efficient technical means: ships, weapons and computers.
How to learn abstract thinking since it is so useful? How to learn to come up with useful abstractions?
I don’t have a clear answer to this question. Probably should try. Further experiments will show which abstractions are viable and which are not. It’s like in physics. There was the Thomson model of the atom and the Bohr model of the atom. As a result of the experiments, it turned out that the Bohr model of the atom turned out to be more suitable for reality. Many programming languages have also sunk into oblivion. Where is Pascal, Fortran or Basic now? It’s like with programming languages. Some abstractions will exist for the time being until they are replaced by more efficient simple abstractions. And that’s okay.
Nature has no abstractions. In nature, everything is as specific as possible. Abstraction is a purely human invention. It is people who come up with abstractions and levels of abstraction for their own kind. This is understandable. The meaning of abstraction is to reduce complexity, increase the speed of understanding, explain the essence of something, whether it is a map of the mainland or an electronic board.
Create your abstractions, gentlemen. There is nothing reprehensible in this.
Examples of speculative concepts known to me I will list here https://docs.google.com/spreadsheets/d/1JxEuo7bxo2A7J5qksBxekWf3FJVuDCJbXaZKx9IvDnU/edit#gid=0
If you know examples of beautiful abstractions in technology or everyday life, please write about it in the comments.