ABSTRACT

Structural Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 19.5 End of Chapter Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492

19.5.1 Summary of Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 19.5.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 19.5.3 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493

Understanding the concept of abstraction is critical for improving your capabilities as a programmer. The ability to express our thoughts in more abstract ways is a significant part of what has allowed modern software systems to scale to the size they are today. We have dealt a little with abstraction already. Back in section 6.4 we saw how we could pass a function as an argument to allow us to accumulate multiple different types of values using a single recursive function. The basic idea of abstraction is that you want to write code where some part of what it does is not fully specified until it is used. We have used this idea significantly through the different methods in the Application Programming Interface (API). At this point it is time to explore the different mechanisms that allow us to create abstraction and write some code that uses them.