The key here is p. 217. Examples and Exercises that come
before p. 217 are:
- Square Roots by Newton's Method
- Testing for Primality
- Arithmetic Operations for Rational Numbers
- Extended Excercise: Interval Arithmetic
- A Picture Language
- Symbolic Differentiation
- Representing Sets
- Huffman Encoding Trees
- Symbolic Algebra
SICP teaches algorithms and data structures before that quote. And goes on to teach more about data structures without doing any of that awful OO modeling exercises you typically do in a typical Java Programming 101.
>But there's a reason why the above passage on real-world representations appears immediately after they mention modularity.
After that quote, you return to data structures. Okay, after lists, queues and tables, there is a chapter about simulating digital circuits, which is both a fairly abstract and a well defined thing. Well, we can disagree on how abstract a digital circuit is, but at least we can agree that its no fucking dog that is_a animal and has_a head and has_a leg array and methods like
bark(int howManyTimes) {
for (int i = 0; i < howManyTimes; i++)
println("woof");
}
Using OOP to model real world stuff wouldn't be so bad if it would happen in the context of real problems, like simulations where you can show how to use the state pattern to model behavior. What I want to see gone is that stuff like inheritance and composition is explained with examples taken from the physical world, completely detached from the programming practice. If you use File, Directory and FileSystemEntry as examples for a hierarchy, you can demonstrate it's usefulness with concrete examples. With Dog, Frog and Animal, not so much.