3 ms·
The `sqrt` example seems like a bad example. Even if you have written less than 100 lines of Lisp in your life (like I have), it's pretty easy to figure out wha
by lalaithion 7y ago
The `sqrt` example seems like a bad example. Even if you have written less than 100 lines of Lisp in your life (like I have), it's pretty easy to figure out what that code does if you know what a fixed point and Newton's method are.
- kazinator 7y agoAlso, since 2008, Java and C++ have been tripping over themselves to try to accommodate coding in that style area.
- lispm 7y agoIt's actually a common criticism of the SICP book. The examples are requiring some math knowledge, since that is the example domain in many places in the book. SICP was written as teaching material for an introductory Computer Science course for university students. It's not a language manual, it's not a programming language tutorial, it's not a Scheme or Lisp book, ... Here the reader/student has to understand a new programming language (Scheme) and has to understand the example domains, which require some maths knowledge. The author here probably has more problems understanding how to write mathematical formulas/algorithms in a Functional style. Generally this is nothing Lisp specific, the same programming style could be implemented in typical Functional Programming languages like SML or OCAML. Lisp has a slightly different syntax and no static types - which can be an additional hurdle. But other than that, it's standard mathematical code in a Functional Programming language. Also the book explains it well. So the code should be understandable years later, since it uses the usual mathematical algorithms.