Live data from Hacker News

Why SICP Matters

cs.berkeley.edu

41–50 of 130 posts

Re: Why SICP Matters

#41
post #39
post #18

Earlier quoted context omitted.

Pedagogically speaking, I think this is backwards. SICP isn't a course in functional programming; it's a course in programming. And the use of Scheme is critical, because it doesn't waste time on nonsense like classes and structs and other ephemera -- you just jump right into the conversation with the computer.

When I went to Berkeley, those with no programming experience were encouraged to take CS 3 (Simply Scheme) before taking CS 61A (SICP).

At Chicago in 1990, there were two intro classes; if you wanted to study CS (a math major at the time), you took 115/116, which were basically 6.001.

Re: Why SICP Matters

#42
post #18
post #6

But an average student might need the exposure to other "common" paradigms from C, Python, or Java, before getting introduced to SICP, to "fully appreciate" the power of functional language.

Pedagogically speaking, I think this is backwards. SICP isn't a course in functional programming; it's a course in programming. And the use of Scheme is critical, because it doesn't waste time on nonsense like classes and structs and other ephemera -- you just jump right into the conversation with the computer.

it's not a course in programming. it's about problem solving and critical thinking. programming is just the means to achieve it.

Re: Why SICP Matters

#43

Earlier quoted context omitted.

> I have only skimmed so far For the mind-blowing effect to occur, you must actually do the exercises. (-:

Yes, agreed, if you are reading this book, don't skip the exercises! You might need to refresh some math skills (just a bit), but it is worth it.

I was just going to post that they are on my agenda. I have actually toyed with the thought of putting together a "book club" to go through them. I will probably have to put this off till the Fall, though.

Re: Why SICP Matters

#44
post #18
post #6

But an average student might need the exposure to other "common" paradigms from C, Python, or Java, before getting introduced to SICP, to "fully appreciate" the power of functional language.

Pedagogically speaking, I think this is backwards. SICP isn't a course in functional programming; it's a course in programming. And the use of Scheme is critical, because it doesn't waste time on nonsense like classes and structs and other ephemera -- you just jump right into the conversation with the computer.

agree-that is what is so good about SICP.

Re: Why SICP Matters

#45
post #35

Earlier quoted context omitted.

"Scheme has a lot of parenthesis that makes it look very old fashion." Might I argue that this is a huge advantage? No one knows scheme, and it's very obscure, and looks nothing like other programming languages. This means that you can teach concepts using it and pre-judgements about the language don't get in the way. Then, I suppose the same could be said of CAML and its obscurity.

Which one is obscure ? define factorial (lambda (n) (if (= n 0) 1 (* n (factorial (- n 1)))))) let rec fact = function | 0 -> 1 | n -> n * fact (n - 1);; There is a little more syntax to learn in caml, but the suppression of 90% of the parenthesis makes the code far easier to read.

With syntax hilighting and proper indenting, the Scheme code is pretty easy to read:

http://img1.imagilive.com/0413/scheme-fact.png

You could even simplify it a little by getting rid of the lambda:

http://img1.imagilive.com/0413/scheme-fact2.png

In any case, I find toy examples like this less than convincing. In real-world programs, issues of style, design, and documentation usually trump most anything else, as far as clarity is concerned.

Also, I personally find the penchant for one-letter variable names in the OCaml/SML/Haskell world to be very confusing and obfuscating.

The Scheme way is to be more verbose and explicit. For me, that results in much greater clarity -- especially when looking at unfamiliar code or code that you've stepped away from for a few months.

Of course, there also such a thing as being too verbose and explicit. But for me, Scheme is in the sweet spot between verbosity and terseness.

Re: Why SICP Matters

#46
I am revisiting SICP at the moment, because a friend uses it to learn programming. But I have to say, I am not nearly as impressed with the book as I used to be. Wadler's critique "Why calculating is better than scheming" (http://www.cs.kent.ac.uk/people/staff/dat/miranda/wadler87.p...) fully applies, and the book can be rather confused and ad-hoc in some places, e.g. section 1.3. A stronger focus on data structures would have been useful, instead of ad hoc recursion schemes, like version of `accumulate', `sum' and `product' they make you write in the exercises in that section, which are essentially unfoldr and foldr rolled into one---and would be better written as a composition of those functions.

`How to design programmes' (http://www.htdp.org/) leaves a better impression as a beginners' book for me.

If you can already programme then "Programming Languages: Application and Interpretation" (http://cs.brown.edu/courses/cs173/2012/book/) is a great follow-up.

Re: Why SICP Matters

#47
post #28
post #2

When I was student, my school has decided to stop using Ada as teaching language. They were hesitating between CAML Light and Scheme. They asked me my feeling because I was one of the rare student to know well both of them. I like both of them, but I choose CAML Light. Scheme has a lot of parenthesis that makes it look very old fashion. Scheme type system was also outdated. Programming in CAML Light was more fun for…

Dynamic typing is outdated?!

Yes, since at least 80s or so. Languages based on Hindley-Milner type system (https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner) are static and nice to work with. E.g. OCaml or Haskell.

I have some professional experience in rewriting Python and Ruby programmes in Haskell. I make the same amount of stupid mistakes in Python as in Haskell. But whereas Python blows up at runtime / test time, in Haskell it's the compiler yelling at me. The nice thing: that's much faster to detect, and also saves me writing about half the tests.

Don't get me wrong, dynamic typing beats inane static typing like C's or Java's. But good static typing beats dynamic typing.

Re: Why SICP Matters

#48
For those turned off by its mathiness, one of the coauthors explained, "There’s a tremendous amount [of math] in this 6.001 book. That’s partly because we were writing it for MIT. You want to talk about higher-order procedures, so the obvious thing you can do is you can express the idea of an integral. So that’s an obstacle for lots of places. Remember, at MIT the context we were writing in is every person who took the course had just had a semester of calculus."

http://www.codequarterly.com/2011/hal-abelson/

Re: Why SICP Matters

#49
post #14

Universities are communities of people from very different sub-disciplines, with every person considering their own sub-discipline or course the most important one, and as a result the curriculum is diluted and hurried to please the greatest amount of people. It might have its benefits, but if training great computer scientists is really the goal, I think it is a bit of a pity you cannot go to a place where you could…

Actually, you can do something really close. The trick is to study mathematics and specialize from there, e.g. in algorithms or mathematical optimization.

Re: Why SICP Matters

#50
post #47
post #28

Earlier quoted context omitted.

Dynamic typing is outdated?!

Yes, since at least 80s or so. Languages based on Hindley-Milner type system ( https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner ) are static and nice to work with. E.g. OCaml or Haskell. I have some professional experience in rewriting Python and Ruby programmes in Haskell. I make the same amount of stupid mistakes in Python as in Haskell. But whereas Python blows up at runtime / test time, in Haskell it's the co…

I have experience with OCaml, and I don't find its static typing to be nice to work with at all.

I like the final result of safety, and how whole classes of bugs are excluded once I get my OCaml program to compile. But the process of getting my program to compile in the first place is pretty painful and not fun.

Then again, writing endless unit tests in a dynamically typed language like Scheme is not much fun either. But I don't have to write the unit tests until I've written some functional portion of my program (or even the whole thing) and am satisfied with its design and how it works. Then I could add unit tests or even rewrite it in a safe language like OCaml, if I wanted to.

As I said elsewhere in this thread, for fast prototyping and sheer pleasure of programming, I find Scheme very hard to beat.

Post reply on HN