Abstraction
- The book Abstraction: A mental model that removes complex details.
- I might remove mental.
- I don't think I like "complex" either.
- The book points out Miller's Law:
- The implication is that we can not deal with all of the facts of a given item at one time.
- So we are exceptionally good at abstraction.
- We only pay attention to the important details and group everything else together.
- When you are playing a game on your phone
- Are you concerned about anything about the phone but the items you use for interaction.
- And even then, are you concerned about how a touch screen works, or just where to touch on the screen.
- Pop up an on screen calculator
- Do those buttons really exist?
- You are using an abstraction.
- There are many details about where on the screen the button was pressed, which button was pressed, what programs were active at the time, ...
- Think about cities in games
- In some high level strategic games, a city might be just a supply point. You might have few or no details other than it exists.
- (Board Game Geek, Axis and Allies)
- In a tactical game, a city could be roads and buildings.
- (Board Game Geek, Advanced Squad Leader)
- In a simulation, like simcity, it is a large number of details such as roads, buildings, infrastructure, ...
-
- But even here, we use abstractions.
- We build a School, we don't worry about the bricks, tiles, teachers or students, we just have a building.
- A major skill in life is dealing with abstractions.
- We focus on the details that are important and remove those that are not.
- When you drive, do you worry about
- How the engine works?
- How the roads are constructed?
- All of the traffic laws?
- All of the laws of physics?
- All of the other cars on the road?
- A major skill in computer science is producing the correct abstraction.
- Closely related to abstraction is information hiding.
- Information Hiding: A technique for isolating programs pieces by eliminating the ability for one piece to access information in another.
- Semi Example: a seal on the back of a keyboard or device.
- You don't need to know how the keyboard works.
- So they are "hiding" the implementation from you by making it difficult to get to.
- Information hiding enforces abstraction.