The Role of Examples in the Teaching of Programming Languages

A common assumption made by teachers of programming languages, especially those teaching adults, is that their primary (core) teaching material consists of text, by which we mean rules, instructions, explanations, and discussions. Worked examples are seen as secondary, serving merely to illustrate the core material. We present evidence to demonstrate that young adult students do not share this assumption. Given instruction in the form of demonstrably clear text and worked examples, they do not treat the text as the primary source of information, but rather seem to focus on the worked examples. Worked examples may be seen as being the primary source of learning material even when they are not fully understood, but bear some superficial similarity to the task in hand.