Live data from Hacker News

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

cacm.acm.org

101–110 of 375 posts

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

#101
post #80
post #20

Earlier quoted context omitted.

Many of the better European universities teach FP languages in their introductory courses. Off the top of my head, Oxford and Edinburgh use Haskell and Cambridge teaches Ocaml.

Cambridge teaches SML, not OCaml, unless it's changed in the last couple of years.

[deleted]

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

#102
post #33

Python for web development is confusing as a beginner. I would go with PHP since everything is not magic and you can see things right away.

No reason to down vote because I prefer PHP for web development. In python you have to learn an entire framework just to do web stuff. PHP everything is right there is that simple.

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

#103

Earlier quoted context omitted.

I think it's important teach what's relevant in the current day, every likes to parrot the "Python 3 has no support" line but it's simply not true[1]. The developers have said multiple times there will be no 2.8 and the 2.7 line will only receive security fixes. Python 3 is the future of Python and not teaching it to students would be a disservice to them. [1]: https://python3wos.appspot.com/

Sure. My point is that nearly everything you learn about writing a program in 2.x is relevant to writing a program in 3.x. You do have to keep track of whether print is a statement or a function or how literals map onto types, and some libraries are imported using different names and some APIs have changed a bit, but if you understand all that jargon, it's not that big a deal (I'll repeat my disclaimer here about tra…

Well, yes, sure... core programming concepts are the same regardless of language used and/or version.

However, from my experience, most students don't venture off on their own until after becoming very familiar with a language. Not all students are experimental enough to hack on personal projects for fun or what-have-you. I've actually had a fellow student tell me the Java class file he emailed me for a project would only run on Java 6 since that's what the lab had installed -- obviously wrong.

The point being -- students will intern what they are taught. They should be taught on modern versions/concepts so they intern modern ways of doing things. By teaching Python 2.x to students, you do them a disservice by teaching them the way Python "used to" do it... not how it "does it" now.

As an aside -- with all of the major Python libraries now ported to 3.x -- I see little to no reason anyone should ever learn Python 2.x, or use it (with the exception of the obvious legacy codebase support issue).

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

#104

Python was heavily based on ABC, a language which targeted new programers and made syntax choices based on user testing: http://python-history.blogspot.ca/2009/02/early-language-design-and-development.html It says a lot about our understanding of our field that new languages generally do not formally test their syntaxes (and other "mental model" features) for usability.

If programming language selection for introductory university courses was based on pedagogical research on introductory computer science courses, I suspect Scheme would be nearly universal given its roots and nearly forty year track record. But that's not how languages have typically been selected for 15 years or so. The direct vocational skills argument has held much more sway.

I suspect that's how it came to be chosen at my alma mater. Lots of theory-heavy professors. Was a great experience learning in Scheme, btw.

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

#105

Honestly, I'm not surprised, but I believe this is bad news. Learning C programming (first) was probably the most advantageous thing that has ever happened in my life of programming. When you understand C you understand how the computer functions, and in turn can write better software. It prepared me for virtually all programming and has enabled me to understand concepts correctly, the first time, and has made my lif…

I think C makes a great second language. Use Python to teach if statements, variables, control structures etc - then later use C to teach low-level algorithms, pointers and how computers actually work.

I don't think there's any harm in learning Python first. I think they may be harm in learning C first - it's much more likely to frustrate people and potentially even put them off programming.

This is the same reason I dislike Java as a teaching language: having to tell people "don't worry about what public static void main(String[] args) means just yet" when teaching "hello world" isn't a great introduction to programming.

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

#106
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 teach the unit.

The main content of the course hasn't changed. Complexity, Big O notation, sorting and searching are introduced in the first two or three weeks. Students work through the usual implementations of arrays, linked lists, stacks and queues (both array and linked-list based), trees, heaps, tries, etc. All these data structures are explained first as chunks of data with external functions for the operations; then a second time as objects with methods for operations, once object orientation is introduced in week 5 or 6. Iterators are introduced as an abstract interface to list-, array- and tree- walking. Where relevant, we explain every operation twice, showing the iterative and recursive approaches. The course ends with two weeks of lower level work, where the students hand-compile pseudo-Python to working MIPS assembly.

The move to Python gained us, among other things, the freedom not to have to explain Java's generics and access modifiers. Many of our students have never programmed with a text editor before our unit, and dropping them into the big boilerplate world of Java micro-management was not good for them or for the course. We used to spend too much time on syntax and other details ("native types are like this, reference types are like htat") that we should have been spending on data structures and algorithms.

With Python, we even have time to explain idiomatic Python iterators and generators, and to discuss Python scoping rules (which come up again when we work on local variables in their hand-compilation tasks). So we still teach a bit of language-specifics, but we don't feel we are shackled to have to teach them. Also, teaching them idiomatic Python is a good deed after spending the first three or four weeks in a not very idiomatic subset of Python where we maintain explicit indices, update them by incrementing or decrementing them manually, use while loops the condition checking on the index value, etc. as required by the course content.

I don't have data on the results, because I was only the adjunct adapting the tutorial materials. The only difference I noticed was that students had less support from their IDE, and that some common errors (attempting to access attributes on None is the top one) that used to be picked up statically are now runtime errors, as expected. There didn't seem to be any big problems from Python's lack of lexical typing. Type errors are still caught, again by the runtime instead of the IDE and, if anything, this is a better exercise for students, since fixing them requires better understanding of what the program is doing.

If anyone is interested, I can ask the lecturer about the outcomes, but just from the fact that neither she nor anybody else teaching the unit has raised any issues the second and third times the unit was taught I can tell it's all going smoothly.

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

#107
post #7

Earlier quoted context omitted.

Unless your university is really weird, I can guarantee you will learn many more languages than just the intro language. When I got my computer engineering degree in the early 2000's I was exposed to C, C++, Java, Scheme & Lisp, SPARC & 68k assembly, and even a bit of Python. Learning Python as the intro language instead of C++ would have been much nicer for folks who were completely green to programming.

I would hope that no one in a freshman CS program is "completely green to programming".

That's ridiculous. What level of skill do you expect in an introductory program aimed at freshmen? Because that description sure seems like it should be tailored to someone completely green to programming to me.

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

#108
Help me out. I love the idea of Python as a first language. But do you think there's an issue teaching a whitespace-sensitive language as a first language? When students eventually move to Java/JavaScript/C#/Swift/whatever, will this be more difficult?

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

#109
I've always been of two minds about this. My intro course at MIT was in Scheme, a class that has since been renamed and is now taught using Python. On the one hand, it was a great course, and the FP was an awesome mindfuck (previous programming experience: TI BASIC). Though I took it all for granted at the time, it definitely set me up to think about programming better for years, and I still reread the book sometimes. The downside was that for a little bit, I couldn't really program in anything really practical, because by 2001 Scheme kinda wasn't. In other courses, I found myself crunching data with Perl that I only sort of understood, or writing C programs in situations where C probably wasn't the ideal tool, because it was the only other language I really knew. The thing where people say "once you know all the theory, you can learn a language in a couple days" isn't really true, and anyway, you probably don't have that couple of days. Point to Python.

So the question is really: can you use Python to get most of the benefit of teaching using Scheme while at the same time giving the student a practical tool for future use? I haven't taken the new Python courses, so I don't know how well the material bends to the language, but I remain skeptical of the "most of the benefit" part. Maybe I'm just a curmudgeon, but I sort of think they should keep Scheme and then just have a short (e.g. over IAP) course on practical programming techniques using Python (or whatever). Or maybe someone should rewrite SICP in Clojure? Finally, I know Scheme has continued to evolve, and I wonder if it's really still true that Racket is impractical as a day-to-day language.

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

#110

In college our intro classes were in C++. While its a tough language I do wonder if it was advantageous to forcefully learn about 1) value vs reference types via pointers and 2) how allocation maps into memory space. Not having that level of depth kinda worries me

Sure, but a systems-oriented course is the right place to pound that into people. Not CS1.

CS1 should be an introduction to the nature of the discipline. I can think of many things more important and more representative of the nature of computing than the semantics of C.

Post reply on HN