Skip to content
Back to the collection

An Empirical Investigation into Programming Language Syntax

Andreas Stefik, Susanna Siebert

2013 · ACM Transactions on Computing Education

Read the paper
HN score
0
Mentions
3
Readers
3
Months
3
What’s in a score?

From the abstract

Recent studies in the literature have shown that syntax remains a significant barrier to novice computer science students in the field. While this syntax barrier is known to exist, whether and how it varies across programming languages has not been carefully investigated. For this article, we conducted four empirical studies on programming language syntax as part of a larger analysis into the, so called, programming language wars. We first present two surveys conducted with students on the intuitiveness of syntax, which we used to garner formative clues on what words and symbols might be easy for novices to understand. We followed up with two studies on the accuracy rates of novices using a total of six programming languages: Ruby, Java, Perl, Python, Randomo, and Quorum. Randomo was designed by randomly choosing some keywords from the ASCII table (a metaphorical placebo). To our surprise, we found that languages using a more traditional C-style syntax (both Perl and Java) did not afford accuracy rates significantly higher than a language with randomly generated keywords, but that languages which deviate (Quorum, Python, and Ruby) did. These results, including the specifics of syntax that are particularly problematic for novices, may help teachers of introductory programming courses in choosing appropriate first languages and in helping students to overcome the challenges they face with syntax.

Metadata: Crossref. Abstracts retain their original authors’ rights.

In the conversation

Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels

3 selected excerpts · 3 total mentions

Rochus
Neutral mention · rule
Perl presents a fascinating counterexample: Larry Wall, trained as a linguist, explicitly cared about human factors, but his linguistic philosophy produced a language that empirical tests show performs poorly on readability and learnability measures (see e.g. http://dx.doi.org/10.1145/2534973 or https://doi.org/10.1145/2089155.2089159).
yvdriess
Neutral mention · rule
Possibly, but I would argue we're not doing a very good job at that. Things like precedent rules plug into what we're used to for mathematical expressions, but that's only a small part of actual programming. Teaching novices without prior PL experience, you notice how much language syntax can get in the way, I get to the core concepts faster with scheme-driven classes than python-driven ones. Question to HN: have there been recent interesting empirical studies into the impact of PL syntax? I tend to always cite https://dl.acm.org/doi/10.1145/2534973 but newer ones might have superseded it.
kqr
Neutral mention · rule
I think science is divided on this question. There's that one study showing that many languages with C-like syntax are as easy to learn to read as languages with tokens picked completely at random[1]. But that talks about learning the language. What about once you're proficient? I vaguely remember reading about a study that concluded more terse symbol-based syntax is better because the programmer can use visual organisation of the code to greater extent because the syntax occupies less of the screen. But I could also be making it up because I can't find it now. There's also the interesting (but slightly irrelevant) result that abbreviated identifier names may be just as effective as ones spelled out![2] [1]: https://dl.acm.org/doi/abs/10.1145/2534973 [2]: https://link.springer.com/article/10.1007/s11334-007-0031-2

Keep following the thread.

More in Programming languages

More from the same topics.