26 ms·
SICP is Under Attack
- atdt 15y agoThere is a rather breathless presumption that underlies many of the comments to this article, and it is this: that the only way to learn anything thoroughly is to learn it from the inside out: to start from first principles and gradually pile up complexity and abstraction. There is something very compelling about this approach, probably because it purports to model the mind after nature. Just like complex phenomena in nature is built up of smaller, fundamental particles, so too understanding will be built up from atomic units. But stop and think for a moment: how many things in life are really learned that way? Isn't it more often the case that you hack around and only later come to understand what it was that you were doing? I think the fact that it is so intuitively compelling disguises the fact that this conception of learning is really quite bizarre and implausible.
- jeffdavis 15y agoAgreed. I also think that bottom-up learning might lead to a false sense of completeness, a sort of "now I know everything". But in reality, there is always some other perspective that will really improve understanding. That being said, I think learning fundamentals is very valuable, of course.
- agentultra 15y agoWe learn mathematics from the most basic principles and upwards. I don't think there is a way that you could start with higher level concepts and figure out the theory later. It would be incredibly confusing. Programming is quite different of course. It's not terribly difficult to write a simple program to keep a database of your puzzle collection or build a website to share your puppy photos. One could start from such humble beginnings and build ever-more clever programs and have a steady career doing so. Computers are just machines after all. But I don't think that's what computer science is really about. IMO it's the study of the nature of computation. Given it's theoretical nature it only makes sense to me that one would start with small foundational concepts and work their way up the ladder as one does in mathematics.
- jeffdavis 15y ago"We learn mathematics from the most basic principles and upwards." Interesting point, although I'm not sure it's 100% true. For instance, we learn mathematical skills that are readily applicable to life at an early age. Solving a word problem might be the mathematical equivalent of writing a working program that actually does something. And we memorize "formulas", like the simple one to multiply large numbers, at an early age, but don't learn why it works for quite a while. Induction and abstract algebras might be considered more fundamental, but are introduced much later.
- gswang 15y agoWhoa, stop. There's a lot of issues in this article. First of all, Berkeley is NOT getting rid of SICP and SICP ideas. This is flat out untrue. I'm a recent instructor for the course, and I've spoken to several TA's about this course. Below is a rough summary of what we've discussed. This should not be construed as the "official line", but take from it what you will. First, Berkeley are not getting rid of SICP. For those who aren't aware, they (the future TA's/instructors) are making lecture notes based on SICP but using Python 3). From a TA: At the end of the day most of the reason for moving to Python (beyond the weak argument that it's a bigger community), is that there was a meeting where they realized that nobody wanted to teach the course in Scheme after Brian retires. I'm not burning him at the stake, I read his argument and I've considered it. All I'm saying is that he has bad information. Also, lambda is cool but the only difference between that and defining a function inside the body of another function is the requirement of a name. I know lambda's amazing and it's not nearly as magical when you do it in Python, but Python supports proper closures which is the real reason lambda in Scheme is so powerful. A different TA: But the real reason it's not being taught in Scheme? My understanding is that it's not being taught is because no professor wants to teach it in Scheme. Secondly, we talked about some concerns about whether SICP is actually a good INTRODUCTION. I don't think we dispute that there's a huge value in the course, but whether it's good for an introduction is I think, debatable I do know that when I was a student, I raised many of these same concerns and frankly, I dont think those concerns are invalid. I think that until you have an appreciation for mathematical elegance and REALLY REALLY understand SICP, which appears to only be true for less than half of the students, much of it is lost. I know that was the case when I took the class, at least. Should clarify. I'm not saying that 50% of the class "doesn't get it", but there's a deeper level that I think is hard to grasp for people who either don't spend 40 hours a week on this, or don't have a mathematical background. Good example: Data directed programming. Me as a student was: WTF is this? So I always just call this 'get-data' function? What's the point? Where's the application? The examples in Scheme are often /SO SIMPLE/ that exercises seem like they are dumb. They often look like a point docking trap in exams to students. In my mind, SICP is better as a capstone, senior course. Think about all of us who defend it. Do we think that we could reach a better audience with that message if the audience were seniors looking for a summary/enlightenment, rather than freshmen exploring CS and engineering applications? Here's an interesting direction to take SICP: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-945-adventures-in-advanced-symbolic-programming-spring-2009/ http://ocw.mit.edu/courses/electrical-engineering-and-comp... Correct me if I'm mistaken, but my understanding is that this is essentially SICP if they were to teach a graduate-version of the course. This looked /insanely/ cool. In any case, for future TAs and Instructors of this course: It is now up to you to make sure the spirit of SICP and CS education lives on! Not that it's been any different since the beginning of time.
- jpdoctor 15y agoGood god. I took Sussman's course when SICP was still in the notes phase. I never would have predicted that it would have such a following almost 30 years later.
- gonewest818 15y agoAgreed. I took Sussman's course in '87 with a $30 used copy of SICP which still sits on my shelf, surviving many other books that have long since faded into obsolescence. From the preface: "Our design of this introductory computer-science subject reflects two major concerns. First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Second, we believe that the essential material to be addressed by a subject at this level is not the syntax of particular programming-language constructs, nor clever algorithms for computing particular functions efficiently, not even the mathematical analysis of algorithms and the foundations of computing, but rather the techniques used to control the intellectual complexity of large software systems." Classic.
- deleted 15y ago[deleted]
- dsmith_hacker 15y agoDamn, I feel like I'm really missing out having only been through a community college for CS. This is exactly what I need. I don't know if anyone else posted this already... SICP full-text online: http://mitpress.mit.edu/sicp/ http://mitpress.mit.edu/sicp/
- puredanger 15y agoYou might find this recent interview with Abelson to be interesting, esp with respect to the history of SICP at MIT: http://www.codequarterly.com/2011/hal-abelson/ http://www.codequarterly.com/2011/hal-abelson/
- naughtysriram 15y agoWonderful article.. - Lambda - The Ultimate Ponzi Scheme ;) - SICP is a bit old book :( - Things must EVOLVE, Mutation is bad ;) - The best way to make both ends meet is to tie a knot ;) - SICP 2.0 - Why don't the nirvana hackers hack the SICP book and lay down stuff they have learnt since their enlightment, as a legacy for all the future CS students? :) - It will be a OPEN book, highly reviewed and revered ;)
- deleted 15y ago[deleted]
- Hyena 15y agoThe obvious solution: rewrite SICP to use Python rather than Scheme. It is CC attribution and non-commercial, so I don't see any legal barrier to outsider revision.
- neilk 15y agoThat is not possible or desirable. Scheme-specific constructions are woven throughout the text -- tail calls, closures, and more. And the main value of SICP, at least for its fans, is the pedagogic value of the language. It starts off with pure functional programming and then introduces assignment much later, and discusses its tradeoffs.
- nknight 15y agoHow are tail calls and closures in any way Scheme-specific? The "main value" cited also assumes "pure functional programming" is worthwhile. That is not an uncontroversial opinion, and does little to make the case for SICP to people not already convinced.
- neilk 15y agoWell, the question was about Python, which definitely doesn't have those things. If you want to me to justify Scheme, how about code-as-data, which is the entirety of chapter 4? > That is not an uncontroversial opinion, and does little to make the case for SICP to people not already convinced. That was not an unconsidered viewpoint, if you read what I wrote. I said "for its fans". I am not attempting to make the case for SICP; that book doesn't need my help.
- nknight 15y agoCPython doesn't have built-in tail call optimization, but that's not a fundamental property of the language, just a limit of that particular implementation. One that can even be hacked around in Python with a decorator. A decorator, by the way, is a Python feature that depends on closures, which are themselves quite commonly used in Python. You have some very strange ideas about Python that appear to have little relation to reality.
- sorbus 15y agoSo SICP is awesome. The article makes that assertion in the third paragraph, and then continues making that point for most of the rest of the article. It does not, however, make a good, convincing argument for why "Dive Into Python" is significantly worse, especially as an introductory text. > It’s just.. it’s just not the same. Never say this. Horrible people (like me?) will point to it as you admitting that your argument is founded on nostalgia for the way things were, regardless of how strong the rest of your argument is.
- gwern 15y ago"Stop. Take a deep breath. Think about all that you have just discovered (or if you have already discovered it all, reflect on how awesome it is). By page 45 of SICP, you will have; Translated recursive definitions into iterative processes Examined the differences in the space requirements of various processes Used tail-recursion to implement efficient iterative procedures Seen that iteration can be thought of as a special case of recursion Realized that iterative processes can be restarted easily by capturing and restoring their state variables Given thought to complexity, optimization, and state transition theory Been encouraged to explore creative solutions to challenging problems Learned the basic syntax and semantics of Scheme Observed a quasi-religious experience What will you have accomplished by page 45 of Dive Into Python? Don’t hold your breath. I’ve looked into it. You’ll be learning how to use the and-or “trick” to make simple programs difficult to read. Soon afterwards you’ll be exposed to Python’s intentionally crippled lambda statement." "Scheme is considerably less complicated and idiosyncratic than Python. It’s simplicity and consistency have immense pedagogical value. It might take you anywhere from a day to a month to pick up the basics of Python. Scheme, on the other hand, has virtually no syntax. It’s definitely possible to get a solid grasp of its fundamentals in less than an hour. Python can be used to accomplish many of the same things as Scheme. Practically anything you can do in Scheme you can do in Python, and formally speaking, the two languages are equivalent. However, until a Python textbook emerges that surpasses SICP in teaching the core elements of programming, we should stick with Scheme."
- sorbus 15y agoA single paragraph insulting a work does not a convincing argument make (perhaps the fact that it starts off very slow is good in introductory textbooks?). Nor does an assertion of how Scheme is "considerably less complicated and idiosyncratic than Python" convince me that all Python textbooks must, by necessity, be worse than Scheme textbooks. I'm entirely willing to admit that SICP is better than Dive Into Python (well, I would be if I had a copy of it around so that I could verify this). I'm just saying that the article does little to convince me of that (and quoting parts of it at me does even less to convince me - if you think that I didn't read it thoroughly enough, just come out and say so).
- Jach 15y agoEven MIT abandoned SICP for its introductory course in favor of Python. But I believe it's featured in its second course, no? I don't consider that a mistake. If you're getting rid of it from the curriculum altogether, though, that's a mistake. This article didn't say if that was the case or not. (Also the point of SICP being language agnostic is fairly false. I mean sure you can implement iteration as recursion in other languages, but without tail call optimization it's going to be ugly. Then there's the whole "code as data" problem that's not easily extendable outside the s-exp world. I guess one might say the important, deeper parts of SICP work across languages, but is there an equivalent somewhere to SICP that's not in Lisp?)
- pavpanchekha 15y agoYour points. 1) MIT did not abandon SICP: it decided that it no longer wanted to teach core CS concepts. There was an interview with Abelson on HN a while back, look that up for more. SICP is not featured in the courses at all, unless you count 6.945, an advanced class with Sussman, that goes far beyond. 2) The fact that iteration is a special case of recursion is a fact that does not depend on a language. For its part, SICP distinguishes between the two specifically because most languages don't make this theoretical unity a practical one. 3) Code-as-data is not used much in SICP until the final chapters, where you implement a metacircular interpreter. It is impossible to implement a metacircular interpreter without making use of code-as-data, because that is its point. And in Python, a Scheme interpreter is just as approachable as in Scheme (a Python interpreter is not, simply due to how huge the Python langauge is). 4) There is not, AFAIK, and equivalent to SICP, because we already have SICP.
- scott_s 15y agoMIT did not abandon SICP: it decided that it no longer wanted to teach core CS concepts. Wait, what? Are you claiming that the MIT undergraduate CS program does not "teach core CS concepts"? Or are you only talking about a single introductory course?
- pavpanchekha 15y ago
- acangiano 15y agoPublishing a Python version of SICP would solve the problem. Sure, you can't always translate Scheme to Python with ease, but even a smaller, modern edition of SICP written in a Pythonic way would be extremely beneficial.
- killerswan 15y agoExactly my thought. My introduction to Scheme, incidentally, came while I was learning JavaScript, and it was through a book that hadn't originally been written in Scheme, either: http://javascript.crockford.com/little.html http://javascript.crockford.com/little.html
- ryan-allen 15y agoSICP will always exist though, people don't have to go to MIT or whatnot to read it and receive it's wisdom! I have my copy, it's not going anywhere!
- palish 15y agoSo did anyone else look at the challenge problem, see f(n-3), f(n-2), and f(n-1), then immediately think "oh. A three element array would solve that"? Took me less than 60 seconds... I'm a little worried that I'm so good at imperative programming, though, since it might indicate that I'm "crippled" when it comes to functional programming. I bet one of you could code circles around me when it comes to e.g. implementing a DSL. Anyone have advice about how I'd go about "diving into functional programming"? What's a fun project to do in Haskell, for example? I rarely approach a programming problem by trying to define functional routines. Instead, I almost always use state. Seems like a bad habit that I need to focus on breaking.
- mightybyte 15y agoDive into Haskell with whatever interests you. Try solving some Project Euler problems (http://projecteuler.net http://projecteuler.net). Or, maybe web programming suits your fancy (http://snapframework.com http://snapframework.com). If you're more visual you might play around with these exercises which don't even require you to install anything. http://pnyf.inf.elte.hu/fp/FunctionGraphs_en.xml http://pnyf.inf.elte.hu/fp/FunctionGraphs_en.xml http://pnyf.inf.elte.hu/fp/Diagrams_en.xml http://pnyf.inf.elte.hu/fp/Diagrams_en.xml Others here: http://pnyf.inf.elte.hu/fp/Overview_en.xml http://pnyf.inf.elte.hu/fp/Overview_en.xml
- palish 15y agoThanks!
- colanderman 15y agoI looked at it and thought, "easy, I'll just rewrite the Scheme function in Mercury and tell the compiler to memoize the function." Of course, obviously the point of the exercise is to encourage thinking about how a computer actually performs computations, which is in a linear, imperative fashion. In that case, why use Scheme in the first place? Its syntax and semantics encourage exactly the opposite style of programming, and in my opinion, obstruct the learning process in this kind of problem. To make an analogy, teaching this problem using Scheme is like teaching someone how to bake a cake using an unplugged Kitchenaid. The Kitchenaid would work great if it was plugged in, but it's not, so you have to push the beater around by hand. Why not just use a hand beater in the first place? [Scheme would work great for this problem if it had memoization, but it doesn't, so you have to solve the problem as if you were using Python. Why not just use Python in the first place?]
- Goladus 15y agoIt looks like the rationale for Berkeley's change is different than MIT. At MIT the change was made because "being a better programmer" in the classical sense was deemed to be less important than other aspects of engineering. If you look at the new MIT course, you'll see that it starts with an intense overview of python and programming techniques and then moves on to apply those techniques in a variety of relevant engineering-related areas. This makes sense in the context of the MIT major given that the choice to focus on software development doesn't have to be made until later on. (edit: also there's an interview floating around somewhere that talks about the rationale being that modern programming is different in the sense that it more often requires ability to figure out existing libraries as much as an ability to compose well-structured programs.)
- jbooth 15y agoTo the ramparts!!
- pnathan 15y agoPractical programming should not be the point of early computer science curricula.
- atdt 15y agoWhy on earth not? What's so bad about starting at a high level of abstraction and then progressively peeling the abstraction away to get to the core concepts?
- nvictor 15y agofreshmen are easily bored?
- Apocryphon 15y agoYou have to learn arithmetic before you can learn proofs.
- maurycy 15y agoCan you prove it?
- Apocryphon 15y agoWhy, doesn't this add up?
- maurycy 15y agoFrankly, not that much. Proof writing depends more on abstract reasoning than knowledge of arithmetics. Of course, traditionally, it works that way. I would say, though, it's harmful a bit for the reason that the basic math curriculum is so boring, it puts off many brilliant minds. Mandatory reference: TED Talk, Wolfram on Math Education. ;-)
- Apocryphon 15y ago
- angrycoder 15y agoThis is kind of sad, like an english department no longer teaching Shakespeare because it is written in archaic language and can't hold the student's interest. But computer science isn't like english, so I guess it is a bit of false analogy. Fortunately the text and lectures are available for free online, so there is nothing to prevent the curious student from digging in. edit: now that I've more time to reflect, I want to revise my thoughts... I would be pretty pissed I was handed dive into python or something similar as my freshman programming text at a college like MIT or Berkley. I would hope that most CS majors wouldn't be going to into one of the top CS programs in the country cold, having never written a line of code. This is in no way meant to disparage Dive into Python or similar books, but it is something you can read on your own over the course of a week or two. If you aren't going into CS at a top uni to study the hard shit like SCIP, I don't really see the point.
- JeremyBanks 15y agoThe first sentence on diveintopython.org is: Dive Into Python is a Python book for experienced programmers. Deciding it's an appropriate choice for an entry-level Computer Science course is baffling to me.
- deleted 15y ago[deleted]
- DTE 15y agoI'm not sure the analogy is entirely wrong. SICP presents computer programming in a magnificent way -- it gets to the core of why it is interesting on a philosophical level and in this way it will never be entirely irrelevant.
- spacemanaki 15y agoI basically agree with the OP that Dive into python is a pale replacement, but at the same time there is something to SICP's critics. Peter Norvig seemed to think most people would get the most out of it after getting some experience, and the HtDP authors definitely have a point about how much heavy math is involved. It's still a wonderful book, and won't be lost, I'm sure. http://www.amazon.com/review/R403HR4VL71K8 http://www.amazon.com/review/R403HR4VL71K8 http://www.ccs.neu.edu/racket/pubs/jfp2004-fffk.pdf http://www.ccs.neu.edu/racket/pubs/jfp2004-fffk.pdf
- thaumaturgy 15y ago> ...and the HtDP authors definitely have a point about how much heavy math is involved. I get why people object to heavy math in programming -- it makes the entire field less accessible -- but programming is heavily based on mathematics, if not entirely a subset of mathematics. Saying, "it requires too much math to learn this" strikes me as a lot like saying "there's too much biology in learning to be a doctor".
- spacemanaki 15y agoI completely agree, but at the same time, it's a barrier to entry that I think might be unnecessary. Some college freshman haven't taken calculus, and SICP would seem a bit daunting at times to those students, I imagine. Unfortunately, I think HtDP goes too far; it's too dumbed down.
- thaumaturgy 15y ago> Some college freshman haven't taken calculus... Yeah, and that's a serious problem, too -- and one that I'm guilty of! ...that is, if I'd ever gone to college. :-( I am very much not encouraged by a "race to the bottom" when it comes to education. If calculus is too difficult for the student, then perhaps the student should not consider a career in programming. I say that without any malice whatsoever; I'm not sympathetic enough to be a counselor, and I wouldn't expect counseling courses to simply disregard the importance of counseling so that I could have a job in the field. To bring all this back to a more practical argument: I am annoyed daily by the great and heaping piles of inefficiencies and bloats and bugs and weaknesses of software. I have to, on a regular basis, explain to clients that they should throw out their old computer and get a new one, so that they can continue to do what is, to them, exactly the same thing they were doing with their old one. That can be a rather challenging thing to explain to some people. I find it difficult to believe that this ongoing pattern of abuse of resources is not at least partly related to a greater and greater ignorance of the fundamentals of programming.
- civilian 15y agoI think that starting with Python is a fine choice. Please keep in mind that it's just the introductory course-- these students are going to be battered with CS theory later on. We are graduating around 20% fewer students in CS than we were in 2004. We need to find a way to make CS more accessible. I'm not saying that we should make the whole degree easier, but I think that having an easier & more practical first course would be good. The students might not learn as much theory, but they'll get the adrenaline rush of being able to code quickly and do some real damage with their code. ## EDIT: It was a 36% drop from 2004 to 2008. Here is my source: http://marketing.dice.com/pdf/Dice_TechTalentCrunch.pdf http://marketing.dice.com/pdf/Dice_TechTalentCrunch.pdf
- biot 15y agoI think the more likely explanation is that a lot of people saw insane fortunes being made from computer science in the dot-com boom and went and got their degrees, hoping to cash in as well. In the subsequent bust, the party was over and computer science reverted to being a program for those who were truly interested in it. I'd rather it stayed that way.
- pyre 15y agoThose percentages don't mean much out of context. Was the curriculum less stringent back then (I.e. graduating people that shouldn't have been able to)?
- civilian 15y agoUnfortunately, that context (a survey of the difficulty of curriculums for CS programs across the country, per graduation class) would be very hard to collect. However, we could try to look at CS school drop-out rates, and how many students picked-up or dropped the CS major. Nevertheless, it would be hard to separate "difficult courses" from "students who don't really love CS" as boit and pnathan suggested.
- pnathan 15y agoYeah, I started CS in '01. Most of the guys were there to make a fast buck.
- abstractbill 15y agoI love SICP as much as the next person. I've spent vacations devouring it while despairing girlfriends try to get my attention. Seriously, it is awesome. But, being realistic, an incredible amount of value is currently being created by software engineering. Value to society, and (hence) value to those who can practice the craft. I'm not surprised that so many schools are teaching software engineering, instead of computer science.
- burgerbrain 15y agoIf that's what a school wants to do, then it should just discontinue CS and rename it software engineering. Actually, my old school had such a major...
- jeffreymcmanus 15y agoIt's not an either/or. Software Engineering is a part of Computer Science.
- quanticle 15y agoI dispute that. Mechanical engineering isn't physics and neither is electrical engineering. Chemical engineering isn't chemistry (it is, in fact, more thermo- and fluid-dynamics). So, in the same way, software engineering isn't computer science. At best, it has a relationship analogous to that between applied mathematics and pure math.
- runevault 15y agoPart, but if they focus so completely on the subset, then is it really computer science anymore?
- burgerbrain 15y agoUnfortunately the trend seems to be the replacement of one with the other. What I am suggesting, one major for each, is exactly the opposite of either/or.
- 15y ago
- blueberrymuffin 15y agoThe new 61a will still try to (roughly) follow the old 61a/SICP curriculum. Dive into Python will (I think) probably just be used in the beginning to introduce the language. http://www.eecs.berkeley.edu/~bh/61a.html http://www.eecs.berkeley.edu/~bh/61a.html Specifically where it says "in 2011-12, 61A will be taught ... using lecture notes based on SICP".
- vii 15y agoSICP is a great book. Its abandonment is a sad reflexion of the gradual descent of programming teaching from principled discipline into an introduction to the process of trial and error. While most developers probably spend the majority of their time experimentally cobbling together applications from blackbox components, this they can and probably must learn on the job. What SICP tries to teach they cannot -- the most fundamental idea in programming: The evaluator, which determines the meaning of expressions in a programming language, is just another program. We are starting to embrace again more featureful languages and regrettably accepting that the majority of programmers will use multiple languages regularly. Therefore SICP seems more appropriate than ever!
- nikcub 15y agoprogrammers who have a good understanding of scheme and SICP are likely to pick up programming in python (or equivalent such as C#, Java, etc.) anyway - either on their own, or through industry experience. it is a shame that csci is shifting away from teaching fundamentals to teaching syntax. it would be like teaching art with color-by-numbers.
- thaumaturgy 15y agoThis is one of a very very small number of programming-related articles I've ever been glad to read. Programming should be taught as an approach to problem-solving and structured logical thinking, not as an approach to a particular language. If you can understand the core concepts of programming, the individual languages begin to matter a lot less. Python is great. Java is great. C++ is great. But they are just tools for solving classes of problems; if you don't understand how to, as the author says by way of example, deconstruct problems and understand the advantages and disadvantages of various solutions, then the software you write will never be as efficient or as elegant as it could be. There is a compelling argument that, in the age of nearly limitless computing resources, it doesn't matter anyway. You will in all likelihood be a glue programmer: you'll rely on APIs and libraries, most of which have been written by someone else, and you will simply string them together by applying the functions that most obviously address whatever problem you're trying to solve. Who cares, really, if you're using Quicksort or heap sort, you're just going to call sort() on your array (or map, or key-value store, or whatever), and define a callback function that will evaluate any two given values in the array to be sorted, and that's it. Who cares if one requires a little more memory than the other, or a little more time to execute? Just knock it out, and then get back to arguing online about the One True Language, or the One True Framework. But, I've been programming for about 25 years now, in dozens of languages, and I can't help but feel that this language-specific approach to programming is producing anemic programmers. Programming can be a craft; in can be done well, and elegantly. I can hack together a decent, reasonably strong wooden workbench for my shop, but it doesn't possess the same craftsmanship as a dedicated wood worker. It does the job, but it is ugly and uninspiring, and nobody admires it. So, I guess I think that programming is similar, and moving from SICP to teaching Python or Java is just another representative sample of a disappointing sea change away from what I've come to know and love about programming.
- d0m 15y agoIt's not "what the school wants to teach" but more "what the student needs to know at the end of the semester". I love SICP -- for me it was a revelation which opened a new world, and is still my favorite book -- but not everyone is like that. 90% of my colleague in my university would hate that book.. (As they hated the dragon book and anything less practical). So, as they say, "Hate the game, not the gamers". What a school teaches is a reflexion of what is needed in the society and sadly what the students want. I do hope however that great professors will still strongly suggest the book to students who want to go one step deeper. p.s. A new version of SICP could include a couple of pages on python; i.e. make a list comprehension, yielding, etc. :)
- rdouble 15y agoThe merits of SICP have been debated many times. More interesting is the choice of "Dive Into Python." Is that really the best Python book for Berkeley CS?
- jeffreymcmanus 15y agoThat was my thought -- it was certainly one of the earliest books, which may explain why it was chosen, but I'm not sure if it's currently the best.
- helicalspiral 15y agoSICP is going nowhere at Berkeley. Take a gander at http://www.cs.berkeley.edu/~bh/61a.html http://www.cs.berkeley.edu/~bh/61a.html (Brian Harvey at Cal is synonymous with 61A) and note: "Starting with the latter, in 2011-12, 61A will be taught by John DeNero (fall) and Paul Hilfinger (spring) using lecture notes based on SICP (since its text is now available on the web with a Creative Commons license that permits such use) but with the program examples recoded in Python. This is, on its face, a strange idea; Scheme and SICP build on each other's strengths and programming in Python as if it were Scheme will surely result in some of the examples looking unlike the way a native Python speaker would code them. But the long-term plan is that over time, the 61A curriculum will gradually change to include "more modern" ideas, leaving out some of the SICP ones to make room; because of its huge collection of application libraries, the new ideas will be more easily expressed in Python than in Scheme. Also, there is currently a vibrant open-source project community using Python, and 61A students can be introduced into that community."
- troymc 15y agoThe author makes the assumption that the only books people will ever read are those books that were assigned as part of a formal course. That may be true of some people, but it's certainly not true of the average programmer!
- prospero 15y agoYou have a very high opinion of the average programmer. I'd say unrealistically high.
- troymc 15y agoEven the average programmer must keep up with the changes in whatever systems and languages they use, long after completing formal education. Therefore they must read beyond what their formal education prescribed.
- lekanwang 15y agoHow introductory programming is taught should really be approached from two directions these days. (1) How to teach a firm foundation for those likely to pursue computer science, and (2) how to motivate and teach a breadth of material to those students who likely will not take more computer science courses. At a place like Stanford, a majority of undergraduates will have taken an introductory computer science course by the time they graduate, but it's obviously not true that a majority will be computer science majors. And while I appreciate SICP and Scheme and functional programming, and completely understand why that kind of thinking should be valued, it may not be the best way to present a breadth of introductory programming knowledge that will motivate, interest, and offer practical examples. Sure, lambdas are awesome, but when you are just starting out in your first programming course, the deep theory behind why lambdas are so interesting will almost certainly be lost on the students. It's like building up a field of math from, say axiomatic set theory or algebra. By the time you get to multiplication and fields (perhaps akin to variables or for loops in programming), you gain a very deep understanding and appreciation for the topic that can only be gained by this bottom-up problem based approach, but then again, a non-mathematician (or non-computer scientist) could have probably just assume the existence of multiplication or loops for the sake of solving higher-level problems.
- justinhj 15y agoIt makes me so happy to see such an interesting and passionate article on hn, and at the top no less. So much more valuable than all the "what kind of socks to wear when launching a starup" type posts.
- ihodes 15y agoI absolutely agree with the gist of this article. The assumption that college should prepare you for a career is a fallacy. You should be able to teach yourself programming well enough to program, and take a few classes on the side for kicks+extra progress. But going to a 4-year institution and expecting that to be your golden ticket to a career? Ludicrous. I go to school to be exposed to things I wouldn't otherwise. I go there to meet people I wouldn't otherwise. I go there to figure out myself, and challenge myself. If I wanted to go into a career working with Spring MVC, I'd have been ready for that out of high school (less the degree many places require–the requirements are a separate issue).
- agentultra 15y agoI felt the same way wrt The Little/Seasoned/Reasoned Schemer and religious experiences. It's a shame that they're removing SICP in favour of a technical introductory text. Python is great and all, but SICP isn't about teaching Scheme.
- dougws 15y agoAt my school our intro class was in Python, but an SICP class was required for majors. I think this was a pretty decent compromise, especially since many prospective majors placed out of the intro class anyway. I agree that SICP (really FP in general, though the consensus seems to be that SICP is the best way to teach it) is a necessary part of any serious CS curriculum, but I don't think it's necessarily a good place to start--especially if non-CS people are taking the intro class.
- thedigitalengel 15y agoI've always found SICP quite overrated (I'm saying this after reading it). Given Python's learning curve, a much better curriculum would involve going through the codebase of a few well-chosen projects, sending in a few patches and perhaps writing a report on the high-level design of the piece of software or on how the project solves a particular problem (how does XYZ handle i18n? how does ABC stay stable even on a failing network?)
- thedigitalengel 15y agoI can't say much about "Dive into Python", since I've not read it.
- blahblahblah 15y agoThe books that are beloved by practitioners in a field are not always the best choice in terms of pedagogy. Clearly, these professors think that another book choice will help their students really grok the material. If they're successful, great. If they're not, they'll probably recognize it and supplement with other material or switch to another text. It's certainly possible to be a competent programmer without ever having read SICP in the same way that it's possible to learn linear algebra and calculus without ever having read Strang. My CS program didn't use SICP and I don't feel like I really missed anything of critical importance. There are other very competent authors writing other very good textbooks, after all. I was still exposed to Assembly, Fortran, Pascal, C, C++, Java, Scheme, Lisp, and Prolog in my program and learned core concepts of computer science such as asymptotic complexity, recurrence relations, Boolean logic, countability, Turing machines, finite automata, parsers, interpreters, threads, data structures, grammars, Backus-Naur form, etc.
- davidhollander 15y ago>Beautiful. I guess beauty is in the eye of the beholder. A simpler way to analyze this problem is noticing the f(n-3) term implies your function has to memorize up to 3 previous results. Then just use the coefficients from the formula to cycle the next result into memory. Using algebra and generating new coefficients as per the OP's solution is unnecessary. function f(n) if n<3 then return n end local a, b, c = 0, 1, 2 for i=3,n do a, b, c = b, c, c+2*b+3*a end return c end
- zephyrfalcon 15y agoYeah, the rewriting goes a bit far for my taste as well... but it is a valid solution, and a purely functional one at that. Yours is valid as well, but introduces local state (which in this case probably doesn't matter, but it's worth noting nonetheless). You could write it this way in Scheme too, using a "let loop" for example, or even using a more imperative style.
- cousin_it 15y agoNice! Also your solution makes it easy to move on to a logarithmic time solution: going from (a,b,c) to (b,c,3a+2b+c) is a linear transformation which can be expressed as a 3x3 matrix, therefore iterating it n times is equivalent to raising that matrix to the nth power, which can be done in log(n) time using square and multiply [1]. Disregard programming, study math! In fact the exact same reasoning can be used to derive the closed form expression for the Fibonacci numbers [2], which are defined by a recurrence relation similar to the one in the OP. You raise the corresponding 2x2 matrix to the nth power by going to the eigenbasis where the matrix becomes diagonal, raising the values on the diagonal (which turn out to be the golden ratio (phi) and -1/phi) to the nth power, then changing the basis back. [1] http://en.wikipedia.org/wiki/Exponentiation_by_squaring http://en.wikipedia.org/wiki/Exponentiation_by_squaring [2] http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_ex...
- danvet 15y agoYou've made my day. This is one of the tricks to I often forget about again but just smile upon reencountering. Step 1: Transform to the eigenbasis of your operator. Step 2: Enjoy the beaty.
- yason 15y agoI'm not worried. Good programmers read SICP on their spare time if they don't have to do it in school. If they haven't heard of SICP, they will once they'll join the company of other good programmers and probably find it interesting. On the other hand you can't force material on people who reject it because they don't understand it. It's just the question of where do we need universities at all when everything valuable is replaced with ever-easier material? Of course, the marginal number of people who actually want to become academics in CS will be needing universities, but that would amount to 1/10th or likely less of current CS student population.
- ldar15 15y agoI'd been programming over 20 years when I read SICP. The book was interesting. It was interesting as an introduction to functional programming. But, in my opinion, a lot of the stuff in it that is held up to be clever or informative is just difficult because the reader is expected to figure out how to to imperative programming in a functional language. 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. This being ycombinator, and given pg's thoughts on the merits of FP, I may not have a popular view. We will just have to agree to disagree. Once you figure out (i.e. immediately if you have done it before) that computers are imperative, not functional, many of the "truths" or "revelations" in SICP are like "well, duh" or worse, "why the fuck did you make me go to all that effort?"
- danieldk 15y agoA 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?
- ldar15 15y agowhy 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".
- daakus 15y agoI did have SICP when I started undergrad, and I wish, and asked my professor why can't we use "something modern like python". He gave me some reasoning, and I wish I remember what it was. I think part of the problem is that there isn't enough of a "fun" or "excitement" component in SICP for a very many n00bs, which I was then. Python was cool. Perl was cool too. They're not terrible languages, but admittedly boggled down by syntax. Scheme had a "for education purposes rep" (many times propagated by professors themselves). And there was no "easy_install mechanize" or "easy_install pyqt" to start doing cool shit in Scheme (which I don't believe is true, but for whatever reason at that point it wasn't apparent this was even an option to me). Overall, I had a lot more fun starting off with Python on my own time. I may have taken longer than most to come around and appreciate Scheme, and certainly find myself wishing JavaScript had less syntax. SICP is awesome though. In fact, I sold most of my books after I was done with university including that one. But maybe 3 or 4 years later, I ended up purchasing it again as I wanted to find classic Lisp literature. Only after it got delivered did I realize this was the same book. And this time around I did truly enjoy it. But I wish I remember what reasoning my professor gave for preferring Scheme over Python.
- serichsen 15y agoWhat I do not understand is that Python is seen as a good language to teach Computer Science. I would have thought that a requirement for such a language is that it is theoretically sound. Python has a broken scope concept. Also, I think that a "there is only one way to do it" philosophy, coupled with the crippling of several constructs, is not a good basis for forming an open mind.
- curious_man 15y agoI don't know if someone has already cited this lengthy interview to Hal Abelson (co-author of SICP) about this change, but I think it is worthy to point it out: http://www.codequarterly.com/2011/hal-abelson/ http://www.codequarterly.com/2011/hal-abelson/
- lispm 15y agoSo the school for auto mechanics is no longer using the Ford Mustang II from 1974 for teaching purposes? How sad...
- omaranto 15y agoFor those who haven't read SICP: don't get the impression that it only deals with very easy stuff like the example in the post about turning a recursive definition into an iterative one. It actually touches on many of the bet ideas in CS. This post could have easily chosen a more interesting example.
- jdietrich 15y agoThis isn't a question of whether we should teach SICP, it's a question of whether it's an appropriate introduction. I love SICP, I think it's one of the most brilliant didactic texts ever written, but I think it's a terrible starting point for most students. To me it appears that SICP is used as a trial by ordeal, intended in large part to scare off 'unsuitable' candidates. SICP is all about the beauty and interest of computation for it's own sake, but it doesn't really engage with solving the kinds of problems most software is written for. I think we're inadvertently dissuading people who would make great programmers, but who see computer science as a means rather than an end and need to relate algorithms and data structures to practical problems. There is clearly value in CS for its own sake and academics are obviously inclined towards this, but I think dismissing the practical application of CS is unhelpful. If we segregate programmers into 'Computer Scientists' and 'Software Engineers', we lose the most precious part - the bit in between, where radical ideas meet great engineering. I want to see more diversity in computing and I think SICP as an introductory course is a serious hindrance to that aim. We don't teach children to read and write by starting with linguistic theory. I think we should teach software the same way - start with Dick and Jane and work our way up to lambda calculus.
- a3_nm 15y agoI can think of at least three conflicting approaches to teach programming: - Start with a low-level language like C (or MMIX...), possibly on embedded devices, so that students know what is going on at the hardware level and don't think that primitives in high-level languages are free. - Start with a functional language like Lisp, so that students know the theory and the elegance of functional programming. - Start with an easy and practical language like Python, so that students get to write (crappy) code as soon as possible, tweak it until it works, and finally see their program work and do something impressive (to them). SICP is an excellent book, and a very good choice for the second approach, but it is not the only sensible way to discover programming.
- gigamonkey 15y agoI don't know what, if anything, is going on at Berkeley, but Hal Abelson talked quite a bit about the switch from SICP to a different intro course at MIT when I interviewed him for Code Quarterly http://www.codequarterly.com/2011/hal-abelson/ http://www.codequarterly.com/2011/hal-abelson/ and it wasn't about abandoning Scheme or "not teaching core computer science". (Well, maybe a bit less core computer science in the intro course but that was basically so that CS people could have more time later for CS without all that annoying EE stuff. And vice versa.)
- hga 15y agoYeah, well, Hal has be diplomatic, he can't authoritatively state that the order came down from on high (perhaps above the department) that Scheme was to be totally purged from the base undergraduate curriculum, which to my knowledge was finished not long ago. That's what's behind his statement "And for random reasons we didn't [do the course in Scheme]." That said, Hal himself does fully support the change from SICP/6.001 to 6.01 according to my sources. And you're right that much less EE is required of of pure CS majors (6-3s), but I'm told that very few current students do that major, most do the combined EECS one.... To finish, while I don't have time right now to finish reading/skimming your very interesting interview (you do realize you are by far the best interviewer in our field?) as far as I can tell a lot of the deep stuff taught in SICP/6.001 has also been purged from the base undergraduate curriculum. Kinda reminds me of when the Boy Scouts of the USA changed their system in the '70s so that you could become an Eagle Scout without ever having camped outdoors, started a fire, etc. (My response to that was to drop out of Boy Scouts; here, as a scientist by inclination who just happens to narrow interests in CS which are fairly EQ with SICP I don't exactly have a dog in this hunt (amusingly, my other big interest in this general field is pure software engineering, the fruits of starting out on an IBM 1130 and realizing there HAD to be a better way to do things :-). Although I do seriously wonder about the de-emphasis of functional programming at some of the top 4 in the multi-core future which is today).
- Raphael_Amiard 15y agoActually, i agree with him than SICP goes through a lot more important concepts than Dive Into Python, or any other book like this can do. I also don't find it good that berkeley is abandonning it. But, i really think that it's not necessarily a good choice for an introductory course. To sum up my position fast, i would say : "First teach how to program some silly things, by teaching the basis of a language (and python seems a very good choice for this). Then when students are addicted, show them some SICP" This resonates with a lots of comments about SICP, where people who liked it are often quite experienced programmers, and not beginners (Not to say that SICP can't be appreciated by novices, but that it's probably a bit hard for an introductory course) EDIT : Sorry, jdietrich did say something very similar to me in an earlier comment that i didn't see : http://news.ycombinator.com/item?id=2846189 http://news.ycombinator.com/item?id=2846189
- vedantk 15y ago### An Update SICP will not be abandoned at Berkeley. Although Python will be used to convey the material, I have been assured that much of the content from SICP will be preserved. I recognize now that CS61A is a fusion of sorts: an exciting modern treatment of traditionally intellectual material. This change reflects concerns about the difficulty of SICP, the popularity of Python, and a general lack of interest on the part of students and teachers in Scheme. Fair enough. I think this is the best possible solution for an introductory course, but that's just my opinion. I want to reiterate that I mean Berkeley or its professors no disrespect, and that I only raised this issue because I was concerned about a potentially drastic shift in the curriculum. I can't begin to thank you all for your comments, criticism, emails, and interest. It's made a world of difference.
- tphyahoo 15y agoJust for fun, I did the exercise in haskell with state monad. import Control.Monad.State f x | x < 3 = x f x = f (x-1) + 2 * f(x-2) + 3 * f( x-3) t = f 20 t2 = f 20 == theSequence !! 20 t3 = f 20 == theSequence2 !! 20 nextSeq a b c = 3 * a + 2 * b + c theSequence, theSequence2 :: [Integer] theSequence = [0,1,2] ++ (zipWith3 nextSeq theSequence (drop 1 theSequence) (drop 2 theSequence) ) theSequence2 = [0,1,2] ++ evalState theSequenceS (0,1,2) theSequenceS :: State (Integer,Integer,Integer) [Integer] theSequenceS = do (a,b,c) <- get let next = nextSeq a b c put $ (b,c,next) xs <- theSequenceS return $ next : xs
- sigzero 15y agoI am just curious on this as I don't know Scheme at all. Could a new SICP book be authored that used Python instead of Scheme? Thereby, teaching what SICP was meant to teach yet using Python a well used "field" language?
- lostmypw 15y agoMuy importante. :-) Late to the party here, but over at the other SICP-related thread that's on the frontpage right now I've linked to an updated version of SICP where an enthusiast has created a pdf with greatly improved legibility, formulas set with tex and figures drawn with vector graphics. http://news.ycombinator.com/item?id=2848154 http://news.ycombinator.com/item?id=2848154
- schiptsov 15y agoWhy to make so much noise? Universities, even good ones, are about making money at first. So, if mediocre masses thinks that python is 'more practical' or that 'with Java they can always get a job' they have no choice, but to follow these stupid stereotypes. Trying to convince mediocre masses that Scheme is really beautiful or SCIP is the greatest programming book ever (OK, together with the Man-month =) is not their job, their job is to get money from student's parents, good PR and grants from government or IBM. Those who are smart enough and have a bit of taste will find out SCIP or discover beauty of Scheme (Python3/Ruby) and abandon Java or PHP themselves. ^_^