DEV Community

Cover image for Abstraction

Abstraction

stereobooster on January 06, 2019

Developers talk about abstractions all the time. For example: The purpose of abstraction is not to be vague, but to create a new semantic level i...
Collapse
 
revskill10 profile image
Truong Hoang Dung • Edited

Here's my simple definition of "abstraction":

Abstraction is reuse.

Reuse is abstraction.

OK, they're equivalent. But what does "reuse" mean ?

Reuse means re...use.

So the process of abstraction means the process of creating something reusable !

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

I go along with Dijkstra ("to create a new semantic level in which one can be absolutely precise"). IMHO re-usability is just a (good) side-effect of abstractions.

Do you agree that the uppermost abstraction layer should represent (or use the language of) the business domain? I think this is a good approach, which comes easy when designing top-down.

Collapse
 
stereobooster profile image
stereobooster

I assume you are talking about reuse through the introduction of new entities rather than copy-paste, right? But the process of the introduction a new thing is more about symbolic thinking (the new thing is a symbol). It can be a process of abstraction (removal of details by hiding implementation) or not. If we will call all cases of reuse an abstraction it can get even more confusing.

Collapse
 
revskill10 profile image
Truong Hoang Dung • Edited

Even if you successfully remove all details / hide implementation, it's not an abstraction if it's un-reusable (per my definition)

Thread Thread
 
stereobooster profile image
stereobooster • Edited

Well, people do not always build abstraction for reuse, sometimes they do it for simplification. Example when people introduce a lot of small functions with concise names (clearly communicating the purpose of each) and then construct final thing out of it. And they can use those functions only once (e.g. no reuse). This can be referred to as an abstraction.

Thread Thread
 
revskill10 profile image
Truong Hoang Dung

I got you, but i just want to be more precise about terminology here.
Mine is more about goal-oriented definition.

In your case, i would call it just a refactoring, or simplification.

The Abstraction i mean is, in real world projects, we want to avoid copy-pasting, or DRY, that's why we want to "abstract" those repetitive pieces into only 1 piece.

Or, put more clearly, if you find yourself duplicate your code in two places that're almost the same, "abstract" it !

Collapse
 
stereobooster profile image
stereobooster • Edited

I don't see any trolling here.

Abstraction in art is essentially the same process as I described for CS. It is about removing details.

Image from "Understanding Comics: The Invisible Art" by Scott McCloud.

Collapse
 
jenc profile image
Jen Chan

Abstract art by European modernists like Joseph Albers and Piet Mondrian we're insanely mathy and rule based. Basically an exercise in seeing how far you could divide and routinely paint a grid. I wouldn't want to be them.

Abstract expressionism like Jackson Pollock was all about expressing what he thought was freedom, chance and randomness.
Both are dubbed "abstract" but operate on different implementations lol.

Living artist with no painting skills just has to pitch in. Comment irrelevant but tangentially relevant, on some abstract plane.

 
swfisher profile image
Sam Fisher

Say that we ignore certain aspects of the hyponyms, such as all the cat-specific and dog-specific qualities, when creating the hyperonym. If there were no such qualities to ignore, we could just say we had two dogs.

So the idea that some detail is removed is intrinsic to the process of abstracting when using Alekseiโ€™s idea of what abstraction is.

Collapse
 
swfisher profile image
Sam Fisher

Abstraction is an artifact of the process of details removal- yes.

Abstraction is also an artifact of the process of pattern recognition, or the surfacing of meaningful groupings.

One defines in terms of what itโ€™s removes and one defines in terms of what it surfaces.

What is the artifact, by the way? Just a useful name for something.

It seems similar to how neuronal clustering fuses groupings of information together into neighborhoods, highways, maps, etc.

Thank you for writing about this stuff stereobooster! Iโ€™m glad youโ€™re out here focusing on the abstract stuff.

Collapse
 
jenc profile image
Jen Chan

Thank you for this overview of computational (?) abstraction-thinking. I'm halfway through and will return to add my thoughts. I enjoyed your tracing of the etymology. ๐Ÿค” (thinking abstract thoughts.)