Live data from Hacker News

CS61A: The Structure and Interpretation of Computer Programs

inst.eecs.berkeley.edu

11–20 of 39 posts

Re: CS61A: The Structure and Interpretation of Computer Programs

#11
post #4

Are there "conversions" for other languages as well? I know it's almost required reading for any software developer worth their salt, but I have several failed starts with the original version and have sworn to never have to read Lisp code. I get the gist. I get that Lisp elegantly represents the close tie between data and programs in a way that procedural programs never will, which is probably why it is chosen for t…

Were you merely reading, or were you doing the exercises as well?

SICP was my first introduction to Scheme/Lisp - and not at a young age. Once I started doing the problems, reading it became trivial.

Re: CS61A: The Structure and Interpretation of Computer Programs

#12
post #4

Are there "conversions" for other languages as well? I know it's almost required reading for any software developer worth their salt, but I have several failed starts with the original version and have sworn to never have to read Lisp code. I get the gist. I get that Lisp elegantly represents the close tie between data and programs in a way that procedural programs never will, which is probably why it is chosen for t…

In general, I would suggest that conversions to non-LISP languages (and that includes things like Ruby because people say "Ruby is my favorite LISP") makes pedagogical goals of teaching the theory difficult.

When I took my intro class in college, it was taught in Pascal. I had already been programming pascal (as taught by a chemist) in high school for a year or so. The first assignment which was Hello World I didn't even need to wake up in lectures for.

The second assignment... I didn't do quite so well. I had been using global variables and playing fast and loose with scope and passing variable parameters into procedures rather than using a function.

The thing was I already "knew" pascal and I had to unlearn what I knew before I could learn how to write pascal properly.

LISP (and Scheme and Clojure) work well in part because it always forces you to learn new concepts rather than having to unlearn what you did as a hobbiest before taking the class. The LISP family is unlikely to have been the choice language of a high schooler.

---

> But no matter how perfectly suited for the task it is, I won't squint at lines ending in ))))) to try to see that meaning.

When I took an AI class taught in LISP a few years later, the TA sent a joke email about how they had broken into some top secret code only to find it was all written in LISP. Due to the constraints of the mail system there they could only send the last {some number} characters.

))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Re: CS61A: The Structure and Interpretation of Computer Programs

#13
post #4

Are there "conversions" for other languages as well? I know it's almost required reading for any software developer worth their salt, but I have several failed starts with the original version and have sworn to never have to read Lisp code. I get the gist. I get that Lisp elegantly represents the close tie between data and programs in a way that procedural programs never will, which is probably why it is chosen for t…

But you are OK looking at this?: } } } } }

Some times it's unavoidable but I'd try to avoid it if at all possible. There is no perfect syntax. It's common, especially with some newer constructs in TS/JS/C# that you end up with lines saying })), because of a closure passed. And I consider that kind of token salad to be quite a smell too.

Re: CS61A: The Structure and Interpretation of Computer Programs

#14

Earlier quoted context omitted.

But you are OK looking at this?: } } } } }

"...if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program."

I think he's probably right for C. Unfortunately for TS/JS it's not just idiomatic it's downright unavoidable to have at least twice that number of { } levels.

Re: CS61A: The Structure and Interpretation of Computer Programs

#15
post #12
post #4

Are there "conversions" for other languages as well? I know it's almost required reading for any software developer worth their salt, but I have several failed starts with the original version and have sworn to never have to read Lisp code. I get the gist. I get that Lisp elegantly represents the close tie between data and programs in a way that procedural programs never will, which is probably why it is chosen for t…

In general, I would suggest that conversions to non-LISP languages (and that includes things like Ruby because people say "Ruby is my favorite LISP") makes pedagogical goals of teaching the theory difficult. When I took my intro class in college, it was taught in Pascal. I had already been programming pascal (as taught by a chemist) in high school for a year or so. The first assignment which was Hello World I didn't…

Oh, newbies can learn Common Lisp badly and have to unlearn. Like, oh, use this let thing rather than introducing variables with setq inside your function, and speaking of which, for proper globals use defvar.

Re: CS61A: The Structure and Interpretation of Computer Programs

#16
Just in case: use an editor with support for Scheme.

If you want something easy to install, try DrRacket.

- tab indents the current line

- cmd-I (or ctrl-I) will indent the entire buffer

- Press ] to insert a matching closer (an parenthesis, bracket or brace)

When you need it, install the `sicp` package to get the Henderson picture language (and more) used in the book.

Re: CS61A: The Structure and Interpretation of Computer Programs

#17

I couldn't make head or tails of that link but the textbook his here: https://inst.eecs.berkeley.edu/~cs61a/sp12/book/index.html Looks awesome but I still wish there was a completed clojure version.

http://composingprograms.com/ <- This is the current textbook they use for the course (per the Summer 2023 course site).

Re: CS61A: The Structure and Interpretation of Computer Programs

#18
For those interested in the original Scheme, here's that playlist of SICP lectures by the authors. I read and worked through the second edition book, but found these videos later. They added lots of value and emphasis beyond the written material. https://www.youtube.com/playlist?list=PLE18841CABEA24090

Re: CS61A: The Structure and Interpretation of Computer Programs

#19
post #12
post #4

Are there "conversions" for other languages as well? I know it's almost required reading for any software developer worth their salt, but I have several failed starts with the original version and have sworn to never have to read Lisp code. I get the gist. I get that Lisp elegantly represents the close tie between data and programs in a way that procedural programs never will, which is probably why it is chosen for t…

In general, I would suggest that conversions to non-LISP languages (and that includes things like Ruby because people say "Ruby is my favorite LISP") makes pedagogical goals of teaching the theory difficult. When I took my intro class in college, it was taught in Pascal. I had already been programming pascal (as taught by a chemist) in high school for a year or so. The first assignment which was Hello World I didn't…

Yeah that's exactly why (I imagine) the first course in programming I was taught at University was Haskell. All of us who had been programming since age 8 had to reset our brains. A fantastic strategy for a curriculum if you ask me.

Lisp/Scheme/Clojure I'm sure are elegant and great for the same reasons as Haskell. They have unique traits that work well for teaching CS concepts.

I have one single issue: the syntax. I'm not getting past it. I'm 45 years old and have coded since age 8. I have tried and failed to manage learning or reading Lisp many times. I have tried picking up clojure, reading SICP I have had to tinker with AutoCad (AutoLisp) stuff for work. I'm just accepting that I'm not going to enjoy doing anything Lisp-related to the point where I'll ever manage to usefully read SICP, or learn one Lisp-y language to the point where I'd choose it for anything. And frankly it doesn't matter. I just accept it and move on. And I also understand that I can gaze at some Typescript monstrosity with sixteen levels of curly brackets, and while it's terrible syntax, my brain accepts it. But I can only imagine that it's 30 years (or just 1, who knows!) of curly bracket coding that makes my brain able to swallow that. But I'm not ready to invest even a week or two of time in teaching my brain to accept Lisp syntax.

Re: CS61A: The Structure and Interpretation of Computer Programs

#20
post #11
post #4

Are there "conversions" for other languages as well? I know it's almost required reading for any software developer worth their salt, but I have several failed starts with the original version and have sworn to never have to read Lisp code. I get the gist. I get that Lisp elegantly represents the close tie between data and programs in a way that procedural programs never will, which is probably why it is chosen for t…

Were you merely reading, or were you doing the exercises as well? SICP was my first introduction to Scheme/Lisp - and not at a young age. Once I started doing the problems, reading it became trivial.

I was trying to read it, without being at all comfortable with the language. But I have also tried and failed multiple times to accept it by e.g. doing Clojure before that. So I wasn't entirely new to the syntax when I tried to read the book.
Post reply on HN