10 ms·
Why MIT Switched from Scheme to Python (2009)
- ReligiousFlames 10y agoIf people aren't exposed to enough languages to a level of competent understanding, if not mastery, a groupthink monoculture will inevitably develop where engineers only understand JS and Python, not C, Tcl, Clojure, Erlang, Brainfuck, Haskell, Coq, Rust, etc. The most important thing is for good engineers to understand both near-universal basic concepts and the low-level impact of data structures and algorithms (like branch mis-predictions / deep pipeline stalls, memory usage, latency, locality.)
- evdev 10y agoI think there's a tension between two imperatives in teaching new programmers: 1) Learning must be applied learning. Give people problems to solve and they will come to you for data structures and algorithms, O notation, etc. If they don't, they should do something else 2) A lot of what's out there in programming languages are cargo cults, and newbies need to be prepared for this. For instance, virtual function inheritance isn't a thing. It's a weird call chain pipeline system glued into your vtable, which C++/Java teaching also won't bother to tell you exists. Make people start from assembly, graduate to C, then write their OWN vtable, so it's demystified. Now you've reduced the ability of software designers to piss on your leg and tell you it's raining. So ideally I'd want students (at first) to be doing something either close to the machine or in the functional model. As they say though, the imperative of 1) means getting people to actually produce something, which is easier in Python.
- Cyph0n 10y agoAnother approach is to introduce newcomers to programming with a single course that: 1) uses Python to teach general programming, 2) uses JS to show how to write code that runs in a browser, and 3) demonstrates low-level programming patterns using C. This is essentially what CS50 at Harvard does, and it seems to work well. Once a student has been exposed to these 3 languages, subsequent courses can explain how a computer works and introduce new paradigms (FP, LP).
- evdev 10y agoYes, I think it's very reasonable to use a scripted dynamically typed language to learn control flow to start with. We tend to forget that the basics of loops and mutation are a hurdle for many people.
- jcranmer 10y agoWhile I think that most CS people should learn assembly and computer internals basics, it would be an absolute disaster to start students off in assembly as CS 101. Python is a fairly decent language for starting people off: * It doesn't have a lot of boilerplate, so no magic "I'll teach you what this means in three weeks" steps * Output for debugging is fairly easy, since print accepts a lot of stuff without needing to muck with formatting strings * Assignment is a statement, not an expression. You can't say "if x = 3" by accident * Python is one of the major programming languages, so you're teaching students something that is pretty much guaranteed to be useful for them.
- tmccrmck 10y agoBut many students come in with years of programming in a language like Python, Java, or C++. My friends and I built video games when we were in high school so we were comfortable in all three of those languages. Scheme levels the playing field. I have never encountered a student who entered university with years of functional programming experience and I was a TA for an introductory CS course. I think moving back to Scheme would be a wise choice for universities that are combating problems with diversity.
- jcranmer 10y agoIf students have years of programming experience, why are they being made to take programming 101?
- outworlder 10y agoBecause it is a required subject in your curriculum? You don't get to pass people just because they say they know something.
- eropple 10y agoMy university did. COS101 was an optional class for complete novices but if you weren't already at least exposed to programming your advisor would sign you up for it. COS125 was the first for-realsies class (taught in Scheme, as it happens).
- metaobject 10y agoI'm not sure new programmers need to worry about how virtual function inheritance is implemented via the viable. Are there even standards for that? Or is that an implementation detail which seems popular across multiple compilers? There's time for them to learn the details, but just learning that the functionality exists and knowing how to use it is a good start.
- evdev 10y agoThe point isn't to learn it as if it's something you'll have to recreate--it's to understand that "advanced" language features are built on top of the "fundamental" structural model and are not magic. You need some understanding of how programming languages are built in order to keep languages and libraries honest. Otherwise learning about type/object systems becomes learning all the pitfalls and incidental complexities caused by the design as if they're benefits and not costs.
- brianberns 10y agoMy problem with this sort of bottom-up approach to learning how to program is that what seems "fundamental" from one point of view always turns out to be an abstraction built on an even lower-level foundation. So, virtual functions aren't real because they're just vtables implemented in C. But C isn't real because it's just fancy assembly language. But assembly language isn't real because it's just fancy machine language. But machine language isn't real because it's just 0's and 1's zipping around the hardware. So I have to learn how integrated circuits work before learning how to program? No. Bottom-up knowledge is important for understanding performance and other trade-offs. However, there's also a lot of benefit in learning how to program in a formal system without knowing much about how that system is implemented under the covers. If I was teaching an intro programming course to undergrads in 2017, I'd be strongly inclined to teach them a clean functional language first (e.g. Elixir, F#, etc.), and only introduce gory details like pointers and memory allocation later on.
- nickpeterson 10y agoF# would be particularly well suited for this since it can reasonably do imperative, object, and functional styles. I'm not as familiar with Elixir to make the judgement there. Though I suppose one could also argue for something like Clojure.
- sanderjd 10y ago> So I have to learn how integrated circuits work before learning how to program? No. I took a couple classes in college that were designed to teach what is going on underneath the 1s and 0s of instruction sets. I didn't take the classes about how circuits work, but they existed, I had friends who took them, and I really wish I had as well. Maybe this isn't required knowledge to do software engineering, but it's definitely useful knowledge. Why wouldn't we want to learn these things?
- brianberns 10y agoI agree that these are useful and interesting things to learn. I just don't agree that they should be taught first when learning to program.
- agumonkey 10y agoI kinda despise the notion that assembly is everything. It's better than falsely higher abstraction like cpp and java but it's not all. Inductive logic and the functional paradigm maps onto all of these. And allows for more diverse abstractions without lying either.
- wolfgke 10y agoAnother article on the same topic: > https://cemerick.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program/ https://cemerick.com/2009/03/24/why-mit-now-uses-python-inst...
- ironchief 10y agoSussman wrote "Structure and Interpretation of Computer Programs" which is the book formerly used in many introductory CS courses including 6.001 "The wizard book" is a great read and I recently starting flipping through it again. PDF https://mitpress.mit.edu/sites/default/files/6515.pdf https://mitpress.mit.edu/sites/default/files/6515.pdf HTML https://mitpress.mit.edu/sicp/full-text/book/book.html https://mitpress.mit.edu/sicp/full-text/book/book.html
- irfansharif 10y agothis was posted here a few weeks ago but for posterity [1][2] is an HTML5 and EPUB3 version of SICP with 'SVGs, mathematical markup with MathML and MathJax, embedded web fonts, and syntax highlighting'. there's a PDF version[3] from the same author with decent typesetting. additionally I came across [4], SICP in an interactive textbook form with editable code fragments. [1]: https://github.com/sarabander/sicp https://github.com/sarabander/sicp [2]: http://sarabander.github.io/sicp/ http://sarabander.github.io/sicp/ [3]: https://github.com/sarabander/sicp-pdf https://github.com/sarabander/sicp-pdf [4]: https://github.com/zodiac/isicp https://github.com/zodiac/isicp
- aphextron 10y agoCould it be, however, that there is a need for introductory courses at university for those not quite at the level for SICP yet? I've worked as a web developer for years and can barely follow most of that text. If intro CS courses are provided in a more accessible format, more people will get interested and stick with it in the first place. There's always room for more advanced courses. I think that should be the goal of most universities.
- teddyh 10y agoAlso available in Info format, for easy browsing and searching from within Emacs: http://www.neilvandyke.org/sicp-texi/ http://www.neilvandyke.org/sicp-texi/
- ng12 10y agoEh. If you stick to software development you have the rest of your life to poke at non-ideal systems. I still have fond memories of learning Scheme and realizing that programming (specifically computationally dissecting a problem) could be a ton of fun.
- jedberg 10y agoBerkeley made the same switch at around the same time, and it made me sad. Having done the intro course in Scheme, I'd say it helped me understand functional programming far more than I ever could have with Python, and it opened me up to different ways of thinking. Even though I never again used any Lisp variant, I'm still really glad I learned it and feel that what I learned using Lisp has informed my future decisions.
- tmccrmck 10y agoThe switch occurred while I was at Berkeley and it also made me sad. I loved that course so much I decided to TA for the self-paced version which kept SICP and Scheme. Brian Harvey explained the decision to switch here: "But, as I keep saying, the choice of programming language isn't the main point. I get upset when students, even the students who like 61A, refer to it as "the Scheme course." It's not a course about Scheme! It's a course about programming paradigms. MIT, where SICP was written, no longer includes that course in its lower division core sequence, not because they wanted to change programming languages, but because they changed the entire sequence from courses organized around big groups of ideas to courses organized around application areas: first "let's build and program a robot" and then "let's build and program a cell phone." That's a brave and thoroughgoing attempt to, among other things, attract non-nerds to computer science. To say, as some people do here, "MIT switched from Scheme to Python" completely misses the point of what MIT did; nobody is proposing any change half as profound at Berkeley." [1] [1] https://people.eecs.berkeley.edu/~bh/61a.html https://people.eecs.berkeley.edu/~bh/61a.html
- Animats 10y agoThat's a brave and thoroughgoing attempt to, among other things, attract non-nerds to computer science. That's Berkeley. Abelson and Sussman once got MIT to trademark "Nerd Pride".[1] MIT still keeps the trademark active. Here's a Nerd Pride button.[2] [1] https://books.google.com/books?id=LJq0JhoElk8C&lpg=PA78&ots=XoEKLE7qe5&dq=%22nerd%20pride%22%20button%20MIT&pg=PA78#v=onepage&q=%22nerd%20pride%22%20button%20MIT&f=false https://books.google.com/books?id=LJq0JhoElk8C&lpg=PA78&ots=... [2] http://www.computerhistory.org/collections/catalog/E1312 http://www.computerhistory.org/collections/catalog/E1312 [2] http://www.computerhistory.org/collections/catalog/E1312 http://www.computerhistory.org/collections/catalog/E1312
- jacquesm 10y agoLong ago on HN: https://news.ycombinator.com/item?id=530605 https://news.ycombinator.com/item?id=530605
- _ph_ 10y agoFunny, I was present when this conversation took place. Hearing Gerry Sussman talk was truly inspiring. However, I would somewhat disagree. For sure, the way we program in day to day work has changed, and the curriculum should also touch that. However I think, learning the very fundamentals of computation is essential for a proper system understanding. SICP provides a great way of doing that and the choice of scheme as a minimal, yet powerful language fits to that. I can only recommend everyone to at least read through this great book.
- unabst 10y agoI took 6.001 in 1999 (I think). Hal Abelson taught it along with a professor who took off his sweatshirt to reveal a Microsoft tee at his final lecture (he went to Microsoft). What was great about Scheme (Lisp) is that most programs are basically words from your vocabulary, parentheses, and cars and cdrs. With procedural languages, there is always a sense that the language provides all the tools, and the magic happens somewhere underneath the hood. But with Scheme it feels as if it's happening right before you. It makes you feel like a wizard, and not a monkey. And it requires knowing all the spells. It requires knowing how to make magic happen. Or not. Once you know none of it's magic. But that's the point! Python is arguably easier and more practical for both science and work. It's already popular on the web server, and is used everywhere else -- unlike Scheme. But the recent resurgence of functional programming is super exciting with Elixir and Elm and the like. I'm looking forward to building my next project using Elixir. Here is the classic course: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/ https://ocw.mit.edu/courses/electrical-engineering-and-compu... Original video lecture on YouTube (linked from above): https://www.youtube.com/watch?v=2Op3QLzMgSY https://www.youtube.com/watch?v=2Op3QLzMgSY
- taeric 10y agoMy favorite thing having finally taken a dive into lisp and SICP, is not that it is very friendly to functional. It is that it is very friendly to showing how it all works. My favorite section is where they go over making a constraint based system that will either calculate degrees F or degrees C. Or validate that the two given values are accurate. All depending on what you have entered. And this is done from the ground up. No hidden magic of the system has to support you, by and large. (Not strictly true, as this does make use of GC and such throughout.) If you hadn't seen it, https://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute https://www.infoq.com/presentations/We-Really-Dont-Know-How-... is a great video showing Sussman's style. He also showcases a program they wrote that could solve circuits based on this general idea.
- mrcsparker 10y agoThank you so much for linking this video. I had no idea it existed. Watching that lecture was so much fun. I wish that there was a camera pointing to the crowd when he said the more controversial things. I didn't know that Sussman hired Stallman. Their work changed our lives.
- abhirag 10y agoThis book(http://composingprograms.com/ http://composingprograms.com/) is in Python and is based on SICP. I found it interesting enough to include it in my ever-growing to-read list, worth checking out.
- alistproducer2 10y agoWe used scheme in my programming languages course (which was one of my last course before graduation). at first I hated it, but then once I got it, it was fun! functional programming forces you to think in a way that is much more conducive to understanding programming on a deeper level and thinking creatively to problem solve. Imperative programming, while easier, is more of a blunt instrument. Efficient, but blunt.
- charles-salvia 10y agoFunctional programming is an attempt to pretend that Von Neumann machines are abstract, mystical mathematical engines, rather than a bunch of registers that read in values from an electronic grid, mutate them, and write out new values back to the grid.
- brlewis 10y agoEvery higher abstraction could be described as an attempt to pretend that the lower abstraction is less complicated and error-prone than it actually is.
- charles-salvia 10y agoI know - I'm being facetious, but really, if you want to really understand how most modern computers actually work, there's probably no better way than to learn C. It's high level enough and provides enough structure so that you don't need to actually blurt out a bunch of assembly instructions, but low-level enough so that your code mostly more or less corresponds to what the underlying Von Neumann hardware is actually doing.
- e12e 10y agoI'm not convinced c without assembly is much better than Pascal or even Rust. Sure, you might not need a full assembly course (write a real, multi-user, bare-metal os in assembler using most of x86 16,32 and 64bit syntax) - but a C course mixed with assembly I think makes a lot of sense if the goal is to learn a bit about how computers get work done. I mean, one should be able to look at the assembler output of hello.c and have an idea of what's going on. Without that level of understanding, I'm not convinced using C over many other languages gain you much. It's still a lot simpler than eg. c++, though. I'm thinking something like: http://pacman128.github.io/pcasm/ http://pacman128.github.io/pcasm/ but rewritten from the ground up for x86_64.
- abecedarius 10y agoThere's been time for the new course to shake out. Anyone taken it, and ideally read SICP too, and want to tell us about it?
- fomojola 10y agoOne of the key things about SICP in Scheme was that the language used so few intrinsic keywords and structures (I think it was something like 7 intrinsic keywords that could be used for just about everything you needed to do) that you could move on from learning about the language really quickly. It kept the focus on the underlying principles (every programming language is a set of primitives, a means of combination and a means of abstraction; recursion; interpreters; etc) that were powerful enough to let you pick up any other language without getting bogged down in the details. An opinionated language like Python seems like the wrong choice to teach fundamental structure (it WAS Structure and Interpretation of Computer Programs), but if they aren't approaching it from that angle and are looking more at application development then that's probably ok. You can pick up enough of any language or framework from the manual, and google/stackoverflow/o'reilly will give you fine points/quirks, but that fundamental base that allows you to look at ANY program in ANY language and be able to reduce it to first principles is (IMO) a necessary component of any computer scientist's toolkit and the best insurance against the continuous rise of packaged software that is continuously burning the short grass in most software development. I remember reading somewhere that focusing on application development is like training blacksmiths: you end up with people skilled at specific techniques but extremely vulnerable to "industrial" software that replicates the techniques and eliminates the need for custom development. There are not that many blacksmiths left, and the truth is in 50 years there won't be that many application developers left either.
- wuschel 10y ago> 50 years there won't be that many application developers left either. I like your comment, but the crystal ball statement in the last sentence is a bit too much.
- ScottBurson 10y agoI think it's probably right. 50 years is a long time.
- ams6110 10y agoI've been coding professionally for 30 years. And programming isn't really much different now than it was 30 years ago. The tools are better, yes. But we're still sitting at desks in front of a screen, entering code into computers as text, with keyboards. Perhaps there will be a threshold reached where suddenly that goes away. But I'm not holding my breath.
- CalChris 10y agoBerkeley EECS is MIT-lite and its 61A used SICP/Scheme. They even wanted us to use emacs (which for me, so wasn't gonna happen). So pretty much everything in this article applies to Berkeley EECS as well. They've also shifted from SICP/Scheme to Composing Programs/Python. http://cs61a.org/articles/about.html http://cs61a.org/articles/about.html The last time I used Scheme was in 61A. I like Scheme; it was elegant. I probably would have continued to use it but Instructional Computing had a bastardized variation. I'm pretty sure that students of 61A will continue to use Python since they're using Python 3.
- mark_l_watson 10y agoI liked Sussman's answer. There is a huge difference in learning things deeply from the bottom up vs. 'get stuff done' approaches using lots of black box libraries, etc. I have been using Ruby, Java, Scala, Python, and Haskell mostly for years now. But just recently I started working on the 4th edition of my old Common Lisp book and some preparatory work on a new Scheme book. I have been enjoying the Lisp-way of bottom up interactive development a lot. Both general approaches have value. When doing machine learning it is great to have the universe of useful libraries for Python but for green field work that is more algorithmic, doing bottom up development in languages like Scheme or Haskell is also great.
- hiyou102 10y agoAt UBC CS a few years ago they made a switch in the opposite direction, from Java to Racket for their intro course. I think this was a very good decision because it allowed them to spend less time teaching syntax (which in racket is very simple) and more time focusing on fundamental topics such as graphs, recursion, functional programming, and test driven development. Compared to the equivalent intro programming course that was taught to engineers in C I think students in CS learned a lot more than the engineers whos most complicated curriculum involved arrays and procedure calls. What's interesting is that I believe the inspiration for teaching functional programming as an introduction came from MIT.
- wffurr 10y agoThe sheer amount of nonsensical boilerplate required in any Java program, even trivial ones, makes it a terrible language for teaching Computer Science. Think about trying to teach the meaning of "public class Foo { public static void main(String[] args) { ... }}" to a complete novice. Class-based design, inheritance, visibility, return types, arrays, etc. all right off the bat. It's too much. Scheme and Python both are much better choices for this alone.
- jksmith 10y agoSome snarky drift: Then post-college commercial reality sets in, where using mind numbing boilerplate supported by frameworks and heavy ides (as opposed to libraries, custom or otherwise, and an editor), is SOP. Join the programming masses and literally think inside the box(es). So why did you go to college now?
- int_19h 10y agoSo that you can realize that you're inside a box, and leave it on those few opportunities that present themselves (and, perhaps, specifically seek out such opportunities).
- __Duncan__ 10y ago"Trust the natural recursion"
- ziikutv 10y agoRead many comments, decided to make a reply on the main one so its easier to address them all. Many people suggest that it was a bad switch and that Scheme should have been kept because it helped them understand FP. I think it would be doing a disservice to other students if they didn't switch. The rationale given was a great one actually. OOO is there for a reason. I do not like the idea that FP is the answer for everything. I understand many students used Python, C++, etc. This was the case for me as well. I did not go to any lectures for the Introductory course. I spent my time wisely studying for other Engineering classes (in reality: I actually didn't do shit and did other activities). You should do the same too. What I am trying to say is, just because you already know OOO because you took the initiative before University (which I think - and I am biased - is a good thing to do), does not mean everyone else has. University is about teaching a body of students, all of education revolves around the mean of this body of students. It is a sad fact, but no professor or department or University will give you the unique attention you deserve; this is why I would not suggest University for that purpose. I only did University to get a piece of paper. I learned most programming stuff on my own time, before going in. Teaching OOO, an easier of the two (FP/OOO), is a good thing. And teaching it in Python.. is a great thing. Kudos to MIT I think instead, it is a better idea to keep Python/OOO as first year and in second year start teaching FP in whatever language. Or perhaps teach them both in first year. I think we just need to realize that when we go to University/School, we will have to walk at the pace of the "mean" even if that requires having to run (to catch up) or crawl (to slow down). Sad reality. Edit: I just noticed that if I press the post button twice, it makes two posts. I deleted the dupe.
- ziikutv 10y agolol down voted... typical HN circlejerk.
- deleted 10y ago[deleted]
- cs702 10y ago"And why Python, then? Well, said Sussman, it probably just had a library already implemented for the robotics interface, that was all." That, right there, is the reason why I end up using Python so often. As dynamic languages go, Python is not the best for anything, but it's good enough for almost everything, and there's probably already a library implemented for it.
- dTal 10y agoWell, that tells us something about you. But it doesn't exactly get to the heart of why people like writing libraries for Python. My theory: it was the first language to take a human factors approach to language design. Not the best, but the first. This design philosophy has the simple consequence that Python programs are by and large incredibly easy to read, understand, and modify, compared to its contemporaries. "Network effects" did the rest.
- calebm 10y agoI prefer "breadth-first" to "depth-first" for learning, which is why I think Python is a better language for learning.
- pcl 10y agoOne of the things I loved about the choice of Scheme was that nobody knew it, so it helped level the playing field. Also, it's a small language, so we got through the "here's Scheme" part quickly. That said, the rationale presented in the article is a really good one. Hm.
- nickbauman 10y agoI implemented the huffman trees (Section 2.3.4) in Clojure. https://github.com/nickbauman/sicp/blob/master/src/section2_3_4/huffman.clj https://github.com/nickbauman/sicp/blob/master/src/section2_... I loved the process. Scales fell from my eyes. I didn't get this with Python, even though I love that language too.
- finolex1 10y agoJoel Spolsky wrote a blog post about this a while back, about the advantages of starting off with a language that is less mystified but harder to grasp like C/Scheme over one that might be more beginner friendly: https://www.joelonsoftware.com/2005/12/29/the-perils-of-javaschools-2/ https://www.joelonsoftware.com/2005/12/29/the-perils-of-java...
- ivan_ah 10y agoI think SISP is an awesome book, but I don't see why it has to be Scheme, at least for the first half of the book. Let's not be too dogmatic about our shovels. A shovel is a shovel. For example, here is SICP with examples using the JavaScript shovel: https://www.comp.nus.edu.sg/~cs1101s/sicp/ https://www.comp.nus.edu.sg/~cs1101s/sicp/ BTW, since this site isn't super mobile-friendly, I made a modible friendly version a while back: http://ivanistheone.github.io/SICPapp/ http://ivanistheone.github.io/SICPapp/ (only first two chapters)
- jnordwick 10y agoThe Metacircular Evaluator should be a prime example of why Scheme matters. It completely loses focus into a mess of parsing and loses the idea that code and data are the same thing. Also that whole tail-recursion thing is kind of important.
- Myrmornis 10y agoAll I knew about Sussman prior to reading that quote was that he was an author of SICP. Now I'll think of him as a tedious and arrogant curmudgeon. Can someone give me a nice quote by him to make that go away?
- Myrmornis 10y agoTo be clear, that was a serious criticism. Pretending that there was no particular reason for choosing python is a classic case of being unwilling to credit others (python authors) for their hard work, and is thus arrogant, ungrateful and dismissive. Claiming that "back in my day programmers had to think hard" is a classic case of being tedious and curmudgeonly.
- tpallarino 10y agoPretty sad honestly. We used SICP and Scheme in the first computer science class I ever took and that is the most fun that I ever had programming. I remember I couldn't wait for new homework assignments to be released so that I could solve the fun puzzles.
- zumu 10y agoFor all those fondly recalling learning Scheme first, allow me to provide the opposite perspective (kind of). Learning Scheme as my first language scared me away from programming for years. Yes, solutions to problems were often elegant and puzzle-like, but accordingly, the tools and patterns often felt constrained and roundabout. For example, consider recursive patterns vs conventional looping patterns. In that class I often felt I wasn't learning a 'real' production programming language, but rather a language designed to teach me programming concepts. To that point, I think Python offers a much more robust and straight forward tool set, while also being friendly enough for the young developer to sink their teeth into. However, in retrospect I was just a bratty kid, who was learning a lot of valuable fundamentals. I'd like to think some of those have stuck with me to this day, esp. as functional patterns have come into vogue.
- agumonkey 10y agoI hope they take a look a pyret, language designed by a team of CS teachers from Brown. They have many good points on the value of pyret above scheme. Somehow a more formal view on programming (recursive ADT, tests), their students are learning fast with it.
- eecc 10y agoI trained electronic eng and never gave a thought to informatics, too much theory, more math than anything else, OOP and RUP is all there is to it anyways so whatever. I ended up in IT and programming, and when I bumped into SICP I regretted the 10 years spent without having read it already. Someone commented that it's the first and last book you should read at Uni, and I totally agree