Perl not suitable for beginners? |
Written by Nikos Vaggalis | |||
Monday, 14 November 2011 | |||
Page 1 of 2 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 language designed by chance. So the final outcome is that Perl scored lowest of all. While the paper, An Empirical Comparison of the Accuracy Rates of Novices using the Quorum, Perl, and Randomo Programming Languages, is an interesting read about an interesting approach, I would like to raise some objections and discuss the idea of languages and their purpose. Is Perl representative of general purpose programming languages? The researchers note: 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 code The three sample programs and a possible solution can be seen below: Quorum task action Main Quorum possible solution number x = 175.3 Randomo task ˆ Main { Randomo possible solution ˜ x \ 175.3 <ASIN:0596001738> <ASIN:1430227931> |
|||
Last Updated ( Friday, 18 November 2011 ) |