Jonathan Bennett

My Attempt to Define Abstraction

Listening to the code with jason podcast with Joel Drapper and Jason asked for a definition of abstraction. Here is my attempt:

Abstraction in composed of two things:

  1. Elimintation/hiding of elements that are not required for communication/understanding
  2. Communicating in a way and level that is appropriate for the remaining elements

Joel used the example of “clean your room”. He did two things with this, he removed a million elements that are required but not core to the overall task (put away socks, make the bed, …) and he communicated at higher level, the overall goal of the room being clean, not the specific body movements needed (open hand, grab sock, close hand).

A code example would be “Clone me FaceBook, but for my dog” vs “Type ‘d’, ‘e’, ‘f’, ‘space’.”

Joel used the word “summarize” which I would probably nit-pick over. It’s often true but with abstraction the idea can often be communicated differently, which is where significant benefit can come into play.

One note on the eliminated elements. By providing a higher level, outcome oriented explination, it can change how we do the eliminated tasks. Collecting the socks and piling them on the desk would result in “cleaned up socks”, but it doesn’t move (much) towards the overall goal of a clean room.