Chuniversiteit logomarkChuniversiteit.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.

Link

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 %
Java 41.94
Python 26.45
C++ 19.35
C 4.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

Link

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 structures 16.42
Functional decomposition 14.53
Object-orientation 12.35
Static data typing 11.48
Program compilation 9.01
Method overloading 8.28
Exception handling 7.27
Dynamic data typing 6.54
Pointers 5.67
Operator overloading 4.65
Garbage collection 3.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 %
Pointers 17.15
Memory management 13.41
Object-orientation 13.24
Exception handling 10.53
Operator overloading 10.36
Method overloading 9.00
Functional decomposition 8.49
Dynamic data typing 8.32
Repetition structures 4.41
Static data typing 3.57
Program compilation 1.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

Link

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 language 26.19
Ease of learning of programming 18.81
Job opportunities for students 14.76
Popularity of the language in academia 13.10
Institutional tradition 8.57
The language for AP Computer Science 7.62
Advice of an advisory board 5.95
Faculty availability or scheduling constraints 5.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:

Language Features Ease of learning Job opportunities Popularity in academia Institutional tradition AP Computer Science Advisory board Faculty & scheduling
Java 38.18 37.97 58.06 47.27 52.78 87.5 60.00 61.90
C 5.45 1.27 1.61 0.00 5.56 0.00 0.00 4.76
C++ 19.09 7.59 29.03 20.00 30.56 6.26 32.00 23.81
Python 29.09 44.30 6.45 29.09 2.78 0.00 8.00 0.00
C# 0.91 1.27 0.00 0.00 0.00 0.00 0.00 0.00
Other 7.27 7.59 4.85 3.65 8.33 6.25 0.00 9.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
Engineering 26.05
Arts 15.81
Mathematics (or Math) 8.37
Computing (or Computer) 7.44
Business 3.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.

Language Computing Engineering Sciences Arts
C 9.09 54.55 27.27 9.09
C++ 12.24 24.49 38.78 14.29
Java 7.59 27.85 39.24 15.19
Python 3.51 21.05 40.35 17.54

Summary

Link
  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