Hacker News new | past | comments | ask | show | jobs | submit login
Why MIT now uses python instead of scheme for its undergraduate CS program (muckandbrass.com)
43 points by bootload on Sept 24, 2009 | hide | past | favorite | 38 comments



When you look back at school, do wish you'd done things you couldn't do now? Or just more of what you're doing now?

Python? You can learn that over the weekend while you're working an internship. You can learn to engineer real world systems by taking up said internship, or taking part in the school's RoboSoccer team (If you win much at all, you're going to have a giant codebase. When I was at CMU, we had over 200mb of C++ code which was a lot to look at if you were a student).

I'm not a fan of teaching "real-world" systems stuff because it's nonetheless easy to learn incrementally. If it weren't easy to learn incrementally, it wouldn't have become such a mainstream real world tool/system now would it?

It depresses me to say this as engineer but it's true. Real world systems are a pain in the ass, they take a lot of time, patience and experience to manage, but are they mentally challenging in a way like Lisp? Not so much.

Lisp is one of those things with a giant, intimidating barrier to entry-- the sort of things they need to teach in school.


Point well taken: School is a time to learn things that the practical world won't pressure you to learn, and you will learn the practical stuff once you're hired.

But. I have seen so many college graduates, who've spent four years taking classes and passing exams, who still can't program. Programming is a craft. You learn it mostly by writing real code. If you lack the craft knowledge, the deep, theoretical insights are just words.


Having people practice programming in school is well-intentioned, but does it work? I went to CMU, which has a reputation for programming rigor. Just a month ago, a former classmate asked me if adding two doubles would preserve the fractional component.

Now keep in mind that this was someone who had to learn how the IEEE double is actually implemented (i.e. how they represent it in 64 bits), who had once implemented his own network stack --in C. I was surprised because most people I knew who didn't like programming had quit doing it years ago.

See, you don't make good programmers by teaching them python in intro any more than you make good programmers by teaching them how to write their own network stack.


One of the hardest things for a lot of people is learning how to learn things as they go. It's such an essential skill that you take it for granted, but many (most?) people come to university with the assumption that everything they'll need to know will be spoon-fed to them. (This is especially common among students from China, but it's a problem with people from everywhere.)


I love python, so I think this is fantastic for the language and the community.

I was taught Java at school... I hated it even then.

However, the higher level languages abstract away the core of computer science. ANSI-C is what should be taught IMHO, so all the smoke and mirrors are removed and THEN you can appreciate the higher level langs and their lovely (sometimes) abstractions.


"However, the higher level languages abstract away the core of computer science."

OK, but what is "the core of computer science"? Is it CPUs based on the von Neumann architecture, or is it symbolic manipulation?


It's both. It's the lambda calculus and the turing machine.

It's useful to understand both the way that the machine works, down the the assembly level, and if possible below, since it lets you write code that fits the way the hardware works well. It's useful to understand the symbolic side, since it lets you reason about algorithms, and write code that fits the way mathematics work.

You can't get away from either.


Heh, that's a good question. I was thinking in the context of von Neumann arch, but it's a good argument that it's symbolic manipulation. In that case, any language will do... but the best programmers I know almost intrinsically know the von Neumann architecture and they're C programmers too :)


I'm not entirely sure that the craft of programming has a great deal to do with the core of computer science.

A programmer develops software for the hardware of today, so good programmers had better be well acquainted with von Neumann’s architecture.

Theoretical computer science doesn’t need that architecture. It also needs mathematicians more than programmers, I think.


The University I'm at (University of Canterbury, Christchurch) is switching from Java to Python for 2010.

The main reason is that we loose ~10% of the undergraduate enrolment explaining why hello world is:

public class Main { public static void main(String[] args) { System.out.println("Hello World"); }}


I'm at the same university, and I feel the movement away from Java for introductory programming is a step in the right direction, primarily because of this initial learning curve. The example you've given perfectly demonstrates why Java should not be used as a teaching language - just getting a simple program running, you have thrown at you classes, methods, arrays, packages, access modifiers etc; this serves as a large barrier to learning the important programming concepts.

This isn't a call to "dumb down" Computer Science - the curriculum should still be challenging, but Java is the wrong kind of challenging. Students are spending more time learning how Java works than learning how to program.

We're losing a lot of students who might otherwise love programming if they could see the beauty of it earlier on. Having students learn using a Lisp would be better (hooray for minimal syntax!), but Python is a nice compromise.


BlueJ is a pretty good solution to this since it lets you play around with objects and methods before you ever have to write public static void main etc. In fact, in "Objects First With Java", the book we used in my first Java class, the main method isn't even introduced until chapter 7.


I'm TAing an introductory programming class, and the reason we lose people is because programming can be hard for people to wrap their minds around. Loops are easy for you and me, but for a bewildered freshman who's never seen them before, translating a simple problem into actual looping code can seem like an insurmountable brick wall. Ever seen someone write "for" and then stare blankly at the screen for the next half hour? It's painful to watch.

(I just got back from helping a bunch of freshmen try to test a number for primality. It was brutal. And we're using a language without all that "public static void main" stuff, so that's not even an issue.)


What language is that?


We're using Matlab. I'm teaching electrical engineering students, so they're going to have to know Matlab soon anyway. It's got fairly straightforward syntax, very nice vectorized array operations, and a read-eval-print loop so you don't have to waste time compiling. It's not as pretty and pleasant as Python, but the difference isn't significant at that level.


Maybe, but only if it was taught in sequence with a high level course. From my experience, you need both. While it is incredibly useful to learn about the low level stuff, you want be able to hold on to students as easily if it takes you a week to teach them how to do "Hello, World." Just going off how my knowledge has gone, I would say a sequence of High Level OO language->Low level language-> High Level Language-> Functional Language, although that is more of a college level course sequence, not for high school courses.


You need a curriculum, no doubt, I'm with you 100%.

I think it's especially important to teach different paradigms. I've noticed for myself, that functional languages "gel" better for me than do object oriented languages. That doesn't seem to be the norm afaik, but I wish I would have been exposed to functional languages earlier in life.


Seriously, come on, its called Hacker News, not Hacker Archives. I know its not completely unheard of for the site, but it just seems like this one has been posted a few times now. Where was that search function again so I can look it up? But anyway, when this was news, I seem to remember someone mentioning that Gerald Sussman made a few comments on it. I think he said it's still used for many classes, including some of his more advanced classes, and that when asked why he thought they chose it over Scheme for SICP he said probably because of libraries, especially to control the robots they were using in the class.


Perhaps a more accurate description would be "Hacker Things That Interest a Significant Number of Hackers at the Time when they are Posted". But that's a mouthful.


Yes on all points! :-)


i didn't appreciate it to it's fullest at the time, but when i reread SICP and it seemed like a review, i was grateful for that semester.

even though i program python on a daily basis now, this is saddening.


I absolutely agree. Python is a wonderful language that made me rediscover how fun programming can be.

Still, SICP was transformational experience for me. And it wasn't transformational because it was a kind and gentle intro to CS. On the contrary, it was a slap in the face of my silly imperative programming habits. It made me pause and reconsider my preconceptions about computation and computers.

In this sense, Python's biggest strength (expressiveness and ease of use) is also its biggest weakness. It will let you get away with having a bland and linear understanding of computation. A good intro program should make you acutely aware of how little you know, and still yearn for more.


"A good intro program should make you acutely aware of how little you know, and still yearn for more."

I agree completely.

A good intro program should also be enough to give you enough tools to do something useful and meaningful, even if you can't compete with someone who goes through the full course.

One heck of a balancing act to pull off, there. Python still has my personal "best balance" vote.


Northeastern University (right across the river) uses Scheme/How To Design Programs for the intro CS course then uses Java/How To Design Classes for the second CS course.

We've got one of the best (I think) CS programs in the country: http://www.ccs.neu.edu/undergraduate/data/ug2009/CSBS2009_Sp...

FP Scheme -> FP Java -> Java with mutations -> other languages is a great way to build on people's intrinsic knowledge of programming.


I often wonder how it'd be if AP Computer Science was based in python.

I took AP Comp Sci in high school with C++. I aced the exam. Yet I cannot program crap in it and always felt limited. I did feel like I'd "graduated" in some ways after being able to say "yes I can do C++" at least for couple months after the class ended.

On the other hand if I learned python, I could do sooo many useful things a lot earlier in my programming career.

May be someone can elaborate more on why C++/Java is better than pyton for AP Comp Sci. I'd like to think it provides a better intro even if it's a pain in the ass. Am I right? On the other hand, I do think it discourages lots of people that are on the edge. I had friends who were genuinely trying to learn C++ and programming in class but had to really struggle. They left with the impression that doing simple stuff is a very difficult. In that respect, C++/Java communicate a very wrong sense of what is possible with little effort through python etc.

I know if I my first programming experience was in C++/Java I'd run away in no time. It doesn't strike me as a coincidence that some of the best programmers started with BASIC. Yet we try to dump C++/Java into high schoolers who have not typed a line of code before.


"... May be someone can elaborate more on why C++/Java is better than pyton for AP Comp Sci ..."

"c" rather than cpp because it's "lingua franca of programmers" ~ http://www.joelonsoftware.com/articles/CollegeAdvice.html


AP teaches what a plurality of colleges teach. Ten years ago, most colleges taught C/C++, and so did AP; when the balance switched to Java, AP switched as well.

I heard earlier today that CMU will be switching its three basic programming courses from Java and C to Python within a few years (and changing its mid-level algorithms course from Java to ML). With CMU and MIT both teaching Python, you can bet a cascade of lower-tier CS departments will follow, and then AP will as well.


UMich's new Informatics major (AFAICT, it's like Java-school CS) is doing Python for the intro programming course, and grad students in the School of Information also do Python. http://www.pythonlearn.com and http://www.si502.com/ respectively. Don't know whether these are good courses; in some sense I think it must be hard to have a bad introductory programming course.


C++ was the language taught at my university - I was indifferent at the time because it was what they taught and I started writing practice apps in C++ the summer before I started school.

As soon as I went to work for a game developer (my first industry job), everything was C and my thinking about programming languages evolved much more than when I was at Uni. I was left thinking why C++?

The year after I left school, the department switched to Java. I guess they know best!


Is it just me or is the python being taught not very good? See for example this lecture: http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute.... The prof starts off by saying that internal class variables should not be accessed directly through the instance, and rather through attribute accessors. The example code with the lecture posted above is littered with what I would I call messy python. Messy attribute setters and getters, catching KeyErrors instead of using .get() on a dictionary, etc.

If you're going to teach using python should you not teach pythonic practices as well? Or is it just about the CS? Otherwise there will be a bunch of MIT grads who will have to relearn python if they ever intend to use it in industry which seems to be the goal. The majority of the comments here seem to be in favour of teaching python because python is fun. Teaching python like java seems to me to take the fun out of it.

If academia chooses a language to teach with should they use the common practices of that language, or does it not really matter?

*edit for formatting... I'm new here


MIT has posted the course and video lectures online, in case anyone was interested: http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute...


I am currently an undergrad at Berkeley. I really like the current structure of our computer science program. We start in Scheme for Intro to CS, move to Java for data structures, and finish with C and MIPS for machine structures. After that, the upper division courses are either C++/Java/Python.


I'll be surprised if you tell me that the end result isn't usually undergraduates who can produce mediocre, unidiomatic code in any of 6 languages. (I've no personal experience with Berkeley grads, just general cynicism.)


This would be true for any undergraduate program. Quality of the people is more important than the quality of the material used for instruction.


Why? What do you see wrong with the Berkeley curriculum?


cema had it right -- undergraduates in general like to optimize away their education.


Ok. I think you mean that they'll spend their time learning the basics of 6 different languages without getting in-depth in any of them.


I think there is two problems with this:

The first is that SICP is one of the most influential, well-written and essential textbooks written for computer science. This is especially true now, as most undergraduate students do not know what functional programming is or what it is good for.

The second is that I think the major appeal most people have to python is that it feels very 'natural' to program in, after years of slugging it out in the other languages. But going with the best-case scenario is dishonest and not always best way to approach teaching.

As an aside, when Lisp was introduced in my first year introduction course, it was described as slow, old and unused. There was no mention of modern Lisp dialects or any other functional language for that matter.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: