Chuniversiteit.nl
The Toilet Paper

What is the best programming language for beginners?

This study attempts to provide a more nuanced answer than “JavaScript”, from an educator’s perspective.

Who is this Pokémon still, with a silhouette of a Pokémon that is clearly not a Pikachu.
”Who is this Pokémon?” ”It’s ‘pick or choose’!”

Your first programming language is kind of like a starter Pokémon. You’ll probably use it very often, especially when you’re taking your first steps into the exciting world of computer programming. But as you catch more Pokémon, you quickly learn that it doesn’t matter which starter Pokémon you picked. What’s more important is that you picked a starter Pokémon.

Similarly, your first programming language doesn’t matter that much. Of course, some languages are slightly better choices than others, so it makes sense that beginners often ask which programming language they should start with.

If you ask on “experts” on the Internet which programming language is best for beginners, chances are that JavaScript will be the #1 answer, followed by other popular languages, like Python and Go. JavaScript is also popular among those who run coding bootcamps, presumably due to its versatility and widespread usage in web development.

Why then, do universities still teach computer programming using “outdated” languages, like Java and C++?

Ezenwoye conducted a survey among 496 computer science bachelor programmes at four-year institutions across the United States. The goal of this survey was to find out what the introductory programming language of each institution is and what features they consider to be important for such a language.

The results show that Java is the most popular programming language by far, with a “market” share of almost 42%, followed by Python (26%) and C++ (19%). JavaScript was mentioned a grand total of two times, and only when TypeScript is included in that count.

Answer%
Java41.94
Python26.45
C++19.35
C4.52
C#0.65
7.10

People on the Internet often in their courses, due to a lack of time or knowledge. The numbers don’t tell us whether that’s really the case, but they do tell us that changes don’t happen often: for 67% of institutions, the introductory programming language has remained the same for 6 or more years.

What’s interesting is that institutions that have been using a language for 2 years or less are more likely to use Python instead of Java, This could be an indication of a trend towards Python.

Dos and don’ts for a language

The choice for a particular language as the introductory programming language depends on many different things.

First, one should be able to use it to teach important concepts. Respondents believed that the following features are necessary for a good introductory programming language:

Answer%
Repetition structures16.42
Functional decomposition14.53
Object-orientation12.35
Static data typing11.48
Program compilation9.01
Method overloading8.28
Exception handling7.27
Dynamic data typing6.54
Pointers5.67
Operator overloading4.65
Garbage collection3.78

The features listed near the top are all useful if you need to solve high-level (algorithmic) problems using code, while those near the bottom are more low-level. Program compilation is listed about halfway, but is thought to be very nice to have: it makes it much easier to detect mistakes in code, which is useful for any programmer, but especially for beginners. Note that the list includes many features that JavaScript lacks, like program compilation and operator overloading.

One thing to keep in mind, is that the introductory programming language will be used to teach novices how to solve problems using code. Anything that detracts from that goal (low-level implementation details) is best avoided. According to respondents, these features are the most difficult to learn for beginners:

Answer%
Pointers17.15
Memory management13.41
Object-orientation13.24
Exception handling10.53
Operator overloading10.36
Method overloading9.00
Functional decomposition8.49
Dynamic data typing8.32
Repetition structures4.41
Static data typing3.57
Program compilation1.53

Fortunately the features that beginners struggle with tend to be those that aren’t really that important in an introductory programming language. There’s one major exception though: object-orientation is both important and hard.

An interesting observation here is that, contrary to popular belief, dynamic data typing is actually thought to be harder than static data typing.

Other factors

Other factors may also influence the choice for a particular programming language. The table below shows how many respondents claimed that the features of a language and other factors would play a role in their decision process:

Answer%
The features of the programming language26.19
Ease of learning of programming18.81
Job opportunities for students14.76
Popularity of the language in academia13.10
Institutional tradition8.57
The language for AP Computer Science7.62
Advice of an advisory board5.95
Faculty availability or scheduling constraints5.00

Features are clearly the most important factor, followed by the ease of learning, the number of job opportunities for graduates familiar with the language, and popularity of the language in academia.

A further subdivision by language provides some additional insights into the reasoning behind the choice for a particular language:

LanguageFeaturesEase of learningJob opportunitiesPopularity in academiaInstitutional traditionAP Computer ScienceAdvisory boardFaculty & scheduling
Java38.1837.9758.0647.2752.7887.560.0061.90
C5.451.271.610.005.560.000.004.76
C++19.097.5929.0320.0030.566.2632.0023.81
Python29.0944.306.4529.092.780.008.000.00
C#0.911.270.000.000.000.000.000.00
Other7.277.594.853.658.336.250.009.52

Ease of learning is often seen as a reason to choose Python over Java. However, it can be argued that languages that include a compilation step are easier to learn in practice, as the compiler partially removes the need to manually check one’s code.

Even though most programming languages are technically general-purpose languages, in practice some languages are primarily used in certain domains. Ezenwoye therefore looked at the title of the under which the computer science programme is housed:

Answer%
Sciences (or Science)39.07
Engineering26.05
Arts15.81
Mathematics (or Math)8.37
Computing (or Computer)7.44
Business3.26

Most computer science programmes are in a college that has “Science(s)” or “Engineering” in its name. C, a lower-level programming language, is primarily popular in programmes that fall under engineering colleges, which presumably teach courses about the construction of embedded systems. Java and Python on the other hand are especially popular within science and arts colleges.

LanguageComputingEngineeringSciencesArts
C9.0954.5527.279.09
C++12.2424.4938.7814.29
Java7.5927.8539.2415.19
Python3.5121.0540.3517.54

Summary

  1. Java is still the most popular introductory programming language within computer science programmes

  2. The choice for a particular language depends on many factors, including its features, its learning curve, and its popularity

  3. Some programming languages are better suited for certain application domains than others

More about Python

More about programming