Live data from Hacker News

Python is now the most popular introductory language at top U.S. universities

cacm.acm.org

341–350 of 375 posts

Re: Python is now the most popular introductory language at top U.S. universities

#341

Earlier quoted context omitted.

Our unit is a first year unit, and runs for twelve weeks. This means that we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement their own hashmap in Python and reason about its big O performance in one week, start programming in MIPS assembly the next week, and implement function calls in assembly and reason about…

Why does your data structure course cover assembly? I am just curious because in my school, they teach assembly bottom up, starting from digital logic and transistors and eventually get to C.

I think it's a combination of three factors:

1. Historically, before it was taught in Java, this unit was taught in C, and it would have been a natural transition from building data structures via explicit pointer manipulation to explaining stack frames as a specialised data structure for handling scoped variables in function calls.

2. Despite the move to a higher level language (and, from assembly and machine code, even C is a higher level language), it's good for the students to get some exposure to the machine model, and what is going on deeper in the stack of turtles.

3. The lecturer who runs the course also has a bit of the Yorkshirewoman in her. So students learn a tiny bit of MIPS like they should eat their spinach and shower with cold water, uphill both ways, in the snow, or something.

Re: Python is now the most popular introductory language at top U.S. universities

#342
post #325

I work at Monash University in Melbourne, Australia. Last year we moved our foundational course in data structures and algorithms from Java to Python, with great success. This is a course that used to be taught in C, then moved to Java. I tutored it as a Java course, and was in charge of adapting the tutorial (classroom exercises) and laboratory (programming assignments) materials when we started using Python to teac…

the most surprising thing I read was "Many of our students have never programmed with a text editor before" - what kind of CS students haven't tried programming before with a text editor? I find that incredible. Long before I got to university I was been programming by myself with whatever editor I could find, edt, vi etc

Yes, many of us here at HN were programming before going to university, or instead of going to university, but at Monash we are dealing with our first year intake, not with the typical HN commenter.

I hedge that many of our students have never programmed "with a text editor" before because:

1. Many of them have used spreadsheets in higschool to build quite complex formulas, and spreadsheet formulas are turing complete, so they have programmed in some form of another.

2. I didn't want to discuss this here in order not to muddle the debate, but our introduction to programming course is now ran on Scribble[1], a dialect of the Scratch family. So many of our students in this data structures and algorithms unit have previously done just 12 weeks of programming instruction, and understand many of the concepts, but our unit is the first time that they have to deal with (for instance) syntax errors in textfiles.

Many people here in HN were teaching themselves programming by age 6, but to repeat myself: you are not our first year intake. We teach the students we get. These are not bad students: they are often hardworking and smart, and do well and learn a lot in our unit.

They may be ignorant of programming, but that's also ok, because that's what we're there for. And, to go back to the OP's topic, using Python as a teaching language lowers the barriers for access to the concepts that we really want to teach: complexity and big O, searching and sorting, etc.

[1] http://monofonik.github.io/scribble/

Re: Python is now the most popular introductory language at top U.S. universities

#343
post #327

Earlier quoted context omitted.

"we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement their own hashmap in Python" that seems utterly pointless to me.

Maybe, I'd have to see the actual class. Remember that if this is a 4-year curriculum, they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class. And often, a class like that will spend time on analysis and algorithm design tradeoffs. The best way to understand why accessing a hashmap can be done in O(1) time is to actually code…

> they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class (...)

> This may simply be a preview.

No, this is it as far as the core units go.

This is the first course on data structures and algorithms.

There is a second year course that deals with further data structures and algorithms: we teach amortized performance, proofs by induction, some randomized data structures (skip lists and maybe another), different tree-based structures (I remember red-black trees and patricia trees), some graph search algorithms and a bit more than I forget now. And currently we are doing it in Python for the first unit, and in any language that the student and their tutor can agree on for the second unit.

Remember: these are just class exercises, not real implementations. Of course nobody is going to write actual functioning data structures in Python[1] and expect them to be usable for general purpose programming[2]. That would be daft!

[1] https://bitbucket.org/pypy/pypy/src/8920909d084ec0d42535b955...

[2] http://pypy.readthedocs.org/en/latest/

Re: Python is now the most popular introductory language at top U.S. universities

#345
post #146
post #82

CMU transitioned from Java to Python when I was an upperclassman there. I'm not sure what other similar places do, but CMU splits introductory courses into 2 parts - 110, 112. 110 is the basic programming with gradual intro to OOP and stuff. 112 is where the datastructures come in - it's a programming primer to implementing datastructures and algorithms, so to speak. Here is the issue I feel goes unnoticed as most pe…

Speaking as one of the people who helped lead the push for moving to Python in 15-110 and 15-112, the reduction of OOP was extremely deliberate. At the end of the day, Python won because it could be used to express programming concepts quite clearly in both an imperative and, to a slightly limited degree, functional manner, in ways that were appropriate for a variety of domains. And it did it in a way that substantia…

Professor Anderson,

You should go back to teaching Distributed Systems in Go next semester. Pretty please.

Re: Python is now the most popular introductory language at top U.S. universities

#346

Earlier quoted context omitted.

I've commented before in a variety of places that if I were to design a first-year curriculum that would have suited me best, it would start with python in much the way that is discussed in this thread, focusing on the concepts and algorithms and general concepts of coding. But the next course would be a hardcore introduction to C, embracing the language peculiarities instead of shunning them and trying to stick to c…

Indeed, I'm surprised by how often people make arguments that seem to assume the only options are C from the start, or no C at all. When you're teaching systems programming, all the things that have to be done by hand in C are precisely the things the students are supposed to be learning. But for almost everything else, they're pointless details that obscure what you're actually trying to teach. Teaching multiple lan…

> When you're teaching systems programming, all the things that have to be done by hand in C are precisely the things the students are supposed to be learning. But for almost everything else, they're pointless details that obscure what you're actually trying to teach.

Exactly.

Re: Python is now the most popular introductory language at top U.S. universities

#348
post #325

Earlier quoted context omitted.

the most surprising thing I read was "Many of our students have never programmed with a text editor before" - what kind of CS students haven't tried programming before with a text editor? I find that incredible. Long before I got to university I was been programming by myself with whatever editor I could find, edt, vi etc

Yes, many of us here at HN were programming before going to university, or instead of going to university, but at Monash we are dealing with our first year intake, not with the typical HN commenter. I hedge that many of our students have never programmed "with a text editor" before because: 1. Many of them have used spreadsheets in higschool to build quite complex formulas, and spreadsheet formulas are turing complet…

it might be easier to use groovy, for noobs it's basically the same as python and runs on the jvm, also you can introduce java gradually without changing environments.

I love python - used it for years, but I am dumbfounded that people enter a CS degree without having ever first tried to write a program. That's like taking english lit without having read a book before.

Re: Python is now the most popular introductory language at top U.S. universities

#350
post #289

Earlier quoted context omitted.

> I guess you agree that "impressionable students" should be taught that collaboration is essential, hence clear formatting is necessary and precise indentation (aka whitespace) is critical. Not particularly, no. Or at least I think that should be the IDE's problem.

*> Not particularly, no. Or at least I think that should be the IDE's problem. You still have to tell the IDE what to do with your code, which you do with brackets, I guess? So now your code is full of brackets and parentheses, which are naturally less readable (how many levels of parentheses do you use in natural language?), and their role is almost entirely to... help the IDE indent your code.

>how many levels of parentheses do you use in natural language?

2 or 3 (but I write mostly lisp (as a programming language) and I usually mumble them (the natural languages)..).

  (seriously.)
edit : screw commas, let's go nuts with parentheses.
Post reply on HN