Wednesday, July 09, 2014

As The Top Universities Go So Goes Who Actually?

Philip Guo had an interesting post on the Blog @ CACM titled Python is now the most popular introductory teaching language at top U.S. universities which summarizes his survey of the 39 top US PhD granting university CS departments. It’s interesting that Python now has a slight edge over Java in those universities. But what does that mean for high school CS? After all that is where I teach and where my current main interest resides.

Does it mean anything at all? There is a big difference between high school students and university students. Sure I have some students who could (and will) get into those top schools but a) most of my students will not and b) even those students are not up to college level work as freshmen or sophomores when I teach them their first programming course. What works at MIT may very well not work at the average high school.

The article doesn’t go into why universities chose Python (or what ever language they did teach) so it is hard to evaluate a need or even a reason to change at the high school level from that article. On the other hand I know that a lot of schools at all levels (middle school though university) are moving to Python. There are a lot of popular options in K-12 that do not show up at the university level.

Scratch is the only visual, blocks-based language that made this list. It's one of the most popular languages of this genre, which include related projects such as Alice, App Inventor, Etoys, Kodu, StarLogo, and TouchDevelop. The creators of these sorts of languages focus mostly on K-12 education, which might explain why they haven't gotten as much adoption at the university level.

So even though they are not used by universities they are used at the earlier years. That makes sense because of the age, maturity and experience level of younger students. Just because universities jump to a new first programming language doesn’t mean that high schools should jump the same way.

Now I know that the AP CS A course tends to follow universities. The exam followed from PASCAL to C++ to Java in its history. Will it follow to Python? Quite possibly if the justification is there. Honestly though I think that if AP CS A is a high school students first experience with programming that is not a good thing.  The article mentions the importance of a first impression of computer science.

Because the choice of what language to teach first reflects the pedagogical philosophy of each department and influences many students' first impressions of computer science. The languages chosen by top U.S. departments could indicate broader trends in computer science education, since those are often trendsetters for the rest of the educational community.

I believe that we have to be a bit gentler at the high school level than the university can be. That is why I don’t automatically follow the lead of the “top universities.” Still I think II ‘d like to see my students have some exposure to Python before they leave high school. Maybe as the first language, maybe as a second or third. I have to learn more about the language and teaching with it first. More learning for my summer I guess.

What do you think about Python? Are you using it to teach in high school and if so what advantages do you see with it?

8 comments:

Garth said...

The language used by the universities I think should be the exit language for a high school CS program. By the time HS CS kids hit senior year hopefully they have had a few early semesters of CS and have decided that is a direction they are considering for their university direction. In that case the HS should look at the popular university languages. As for Python vs Java I really do not have enough experience with Java to compare them at a higher level but for beginners (2nd semester of HS CS?) I will say Python is a bit more friendly. OK, a lot more friendly. There is none of the "I will explain what you just typed later in the semester" type of nonsense. I am doing Java with my advanced class this coming semester ONLY because it is the language the local university uses. But these kids have seen several languages already so it should not not corrupt their minds more than I normally do. If it were up to me I would stick with Python.

Laura said...

I'm a big fan of Python. I use it in both CS I and CS II. My advanced classes use Java or C (for Physical and Mobile computing). I picked up Python very quickly. I had tried to learn Java and found the syntax frustrating (still do, but I just muddle through). Also, you can do a lot with Python without having to deal with objects. My entire first year course doesn't touch objects. The second year is all objects, which Python handles very well. I think having a language that avoids getting bogged down in curly braces and semi-colons is a good choice for a first language. You want to focus on concepts and Python lets you do that.

Mike Zamansky said...

Every language has trade offs. When APCS went to Java from C++ we lost memory management but had language that encouraged more consistent usage. If we go to Python we lose static typing but also lower the cost of entry and get a multi paradigm language

We use Python in the second half of our intro as well as in my SoftDev class where the GIL presents some interesting problems.

We also use Scheme and NetLogo early, Java in the middle and JavaScript along with Python and C late. It's all about the right tool for the right job -- what do you want to get across to the kids how and when.

Mike Zamansky said...

There's also no reason to think that colleges know what they're doing -- not everyone is happy with MIT's change from Scheme to Python.

Also, a surprising number of my graduates who have gone on to Harvard tell an interesting story.

They talk about how CS50 is really popular but doesn't really teach anything. But, the nature of the class ropes kids in to CS.

The kids tell me how the CS50 grads are then are dumped into the next course which is hardcore functional programming using OCAML and they all die and drop.

I wonder if UC Berkeley is going to see something similar given the success of CS0 or if they've updated the rest of their sequence to retain kids that they've hooked.

Alfred C Thompson II said...

Mike you make some great points. It does seem at times that universities make changes based on fads or "shiny new objects" sometimes. High schools tend to be slower to adopt new things, in CS anyway, as they wait for evidence that something actually works. Though some of us do like to try new things as well. :-)

Mike Zamansky said...

Alfred -- it's kindof funny how much new stuff we do - aren't we supposed to be two of the dinosaurs of K12 CS Ed.

Garth said...

I sort of see it the other way around, universities are glacial change, high schools can change quickly. But then I am at a private school not run by committee. I can jump on any band wagon in a moment. The only reason I am following the university's lead is I have kids that end up going there and it will make it a little easier for then if they have already been prepared for that university. "There's also no reason to think that colleges know what they're doing". Chuckle, for sure. Undergrad courses seem to be at least 20 years behind the times.

Michael S. Kirkpatrick said...

Regarding the question of why to use Python over Java, Garth hit the nail on the head. Java is an atrocious language for an introduction to CS. From the start, it trains programmers to write code they don't understand. At a minimum, writing a simple "hello world" involves "public class," "public static void," and "System.out." This induces bad habits and a really bad cookbook approach to coding. It's one thing to leverage encapsulation and well-defined interfaces to lower the cognitive load; it's another to push students into the habit of copying and pasting dozens of lines of mysterious code because it worked before.

Mike brings up a good point when comparing CS0 and CS1. I'm actually not entirely opposed to the model of making CS0 very easy and CS1 hard. The two courses serve different purposes. CS0 should provide non-majors with some of the basic concepts (e.g., algorithmic problem solving) without inducing too many headaches. So I am all for using languages (e.g., Python) that reduce the cognitive overhead for CS0.

CS1, however, needs to provide students with a more accurate picture of the major. I'm not convinced that Harvard's approach is the right way (in fact, I would argue it's not). Yes, retention is important. But the difference between CS0 and what computer scientists do is so vast that it does a disservice to send a false message. I've seen it happen too many times where a student gets about 5 courses into the major and decides they hate what the work actually is, but they feel trapped. They've got sunk costs and feel they have to stick it out. There just isn't an easy solution, though.

As for there being "no reason to think that colleges know what they're doing," I would amend it thus: "no reason to think that top R1 universities know what they're doing." It's about the incentive structures. Absolutely NO ONE gets tenure at a research university for spectacular teaching. And there are very, very few CS faculty at U.S. institutions that build their careers on CS education research (Mark Guzdial and Beth Simon are the two that come to mind...others like Lorrie Faith Cranor and Kathi Fisler do a lot, but their primary contributions are in other areas). When I was working toward my Ph.D., I was actually told that I should spend at most 1 hour per week preparing for classes. It is a very common mistake in academia to conflate expertise in your area with the ability to teach it. Having said all that, though, there are many, many other institutions that place a stronger emphasis on teaching, and their faculties DO know what they're doing.