re: Explain Abstractions like I'm five VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Imagine you want a sunny side up egg for breakfast. Your mommy or daddy needs to make it because you're not old enough to use the stove. You say: ...
 

Going from the 5-year-old to the programmer mindset, I think it beautifully illustrates abstractions with regards to communicating with the computer. You've defined how to do something before, so now you can ust say "do X".

You can also think of it as levels of detail. For example, when talking about seasoning the eggs, it's much more appropriate to say "put some pepper and salt on the eggs", then to say "from the spice rack, take the salt shaker. Holid it above the eggs so that the surface covered in holes is facing downwards, parallel with the bottom of the pan. Make a quick upward motion with your hand, followed by a quick downward motion. Verify that some salt has actually come out of the holes and landed on the eggs. Repeat this 3 times, moving your hand slightly across the surface of the eggs to distribute the salt".

Simplifying this to "put some salt on the eggs" shortens your explanation, but also has the advantage of not specifying all of the details, making it useful in more cituations. For example, imagine your salt shaker has bigger holes. With such a shaker, it might be better to hold it slightly angled, and tap the shaker lightly to make salt come out.

When you say "put some salt and pepper on the eggs", you rely on your mother having access to a salt shaker, and knowing how to use it, so you don't have to think about those boring details yourself, you just want your eggs seasoned.

 

Yes! Abstractions on top of abstractions. Turtles all the way down. "Salt" in this case is sodium chloride, which is a molecule, and a molecule is a collection of atoms, and an atom is a collection of quarks, which are the binary code of the universe. And we don't even have to know that in order to recognize and use salt, because our senses have interpreted and abstracted it for us.

Human language itself is an abstraction. The word "salt" doesn't look or sound like actual salt. Yet we're able to use it as a signifier without confusion. Abstraction really is the basis of intelligence.

code of conduct - report abuse