Tuesday, March 08, 2022

APCS A–Java or Python?

There is a lot of discussion about moving the Advanced Placement CS A exam to Python from Java. The Collegeboard is reluctant to do so. They see APCSA as the equivalent to CS1 or the first course for CS majors in university. They cite research that indicates that APCSA students for very well in CS2 (usually data structures) and that CS2 is almost always taught in Java or C++. On the other hand, at many universities the purpose of CS 1 is growing and the audience is widening to include students from many different majors. I wrote about that yesterday (What Should APCS A Really Be About?) Mike Zamansky took it on on his blog as well (SIGCSE 2022 - What language APCS-A part 1 - the intent)

It seems like we have to first agree on the intent or purpose of APCSA (and CS1) before we discuss language. Given that agreement is never going to happen – CS people can’t agree on anything. So I will start my discussion from the standpoint of APCS A should increase diversity in computer science and prepare students for using computing in CS as well as other disciplines.

This is a concepts first decision not a language first decision. I feel that non-CS majors need the same concepts as CS majors. SO what are those concepts? Not a lot changes except that in computing widely APOs are bringing far more critical than they used to. They enable programmers to easily do things that used to be hard. They also more things we used to do early to later in a CS major.

Sorting is one example. With so many libraries to do sorting why should we spend a lot of time in a first course having students write sorts? We know they sorts they will write are not going to be up to the standards and power of sorts they can call that exist already. Algorithms? Surely there are other algorithms we can focus on to help students learn to study problems and developing algorithms?

So if we want to increase the number of students who study computer science beyond the limited scope of would be computer science majors preparing students for CS2 loses some power in the argument. And Python gains some because of all the APIs that are available and all the other disciplines that are already using it.

At SIGCSE, the panel members arguing for Python talked about much of what I write above. They also talked about Python avoiding some of the “cruft” of Java. How much easier “Hello world” is in Python for example. The “other side” focused mostly on the costs of changing and not specific criticisms of Python. There are things about Python that people do raise. It’s dynamic typing rather than Java’s strict typing. I’m a strict typing person myself but I can be open minded. Also the use of white space. Now it is not clear to me that either white space or curly braces have advantages over the other so I see that as a wash as well.

The post panel poll, FWIW, had 57% saying to switch to Python and 28% saying “keep Java” with the rest being answers all over the map.

I have no dog in this fight since I no longer teach AP CS but I am leaning toward that it is time for a change. I like the idea of a high school course, even on modeled on a university course, preparing a wider range of students for a wider range of majors.

The Collegboard is going to do what they want and the costs of changing may be as big a factor as anything. They are also driven by what universities do and as universities revisit the purpose of CS1 that will have more impact on anything anyone in high school has to say.

Mike Zamansky has a different take on this at SIGCSE 2022 - APCS-A Language strengths and weaknesses

1 comment:

  1. Phrasing this question as "Java or Python" is fun, but it traps you into a way of thinking that is not useful. By doing what Mike suggests and beginning at "What is the purpose?" we might find that the answer is both, neither or it doesn't matter.

    At the end of the day AP CSA must teach the first in major Computer Science course so that it can be used to replace a college course. As it is I am already recommending that students take dual enrollment rather than AP courses because they tend to be less fickle when it comes to resulting in future credit. In some cases that course may be offered to non-majors, but that isn't relevant. AP CSP is already placed to engage more students and therefore AP CSA needs to retain some of the rigor to match the college experience.

    With that being said I think that you and Mike share a different view of the introductory CS course than I see. As I pointed out in a comment on his article, the colleges that my students would like to attend frequently shift languages using the same basic course description and syllabus. Therefore the first CS course is not about a programming language as much as it is about programming.

    There is no doubt in my mind that the current AP course needs to be brought up to date with streams, lambda and generics. I also think that removing the current sorting algorithms and doing something about Big O would be beneficial. But in the end these decisions should be driven by what is being taught in college courses and that is not uniform.

    I think if you start by defining the concepts that need to be taught then you could move to a model that looks more like AP CSP where language is more flexible. By providing a set of languages rather than a single and giving schools and possibly students choice you can make the AP course look like the course in the local college.

    Once I got past that I might look at changing how the programming knowledge is assessed. I think that if we look at sites like HackerRank we could imagine a coding test portion that could be implemented in multiple languages and be assessed using working code and not piecemeal rubrics. Finally, with that automation, we could make multiple versions of the exam, one that focuses on Object Oriented programming, one that makes use of APIs and one that focuses on Functional programming for example. This would follow the model of the AP Physics exam and indeed the flexibility for students to mimic an in-major CS intro or a non-major CS intro.

    ReplyDelete