At the origin of this lesson is the concept of a “programming plan”, introduced by Soloway and Ehrlich in 1984. A programming plan is a snippet of code that represents a “stereotype” solution to a small problem. An experienced programmer adapts and combines these “programming plans” into complex programs.
More recently, this concept has given rise to two tools that can be used in teaching programming: the role of variables and elementary patterns.
For the concept of the role of variables, I suggest two articles:
- J. Sajaniemi, M. Ben-Ari, P. Byckling, P. Gerdt, Y. Kulikova. Roles of variables in three programming paradigms. Computer Science Education. (2005)
- J. Sorva, V. Karavirta, and A. Korhonen. Roles of Variables in Teaching. Journal of Information Technology Education. Volume 6 (2006).
Choose one! As an introduction, they are essentially equivalent. The first one is from the Sajaniemi group, which pioneered the area for the imperative paradigm and here extends the discussion to the functional/object-oriented paradigms. The second is from the Sorva group and reports some data on the use of this approach in two university courses. I’m curious to see how you split over the articles and the opinions that form.
On the micropattern front, the literature is less satisfying. Just take a quick look at the following article:
- Viera K. Proulx. Programming Patterns and Design Patterns in the Introductory Computer Science Course. Proceedings of the 31st SIGCSE Technical Symposium on Computer Science Education (2000)
Discussion / Reasoning Points
- Try to reflect on the pros and cons, in your opinion, of teaching variable roles/elementary patterns.
- Try to think about possible approaches to use when introducing variable roles/patterns to students.
Practical exercises
- For those with extensive programming experience, try writing small snippets of code that utilize each of the roles of variables. For those with less experience, refer to this webpage, which is part of the Roles of Variables Home Page.
- Try to do a similar exercise regarding elementary patterns. There is a dedicated web page for Elementary Patterns, but it doesn’t provide an organized overview of the area and is no longer maintained, with several broken links (1). The only pages that are still available are the following:
-
- Selection Patterns, by Joe Bergin.
- Loop Patterns, by Owen Astrachan e Eugene Wallingford (2).
- A much more complex exercise is to dust off the materials from your first programming course and try to identify roles and patterns. In case they are not present, try to think about how to modify the slides/notes to include them.
Material for future readings
Tracing back to the origins of this line of research, certainly the articles by Soloway, Ehrlich, and Bonar are among the most interesting. Unfortunately, the presentation of their ideas is fragmented across various articles, which, being written in the ’80s, are also difficult to read – both due to the outdated constructs used and the fact that some are still written with a typewriter! An interesting exercise would be to read them, summarize them, and update them, following a more modern approach.
- E. Soloway, K. Ehrlich, J. Bonar. Tapping into tacit programming knowledge. Proceedings of the 1982 Conference on Human Factors in Computing Systems. (1982).
- J. Bonar, E, Soloway. Uncovering Principles of Novice Programming. POPL 1983: 10–13 (1983)
- E. Soloway, J. Bonar, K. Ehrlich. Cognitive Strategies and Looping Constructs: An Empirical Study. Commun. ACM 26(11): 853–860 (1983)
- E. Soloway, K, Ehrlich. Empirical Studies of Programming Knowledge. IEEE Trans. Software Eng. 10(5): 595–609 (1984)
The Sajaniemi group has written a large number of articles on the topic of variable roles. Perhaps too many, in my opinion. It would be useful to have a survey that summarizes everything. Here, I propose only a few of them. For a more comprehensive list, take a look at Sajaniemi’s DBLP page between 2002 and 2006.
- M. Kuittinen, J. Sajaniemi. Teaching roles of variables in elementary programming courses. ITiCSE 2004: 57–61.
- P. Byckling, J. Sajaniemi. Roles of variables and programming skills improvement. SIGCSE 2006: 413–417
- U. Nikula, J. Sajaniemi, M. Tedre, S. Wray. Python and Roles of Variables in Introductory Programming: Experiences from Three Educational Institutions. JITE 6: 199–214 (2007).
Notes
(1) For someone of my age, HTML style takes you back in time; for the record, one of my professors kept his original 1994 webpage (when I was a student) until 2015. When he changed it, an era ended for me.
(2) However, if you follow some of the patterns suggested in the article on loop patterns, you will be chased by Roberto Sebastiani with an axe.