In a recent study of how beginners perform when given the task of writing programs without any tutorial help, Perl came out worst among three languages. Is this a real reflection of Perl's suitability as a starting point for learning to program?

Three programming languages were included in a small scale study undertaken in the Department of Computer Science at the University of Southern Illinois. The researchers wanted to discover how accurately novices who were programming for the first time would write programs that used common program constructs such as loops, conditionals, functions, variables, parameters.

Perl was the only "real-world" programming language in the line up while the other two were novel languages devised for research purposes.

According to the report of the study, Quorum is

an evidence-based programming language, where the syntax, semantics, and API designs change in correspondence to the latest academic research and literature on programming language usability.

and Randomo is

a Placebo-language, where some of the syntax was chosen with a random number generator and the ASCII table.

The study's results revealed:

Quorum users were afforded significantly greater accuracy compared to those using Perl and Randomo, Perl users were unable to write programs more accurately than those using a languagedesignedbychance.

During the course of these studies, we have observed that novices learning to program at the university or younger levels, can have significant difficulty learning the syntax of general purpose programming languages, which may initially seem arbitrary (e.g., ||, ˆ, @ [0]). Given this observation, novices may think programming language syntax is rather arbitrary.

Out of all general programming languages that could be used, choosing Perl as a representative sample is a bit unfortunate. Perl is notorious for having a highly idiomatic syntax, which can furthermore assume alternative semantics depending on the context. Therefore it is unlike any syntax present in most mainstream programming languages

Better, more modern, Perl code could have been presented.

To understand this objection you need to see one of the the code samples that were used in the study in the three versions plus the code of their sample solutions. The subjects were given the sample code and a description of what it does.

The description for each of the set read:

This code will count the number of values that are and are not divisible by c and lie between a and b. It then compares the number of values that are and are not divisible by c and makes the greater of them available to the user.

Using each of the samples as guides to how to write code the subjects were then asked to write a simple program that performed a simple task. The description of the simple task read:

Using the code sample given to you, try to write codethat defines a variable x that stores real values and is set to 175.3. The code should also define a variable y that stores a string of characters and saves the word false in it. The code should then check whether x is larger than 100. If so, y should save the word true. Otherwise, y should save the words still false.

The three sample programs and a possible solution can be seen below:

Quorum task

action Main number x = z(1, 100, 3)endaction z(integer a, integer b, integer c) returns number number d = 0.0 number e = 0.0 integer i = a repeat b - a times if i mod c = 0 then d = d + 1 end else then e = e + 1 end i = i + 1 end if d > e then return d end else then return e endend