Thursday, October 2, 2008

sicp-section-1.3

Section 1.3 shows the power of lisp to build abstractions, by using procedures as arguments and returned values.

Impressive words:
"Our programs would be able to compute cubes, but our language would lack the ability to express the concept of cubing."

"Notice how this formulation makes explicit the three ideas in the method." To me, it's somewhat a shock to see such elegant abstractions :), but it needs time and more experience for me to appreciate it.

This is not to say that one should always write programs in the most abstract way possible; expert programmers know how to choose the level of abstraction appropriate to their task. But it is important to be able to think in terms of these abstractions, so that we can be ready to apply them in new contexts.

... There should be many more.

=======
So I have finished Chapter One. The first paragraph of Chapter Two is a good summary of the previous chapter. I choose not to write my own summary right now.

We concentrated in chapter 1 on computational processes and on the role of procedures in program design.

We saw how to use primitive data (numbers) and primitive operations (arithmetic operations), how to combine procedures to form compound procedures through composition, conditionals, and the use of parameters, and how to abstract procedures by using define.

We saw that a procedure can be regarded as a pattern for the local evolution of a process, and we classified, reasoned about, and performed simple algorithmic analysis of some common patterns for processes as embodied in procedures.

We also saw that higher-order procedures enhance the power of our language by enabling us to manipulate, and thereby to reason in terms of, general methods of computation.


This is much of the essence of programming.