Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

SICP or HTDP?

Name: Anonymous 2010-03-27 11:46

A non-programmer wants to learn. Which do I show them: SICP or HTDP? Or does trying to teach them SICP in MirandaHaskell (for the syntax & pattern matching) make more sense?

Name: Anonymous 2010-03-27 13:45

>>4
Make sense. This is someone with no experience with programming at all, but she's a scientist and very good at math.

>>7
Because often the syntax makes more sense to people familiar with mathematical notation. Prefix isn't hard to learn, but (a+b) == (c*d) is still more straightforward than (= (+ a b) (* c d)).
Similarly,
sum term [] = 0
sum term x:xs = (term x) + (sum term xs)

shows the algorithm more clearly than
(define (sum term sequence)
  (if (null? sequence) 0
      (+ (term (car sequence))
         (sum term (cdr sequence)))))
.

I'm a fan of Scheme. It has some serious advantages over ML-type languages. However, in terms of being able to clearly express an algorithm to people familiar with math but not Lisp, the ML family usually wins.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List