Live data from Hacker News

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

cacm.acm.org

251–260 of 375 posts

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

#251

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…

I do not know any Python (yet) - and my comment is probably off-topic. I spent a fall semester at Northeastern U, Boston in '97 and took a graduate course in Data Structures which was taught in C. I loved this course and finished top of the class (It helped that I was already familiar with C from an undergrad engg course). I fell in love with C. Implementing dequeues, linked lists, trees etc. with C was a pleasure - I learnt a lot about memory management responsibilities, smart error handling and began to understand how programming can be beautiful. Many years later when I started learning and working with Java, I felt that if this course had been taught with Java, I would not have gained as much (I could be wrong). The simple steps of typing your code in the standed editor supported by the environment (we were using a flavour of Unix in school), saving your work, compiling on the CLI and seeing the results - we just had to focus on our algorithm and nothing else. Your sentence "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" stands out for me in this context. Since I know zero Python, I wonder how it compares. This reminds of Joel Spolsky's essay : http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...

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

#252

I know, I know, what I'm about to say is just an artifact of the Language Wars and will cost me karma. I can't help myself. We should not be teaching impressionable students that whitespace has semantic significance. This is a fundamental design flaw of Python, and it's just a Bad Idea. Sorry, Guido.

Iagree100%.Therereallyisnoreasontoattributetheattributeofseman ticallysignificanttowhitepsace.Justasineverydaylanguage,comput erprogrammersshouldhavethefreedomtonotusewhitespaceastheyseefi t,justasmusicshouldnothaverests;it'sonlythenotesthathavemeanin g.Finally,gentlepeople,Iimploreyouthatwallsinhousesshouldbemad einfinitesimallythin,too,becauseIseenoneedtoseparateanything.

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

#253
I'm an undergrad at one of the outlier schools (UCLA) where a combination of the quarter system and a relatively conservative CS department make for an interesting undergrad curriculum. Our "CS 1" is taught in C++ and is mostly dedicated to well, C++. The entire first course is essentially dedicated to teaching you how to not blow your leg off while managing memory.

We don't even touch data structures, algorithms, composition, inheritance, etc until "CS 2," which is also in C++. When I first tried Python as part of a 1-week assignment in "CS 2.5" (a lab course), I was blown away and hooked pretty quickly. We don't get formal Python experience really until the extremely work-intensive upper division programming languages course. From my perspective, I think a large number of people are discouraged by CS 1 and how it's more of a programming class than a CS class. The only benefit of a C++ introduction is that it's easier for people to transition to C and lower level code for the operating systems class. Still, C is pretty well covered by our "CS 2.5" and "CS 3."

Other fun facts: our CS 0 (programming for non-CS majors) is split into three classes and is also in C++!

I accidentally took a C++ at a community college during high school and was forced to skip "CS 1" when I enrolled for my first quarter. I felt so unprepared for "CS 2" that I actually audited a good number of "CS 1" lectures and did half of the projects for the class even though I didn't take it.

Actual course numbers:

CS 1 -> CS 31

CS 2 -> CS 32

CS 2.5 -> CS 35L

CS 3 -> CS 33

CS 0(a-c) -> PIC 10(a-c)

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

#254
post #239

A few points that will likely get lost in the noise here: 1. It is weird to take the top graduate schools and ask about what they teach to undergrads. I'd rather see this done with the best national universities list - http://colleges.usnews.rankingsandreviews.com/best-colleges/... - as the basis for this study since that's where the top undergraduate students will end up. 2. I'd rather see trends than raw numbers -…

It would also be useful to include liberal arts colleges. I don't think it's representative of top institutions if you only consider research universities. For example, Harvey Mudd, has a top notch CS program, but wouldn't be considered under that metric as it doesn't have any grad programs.

I'd be interested to figure out the whole intro sequence. For example, my college begins with Java for the first class, then the next two classes can be taken concurrently, which respectively consist of functional programming/basic CS theory in SML, and Data Structures/Advanced Programming (memory management!) in Java and C++. I'm sure a number of other colleges follow similar procedures.

Also - I don't think that "CS0" classes should be included on this list as most are not taught with the intention of further CS education. For example, we have an "intro" CS course that is taught within the context of cognitive science (in Python).

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

#255
post #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.

I agree, there's no reason to downvote you for that. However, php only comes with "everything" if you assume it is already installed with a web server. As far as I know, you can't use the php (dev) webserver to serve php scripts without additional configuration.

Contrast[1] with python:

    mkdir cgi-bin
    cat  cgi-bin/hello.py
    #!/usr/bin/env python3
    print("Content-type: text/plain")
    print()
    print("Hello, world")
    eof
    
    #try to run:
    ./cgi-bin/hello.py
    bash: ./cgi-bin/hello.py: Permission denied
    #fix error:
    chmod u+x ./cgi-bin/hello.py
    #test in console:
    ./cgi-bin/hello.py
    Content-type: text/plain

    Hello, world
    #Ok, does it work on the web?
    python3.4 -m http.server --cgi 8000 --bind 127.0.0.1

    #open localhost:8000/cgi-bin/hello.py
So, how can I claim that this convoluted mess is "simpler" than php? Because everything is right there, and everything can be explained conciesly (contrast with apache configs, getting the www-user right etc). You could build on what the students know of print() and string interpolation/concatenation to output html/use templates etc.

Is this how I would start teaching web programming in python? Probably not -- but it might be useful as one approach, assuming we've started with doing some stdin/stdout stuff, and showing how we can do the same on the web. Crucially showing how if you know how to read a csv file with values, do some aggreation and format it as a text table, you can output it as html, as text over the web, or even as json paired with javascript. That again generalises to database access ... etc etc. It's python (and "invisible" c) all the way down.

[1] Comparing using a fully wrapped up install of webserver+php (either mod-php or fcgi or what not) would a) not be fair, because if you really learn python, you have all the tools to examine the whole stack (well down to the OS level anyway), and b) fair comparision wouldn't be to python but rather with something like web2py, that also bundles a lot of infrastructure.

YMMV and all that, my only point was that there isn't really anything "simple" about web development -- it's distributed development with not very clearly defined security, state or even messaging semantics -- it's a mess. A useful mess, but a mess.

[edit: formatting, spelling. Aslo I agree flask is probably a much nice place to start, if one isn't building on an introduction involving text/console i/o]

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

#256
We had an intro to programming course at our college (NIT, Srinagar) which was based on C. Seemed perfectly alright, after some thought, because most of my batch mates had never programmed before (and there was a significant population who had no access to computers prior to college)

Since I'd been programming since I was 11, it seemed a little arduous to sit thought classes explaining what a variable was, etc..but in the end, I understood they had to do what was best for the whole lot, and obviously couldn't teach something more advanced to an underprepared set of people.

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

#257

Hey there! I've just started learning to code for building web apps (I know about Fortran 90, it doesn't fit very well on the browser haha), and it took me a while to decide. I looked up in an endless number of hacker websites, but at the end I'm sorry for betraying Python lovers... I'm learning ruby on rails..! I've just started learning, please tell me If it's best to learn python (I'm not looking for an easy langu…

When you say you've just started learning to code for building web apps, do you mean you (a) already know HTML/CSS/JS and now want to learn a server side language, or that (b) you are going from no experience straight to server side programming? Regardless of whether you learn Python or Ruby, there is practically no way around having to learn HTML, CSS, and JavaScript for building web applications. You will be readin…

Hi, I'm afraid it's (b). I have no web development experience.. It all started last year when I had an app idea, I started developing it with some computer science students but I realised that if I'm the creator of the idea and I cannot build it, I can only be like the commercial guy in charge of making money out of the programs those students make! And that wasn't the purpose! So now I've just got into web development from cero (fortran 90) to be able to create a kind of prototype of the product, so it's exactly as I imagine it.

I've started with the ruby course on codecademy, it seems it's just like a fun introduction to the ruby syntax. When I finish the codecademy course I'm thinking about going into "onemonth.com" for learning rails, and codeschool after that..

Thank you! I'll get started with those languages as well :) I'm focusing on web apps, but I'll have to use JS to take the idea to phone app (using Titan from appcelerator)

By the way! Thanks for the invite to the course! I'll contact you as soon as I find out how to send a PM haha

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

#258

I know, I know, what I'm about to say is just an artifact of the Language Wars and will cost me karma. I can't help myself. We should not be teaching impressionable students that whitespace has semantic significance. This is a fundamental design flaw of Python, and it's just a Bad Idea. Sorry, Guido.

Iagree100%.Therereallyisnoreasontoattributetheattributeofseman ticallysignificanttowhitepsace.Justasineverydaylanguage,comput erprogrammersshouldhavethefreedomtonotusewhitespaceastheyseefi t,justasmusicshouldnothaverests;it'sonlythenotesthathavemeanin g.Finally,gentlepeople,Iimploreyouthatwallsinhousesshouldbemad einfinitesimallythin,too,becauseIseenoneedtoseparateanything.

Please don't break everyone's formatting by writing something quite so long that won't wrap. Thanks.

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

#259

Every intro to CS course I've ever been in has been in C++, it has always saddened me to see Java being the intro level course today. Now to see Python at the top of the chart makes my head want to explode.

I learned C++ first, then Java, then more recently Python.

I really feel like I'd have rather had Python or Java first instead, if only because being concerned about all of the strict formatting and structure in a C++ program puts a level of unnecessary complexity in front of the goal: to introduce a person to programming logic and solving problems with programs.

Those complexities are certainly important, mind you. But not as important as clearly opening the mind to the way a programmer thinks, IMO.

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

#260
post #177
post #60

Earlier quoted context omitted.

And this exactly what everyone needs in the beginning. Simple and clear syntax where you are able to produce results in a short amount of time to keep you interested. I just remembered some people i learned with who struggled along time to get behind the concept of pointers and how to use them when they thought us c/c++ as an intro language to programming.

C is not great but bearable as an intro language, mostly because K&R is a good textbook and the language is small. C++ would be absolutely horrible. Is anyone doing this?

Yes, quite a few Portuguese universities.
Post reply on HN