What is abstraction? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is abstraction?

Give a example as well..

9th Jun 2019, 10:22 AM
AJIT SRÌVÁSTÄVÅ
AJIT SRÌVÁSTÄVÅ - avatar
4 Answers
+ 7
Abstraction is when you sum up code and reduce it to its essence, to make it simpler. Instead of having to write billions of 0 and 1, you have assembler commands that sum up a few things that come up over and over. Languages like C reduce this still annoying procedure to something that resembles English somewhat and allows you to use human logic with stuff like loops, conditions and functions. Also you have types. If you put a number into an int, it will come out as a number, if you put it into a char, it will be interpreted as a letter. In object-oriented languages, you can bundle up functions and data to something that behaves like a thing in real life: Although there's a lot of stuff going on in the background, Python's lists feel like boxes where you can put stuff into, take it out, sort it... Also most of the stuff that can be messy about C types, like that numbers are of a limited size, is coded away for you: Numbers can go as high as you want, you don't even have to know how. Get a feeling yet?
9th Jun 2019, 10:55 AM
HonFu
HonFu - avatar
+ 7
9th Jun 2019, 11:10 AM
A͢J
A͢J - avatar
+ 4
Abstraction is when you buy a steak instead of making it yourself from grass with chemisty. It's when you use a gas pedal in a car instead of blowing air into the engine. It's when you use a watch with an hour and minute arm instead of counting how often the pendulum swings.
9th Jun 2019, 1:07 PM
Schindlabua
Schindlabua - avatar
0
Very helpful 👍
2nd Nov 2020, 5:57 PM
Ananya Bangera
Ananya Bangera - avatar