Abstraction At The Core of Computer Science

Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

Abstraction At The Core of Computer Science

  • Comments 6

I spent the latter part of last week in Palo Alto, California working on the CS 2013 project. There are some pretty amazing people involved in this project (CS 2013 steering committee) and I learned a lot in the various discussions we had around computer science curriculum. Since we are talking about what absolutely positively much be part of undergraduate computer science curriculum it is not surprising that core concepts are an important part of the discussions. One statement that was made was that “abstraction is at the core of computer science.” This is quite true of course but it struck me that maybe we don’t talk enough about this early enough in high school computer science courses. It is an important vocabulary word but do we really talk about what it means at a deep level? Sometimes perhaps but always? Not so sure. I’m pretty sure I never spent enough time on it.

What do we mean by abstraction? There are some interesting definitions floating around that can be used for starters.

Making all of this clear to students can be tricky especially when we introduce abstract classes. So what is the simple version? I see abstraction as using symbols to represent real things. In other words, we model the real world using data (numbers mostly but also images and words) so that we can manipulate them  using the computer. We can’t generate real wind or real buildings in a computer to see how buildings react to different speeds of wind but we can model the effects. Push buttons on the screen don’t actually depress but we can model that behavior by using the right abstractions. Abstraction is a tool for acting on imaginary objects that represent real things.

In a sense object oriented programming and graphical user interface programming both simplifies and complicates our discussion of abstraction. On one hand the GUI objects make it easy to model real work objects of specific types. At the same time, for some students, it makes it harder to understand models or abstractions of items that are not visible on the screen. Personally I find that properties, as implemented nicely in C# and Visual Basic, do help to picture the abstraction – the way the software object represents the physical object it models – of various real world objects. Your mileage as they say may vary of course. The fact that objects have properties and methods is what enables us to model real world objects. At the same time making the transition from physical objects to numbers that somehow represent those objects does not come naturally for everyone. It is important however that they do make the transition. This is at the heart of how computer science works.

I’m trying to work out in my mind how to involved abstraction both earlier and more consistently into a first programming course. My gut tells me that in the long run that would make understanding more of the concepts easier. Do any of you out there have particularly good discussion points, resources or lessons learned about teaching abstraction to share? Any textbook that does an especially good job of it? Or perhaps an operational definition that you find works for you and students?

Abstraction is a core concept in computer science. On the other hand it is a bit abstract for some students. (Sort of pun intended.)

  • Unfortunately, I think there are two concepts behind your use of the term "abstraction" 1. abstraction is a way of ignoring certain aspects of the real world making it possible for us to make generalizations and reason about them 2. abstraction in computer programming is a way of representing the state of the machine in such a way that we can manipulate the flow of data through the machine. I would agree that they are both important but in very different ways and you will end up compromising both if you don't clearly distinguish them. I believe that much of the difficulty students have in dealing with computer science is precisely the lack of such a distinction. I put together and taught a K9-12 curriculum that was largely based on this assumption - it went across very well.

  • Patrick, you are right I think. There is a lot more to the idea of abstraction than fits in a short blog post. I probably do need to do a lot more thinking about how to present the various aspects of abstraction. I would love to know more about the curriculum that you put together. Is it available somewhere?

  • "Code" by Charles Petzold.

    Read the first chapter using "Look Inside" at Amazon - will more than convince you how aptly his book does this for the laymen or junior undergrad.


  • Acutally, its more of a riddle then a pun.

  • My daughters are 3 & 6, and they constantly remind me how much information I take for granted.  I have found that letting them physically hold an object when we discuss abstraction techniques, goes a long way towards understanding EVEN when it doesn't really relate.  I think their minds are allowed to try/fail (iterate) through methods faster when they have the physical feedback loop.  For example one day I realized they didn't know how to "click" or "double click" on the "start" button (when they were first using a laptop pc).  I took them away from the pc & we talked about electrical signals again (my BS is EE) and grabbed one of their toys that has a button on it, then talked about cause/effect.  They were 1 & 3 then so the lesson didn't last long, but we repeated it daily & when they came back to the pc they had so much more background info which made moving forward easier.

  • There are two ways to introduce the concept of abstraction early on, so that people get it: one is to use the animal kingdom: Creature -> Mammal -> Simian -> Human -> Woman, for example, where everything before Woman is an abstraction (!) -- the other is to use food: Food -> Carbohydrate -> Processed Carbohydrate -> Bread; the food example is harder, because there are plenty of different hierarchies you can impose, each of which involves a lot of replication in its lower branches (unless you use C++); fortunately, the animal kingdom is already really well organized into its abstract classes by the Victorians (phylum/genus/family/ ...). You can use a microcosm of each: start with "Person" or "Fruit" for simpler examples...

Page 1 of 1 (6 items)