[Originally written on February 28, 2020]
Dear Eri,
Greetings! How do you do today?
“Registration” Think of what exactly happens when you register a thing. It involves three steps: accepting submitted information, recording it, and storing it. Three steps described in one word. If I say “grooming kit”, what do you imagine? List all the items in your bag? Baby powder? Lipstick? Face powder? Mascara? Hand sanitiser? The list may never end and may vary person to person.
You see, describing multiple things in one word is a timeless technique called abstraction. See how one word is jam-packed with ideas? If I say “Shopping Mall” or “Winemaking”, sensations will gush into your mind; bonus if your imagination is vivid. Abstraction is derived from the Latin word “abstrahere” which means “to draw or pull away”. Drawing a pack of things requires a handle or something to hold on, which is your one word (or phrase) to describe a cohesive collection of things such as a “music band” or brewing a coffee.
Take note that things can be contained in a word, phrase, or a sentence. You might be asking “What is ‘abstraction’ in software development”? If you remember what I taught you about IPO, you can abstract the example I gave you in one phrase: “Temperature Conversion”. Since whitespaces are not available when naming a variable or a user-defined function, name it as “convertCelsiusToFahrenheit” or whatever perfectly describes the function. Abstraction will be your bread and butter when it comes to writing software. Most things are abstractions of abstractions. One word like a function name describes a series of steps… and those steps are called function calls which also describes a series of steps… the deeper you go, the higher your mental energy depletes. Not intrinsic to OOP, but you’ll do this mostly when you do OOP. Abstractions, when done right, make a beautiful readable code.
Let’s go back to “Registration”; as an exercise, see that “accepting”, “recording”, and “storing” are abstractions abstracted by “registration”. Let’s start with “accepting”, the steps to accept the thing is to receive it, validate it, and let it in. Well then, how do you record a thing? Vinyl? Paper? Photograph? Neural implants? There’s so many ways, but choose what suits your requirements. The data from “accepting” is used by “recording” then by “storing”. Grab a pen and paper and list all the logical steps to “accept”, “record”, and “store”. I expect that you’ll draw a “tree” or a “ramifactive” image. Align all the items by their “level” as you write them. After exhausting your imagination, please explain what “Layers of Abstraction” is, strictly from your experience from the exercise. No references other than your mind and memories. How many layers will you make?
Cheers,
Haytham Merger
No comments:
Post a Comment