Computer Science is a growing field. That’s no secret. And, as many of you know, there’s a huge array of languages to learn (and it’s only growing). This has left us wondering what the most popular coding language is, and potentially even more importantly, what language new coders should be learning first. Fortunately, we aren’t the only ones asking these question. Philip Guo wrote an article detailing the most popular introductory coding language at top US universities.
And the winner is Python!
According to Guo, Python is increasingly turned to as the first language to teach novices. In fact, a few years ago, Mark Guzdial blogged about the rise of Python as a teaching language and predicted its bright future. Since then, top-ranked CS departments at MIT and UC Berkeley have switched their introductory courses to Python — and the largest three MOOC providers (edX, Coursera, and Udacity) all began to offer introductory programming courses in Python. Professors in diverse subfields (e.g., Lorena Barba) are now advocating for teaching Python to novices. (As a side note, be sure to check out the original author’s online teaching tool: Online Python Tutor (www.pythontutor.com); its usage has skyrocketed due to the growing popularity of the language.)
Next, Philip tried to find out by documenting how many of the top-ranked U.S. computer science departments use it to teach their introductory courses. Along the way, he also ended up cataloging occurrences of other popular teaching languages.
Why do this analysis? 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.
The top 39 departments, as ranked by U.S. News in 2014, were considered. (This link may become outdated as U.S. News issues new rankings.) Why did I stop at 39? Because there was an 8-way tie for 40, so the differentiating signal is weak by that point. No ranking scheme is perfect, and rankings change over time. In particular, this ranking considers only American Ph.D.-granting universities. And my cut-off of 39 excludes many universities that I respect, including my own. We could debate endlessly about which schools to include, and how to rank them. But I had to choose some ranking scheme and cut-off, and this felt reasonable.
For each university, I looked for CS0 and CS1 courses in the CS, CSE, or EECS department, whichever is the home to computer science. I define a CS1 course as the first required course for CS majors, and a CS0 course as introductory programming (not just basic computer literacy) for either non-majors or those who need extra preparation before CS1. Neither CS0 nor CS1 should have any CS prerequisites, since otherwise they can’t be the first CS class that students take. (Specifically, CS0 should not be a prerequisite for CS1.) I didn’t count mini-courses, speical advanced CS1+ courses, higher-numbered electives, or programming courses offered by other departments. Note that there isn’t a strict official definition for CS0 or CS1, so I had to exercise some personal judgment. I tried to abide as much as possible by each department’s official course descriptions and prerequisite tables.
Although some instructors consider introductory programming to mean CS1, for this analysis I purposely grouped CS0 and CS1 together since those courses are where many students, regardless of major or eventual career, study their first programming language in college. Given the unfortunate state of K-12 computer science education in the U.S., these college courses are where many students, especially women and underrepresented minorities, likely see their first programming language. And even if students arrive with prior programming experience, their first officially-sanctioned exposure in college is still influential. I want to give CS0 equal standing with CS1 because as programming becomes more pervasive across science, engineering, and even non-STEM disciplines, more and more non-majors are taking CS0. Also, a non-trivial minority of CS majors take CS0 before CS1, especially students without much prior programming exposure. Thus, CS0 courses serve as important gateways into computing for students who might otherwise never know that they had such passions.
The chart below shows how many of the top 39 departments teach either CS0 or CS1 using the seven most common languages. The bar heights add up to more than 39 since many schools offer both CS0 and CS1.
Even though I’m a big Python proponent, I’ll try my best to present just the facts without editorializing.
Python is the most popular language in this list. It narrowly surpassed Java, which has been the dominant introductory teaching language over the past decade. Some schools have fully switched over to Python, while others take a hybrid approach, offering Python in CS0 and keeping Java in CS1. However, at the high school level, Java is still used in the AP (Advanced Placement) curriculum.
The next most popular language is MATLAB, which is often used in CS0 courses to introduce scientists and engineers to programming. C++ is next on the list, but it’s been firmly supplanted by Java over the past decade. The high school AP curriculum even replaced C++ with Java in 2003. C is just as popular as C++ in this list, but some introductory courses that use C (such as Harvard’s CS50) teach it alongside other languages rather than having it be the sole language.
Scheme-based languages are popular amongst a devoted subset of educators and programming language researchers. Most notably, two (somewhat rival) philosophical camps — SICP and HtDP — have created acclaimed textbooks and courses around the Scheme ecosystem. But in recent years, Scheme has been phased out in favor of Python at places such as MIT and UC Berkeley. It’s being used in only 4 schools in this list.
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, andTouchDevelop. 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.
Finally, note that three interesting sets of languages didn’t make it on this chart because they were used in either zero or one university in our sample:
- Statically-typed functional languages such as Haskell and OCaml, which are popular amongst PL researchers
- Widely-used industry languages that are commonly associated with specific proprietary platforms, such as Objective-C (Apple) and C#/Visual Basic (Microsoft)
If we revisit this analysis in five, ten, or twenty years, which language will be in the lead then?
Now that you know…
That Python is the up and coming language, be sure to check out StackSocial’s new Pure Python Hacker Bundle for 90% off.