Questions about abstraction

Quick question. I’ve been reading up on abstraction and think i may understand or at least partially so. Wanted to give a quick example and run it by y’all and see if i’m on the correct path.

Abstraction is my understanding that if (A = max occupancy of a building) that tells me how many people are in the building. I don’t have to understand or at least clarify the steps needed to calculate how many people are in a building. I can just know what (A) does and use that to more simply write my code or design the structure of a program.

For Example: if I know that (a) = max occupancy of a building. I am able to abstractly understand that (A) calculates: rooms in building * max occupancy per room = max occupancy of building. Abstraction allows me to simply use (A) to get the desired end result.

So by using abstraction to find the sum of the max occupancy for two buildings I am simply using A+A in my code because that is implied and understood that i’m saying at a higher level (( rooms in building * max occupancy per room = max occupancy of building + rooms in building * max occupancy per room = max occupancy of building) = A+A)

Am I anywhere close to the mark? If so than my using a library is an example of abstraction. By using MATH for example, i’m able to do everything involved in the MATH library without actually having to sit down and write out the entire library then start doing calculations. I can just call MATH and use it immediately whether I understand the details and such. This saves me time allows me to make bigger and better programs in less time versus building every library every single time.

Thanks in advance for any help/advice/criticism. I’ve read through quite a bit but everything has been super technical so its tricky getting a mental picture in my head of what abstraction is. Hard finding a real “for dummies” explanation.

If you don’t mind sharing, what are you reading?

Happy to share, was reading through q/a’s on stack overflow and Quora. Read the Wikipedia article on it and then a bunch of random googled articles that looked relevant. Nothing terribly scientific.

the word “abstraction” has actually been stolen by programming to mean something totally different than what it actually means. You can blame Java for this, as they took it to mean “indirection”. A real abstraction should simplify the thing that your working with. So if I had an abstraction over a set of other classes, then that abstraction should have a smaller number of functions to make it work. Instead, Java takes an abstraction and simply replicates all of the functions that are in the class it attempts to “abstract”. What this means is, for better or worse, the word abstraction is actually a way of saying I can use this thing indirectly. So when you are giving a function in abstract type, the function parameter can pretend it is working with one type, and then actually be using something totally different, so long as the real object implements the abstract interface.

The thing is in Python you don’t need any of this. Because Python doesn’t really have strict protocols on class implementation, or on types, you can basically just take the class you want a target function to use make an instance of it and pass it to that function. In fact I think most of the object oriented languages follow this pattern rather than having strict types.

I Appreciate the response!