Mark Guzdial was very pleased to find out that the number of students taking the AP computer science exam has grown from about 21,000 to about 26,000 this year: Huge (unofficial) rise in AP CS Test Takers « Computing Education Blog.
I’m pleased to see a bigger than 20% increase in numbers also, but the number of students taking the AP computer science test is still tiny: smaller than the 35000 taking Physics C: Mechanics and much smaller than the 85,000 taking Calculus BC, both of which are arguably higher level classes than the computer science one. Physics B and Calculus AB may be at about the same level, but have 76,000 and 255,000 test takers. What would it take to get the CS numbers increased by a factor of 10, up to the calculus numbers? Since computer science is arguably more useful to more people than either physics or calculus, why is the exam so rarely taken?
There are three main possibilities:
- Few high schools offer computer science.
- Few students take the computer science classes that are offered.
- The computer science high schools offer is not compatible with the AP exam.
I suspect that all three contribute to the problem, and there is evidence for all three patterns locally:
- The neighborhood high school offers no computer science (even though a fairly large fraction of the community works for the software industry).
- The AP-laden charter school that we tried for 4 years to get my son into, before finally getting a slot and turning it down as longer a good fit for him has an AP CS class. In 2011, they had 429 AP exams taken in 15 different subjects, with 78 in World History, 71 in US History, 63 in English Language, 61 in Biology, 24 in Statistics, 21 in Physics B, 20 in Calculus BC, but only 10 in Computer Science. The exams with over 60 test takers were required classes, those with under 25 were electives or subjects studied outside of class. No test has between 25 and 60 takers.
- The private 6–12 school where my son went to middle school offers a pretty good CS course, which my son took in 8th grade instead of their rather feeble 8th grade science class, but the CS course is based on Scheme, not Java, and does not prepare students at all for the strictly-Java AP exam.
What subjects get ingrained in the school culture and the popular imagination is often a mystery to me. Why, for example, do so many students take calculus rather than statistics (255k vs 142k), when statistics is needed by many more college majors and is useful even to non-college-bound students? Why is computer science (which leads to good job prospects) so much less studied in high schools than European History (which has few job prospects and is not a popular major in college)?
Mark Guzdial’s belief (as I understand it—I’m sure he’ll correct me if I’m mistaken) is that the bottleneck is that schools are not teaching computer science and that they aren’t doing it because of a shortage of trained teachers. While I agree that there are few high school teachers trained to teach computer science, I think that the problem is bigger than that—there are few schools willing to hire such teachers if they existed and students are not clamoring to take computer science in high school, so schools feel no pressure to look for or create high-school CS teachers. In short, I think that computer science has a public-relations problem in high schools, and not just a teacher-shortage problem. I’ve no idea how to fix that—PR is not one of skills.
Another small part of the problem is that the AP CS test is testing the wrong part of the subject, concentrating as it does on Java programming. The exam is a poor fit for students who were taught CS using a more sensible pedagogy (starting with Scratch and Python, for example, rather than Java, or using a Scheme-based curriculum). I don’t think that the proposed lower-level AP CS Principles exam is going to fix this problem, as the problem is not that the CS content is too difficult, but that it is too language-specific. What is needed, I think is an AP Algorithms exam that tests algorithms and data structures in an almost language-independent way.
My son easily has the amount of computer science covered in the first year or so of college CS classes, from a variety of sources. He’s pretty good at object-oriented programming in Python, he can program in Scheme (but doesn’t by choice), he can do simple Arduino C/C++ programs, he can do some JavaScript programming (but he finds the language irritating), and he’s learned other languages in the past (Scratch and Logo, for example). Just today he wrote an interrupt-driven timer program for the Arduino with a queue implemented in a circular buffer for recording data from our homemade super pulley and sending it to a Python program for saving the data on the laptop, to replace the cruder program I had written that lacked interrupts or queues and just dumped the data to the Arduino serial monitor. He is currently working on a multi-threaded Python program to record the data from the Arduino while listening for user commands from the keyboard, for a more convenient user interface. (Both of these projects are ones he set himself—I was content with cutting and pasting from the Arduino serial monitor.) He’s done several computer science projests as science-fair projects: collision resolution algorithms for hashing as a science fair project, minimax search programs to play Connect 4, a circuit analyzer to do DC and AC analysis of linear circuits, and machine-learning algorithms for cancer diagnosis from gene expression arrays. He’s even designed some esolangs for fun. In short, his computer science education level is more like a CS major who has finished 2 years of college than one who has finished 2 years of high school.
Despite all this CS, I doubt that he could currently pass the AP CS exam, because it is firmly tied to Java, and he has not learned that language yet. It is next on his list of languages to learn though, since Art of Problem Solving is offering an online course on Java programming for people who already know some programming (the equivalent of their first course which uses Python). I suspect that even the AoPS course will be a little low-level for him, but it is the only Java-after-Python course I’ve been able to find that seems likely to be a decent fit for him. He was enthusiastic about the AoPS Precalculus and Calculus classes, and looks forward to the Java class, even though he already knows much of the CS content of the course and just needs to translate his understanding into fluency in Java.
He’ll need the structure of a course to get through the initial barriers of the tedious Java syntax to get to the point where he can program fluently in Java. Without external constraints on what language he uses, he’d probably prefer to stick with a familiar language like Python, and use tricks like Pyrex, NumPy, or PyPy when he needed more speed (he’s used NumPy and Pyrex already—PyPy does not seem to be quite ready for prime time as it doesn’t include many of the most useful Python libraries, but it looks quite promising). Eventually he’ll be working on big enough projects that he’ll need the stricter interface requirements of a statically typed language like Java, but it would be better for him to learn the language and be fluent with it before joining such a multi-person project.