|
|
|
|
|
by microtonal
5433 days ago
|
|
A computer is an imperative device. It is a deterministic state machine. Teaching introductory programming with a functional language is teaching students wrong, i.e. it does them a disservice. One could as easily argue that a computer is a tool, and if it helps us making better (according to some criteria) programs, why not abstract away the underlying architecture? |
|
Because it would not be an abstraction of what is there. It would be the creation of an abstraction of something that isnt there: i.e. a simulation. And indeed, this is exactly the cause of my complaint.
Its like you have a machine that deals with squares. You're suggestion is to "abstract" the system into shapes, but then build a system using circles. A shape is an abstraction of both squares and circles. But a circle is not a square, and squares are what you have. FP languages and Imperative Languages are both specializations of the "programming language". But FP is not a generalization of IP. The computer is an IP machine.
When reading SICP there were several places where I had an uneasy feeling. Something was wrong and I didn't immediately know why. Then it clicked: I'm being asked to make rectilinear geometry out of circles. First time students aren't going to make it past the confusion.
And finally, if we're abstracting away the underlying architecture, why the focus on tail-recursion (an optimization), iteration vs recursion (an optimization), memoization (an optimization)... The complaint of the original article is that the alternative books are "How To Program In Language X", instead of "How to Program". However, SICP is most definitely "How to Program in Scheme".