Comparing-loops-misconceptions-in-block-based-and-text-based-programming-languages-at-the-K-12-level
Comparing-loops-misconceptions-in-block-based-and-text-based-programming-languages-at-the-K-12-level
net/publication/321332296
CITATIONS READS
107 2,858
3 authors:
Žana Žanko
University of Split
16 PUBLICATIONS 219 CITATIONS
SEE PROFILE
All content following this page was uploaded by Monika Mladenović on 02 October 2018.
Abstract Novice programmers are facing many difficulties while learning to program. Most studies about
misconceptions in programming are conducted at the undergraduate level, yet there is a lack of studies at the
elementary school (K-12) level, reasonably because computer science neither programming are regularly still
not the part of elementary school curricula’s. Are the misconceptions about loops at elementary school level
equal to those at the undergraduate level? Can we “prevent” the misconceptions by using the different
pedagogical approach, visual programming language and shifting the programming context toward game
programming? In this paper, we tried to answer these questions. We conducted the student misconceptions
research on one of the fundamental programming concepts – the loop. The research is conducted in the
classroom settings among 207 elementary school students. Students were learning to program in three
programming languages: Scratch, Logo and Python. In this paper, we present the results of this research.
1. Introduction
Programming is the essential part of the Computer Science (CS) curricula (Gomes & Mendes, 2007). There is no
doubt that programming is highly demanding (Dehnadi, 2009) even on the elementary level (Bonar & Soloway,
1983). Programming is difficult to learn, understand and master, especially for novices (Gomes & Mendes, 2007;
Lahtinen, Ala-Mutka, & Järvinen, 2005; Robins, Rountree, & Rountree, 2003), regardless of their age (Guzdial,
2004). Therefore, it is not a surprise that many students face difficulties at the beginning of learning and that the
programming classes dropping rate are elevated (Gomes & Mendes, 2007). The interesting fact is that, despite
the emergence of a plethora of new programming languages, students experience the same or similar
misconceptions as they did more than 30 years ago. We can detect multiple reasons for that. Undoubtedly one of
the reasons is the fact that those concepts are hard to understand. However, the fact is that curriculums are
mostly the same as they were in the past, we are still teaching programming by solving math problems in text-
based programming languages. Is the approach appropriate for new generation students who raised up with
highly interactive and visually rich technology and expecting the same from computers? Furthermore, this
problem is more emphasised at the elementary school. There is a lack of studies for mentioned student
generation since programming is not part of curricula at elementary schools in most countries. It is probable that
identified misconceptions are also present at that age.
To improve understanding of basic programming concepts is important to determine the misconceptions and
difficulties when learning programming. If we could minimise, or prevent those misconceptions at elementary
school level by using different programming languages and (or) different approaches, maybe we could facilitate
learning programming at high school or undergraduate level.
We have conducted the research in the classroom settings among 207 students in 3 elementary schools (K-12
level). Three different programming languages—Scratch, Logo, and Python—were used to learn basic
programming concepts. Scratch is visual programming language appropriate for elementary school students,
while Logo and Python are text-based programming languages appropriate for beginners. Previous studies
showed the statistically significant differences in understanding the loop concept when using Scratch compared
to Logo or Python (M. Mladenović, Krpan, & Mladenović, 2016; M. Mladenović, Rosić, & Mladenović, 2016).
The authors produced a test, with the same tasks with the only difference in the programming language, to
determine if there are differences in understanding the loop concept in programming.
There are multiple programming languages and approaches to teaching programming. When choosing an
appropriate programming language for teaching programming to novices, we should consider several factors.
Perhaps the most important question to ask is: What is the target age? It is not the same if novices are at
undergraduate level or K-12 level. Next important issue is related to the learning environment, so it is proper to
ask: Are they learning programming in formal or in informal settings? As students are participating voluntarily
in the clubs or summer schools, it is expected that students are motivated to learn programming, and it is also
plausible that they have high programming abilities. On the other hand, in the school settings, this is not the case.
We have students with different programming abilities and levels of motivations, while Informatics is still the
elective course in the Republic of Croatia. We should take all mentioned into account when choosing an
appropriate programming language to learn.
When we speak about programming novices, we usually think about novices on the undergraduate level. Is the
term “programming novices” the same for both undergraduate and K-12 level students? Surely not. One of the
identified difficulties for programming novices is the abstraction (Lahtinen et al., 2005) (McCracken et al.,
2001), which is the core programming concept. Based on the Piaget theory of cognitive development concrete
operational phase is reached between age 7 to 11 years, and the last phase of cognitive development is the
formal operational phase, which refers to abstract thinking. The last phase, according to Piaget is reached after
12 years of life (Piaget, 1952), although some studies showed that only a third of teenagers enter this phase
(Fusco, 1981). Therefore, undergraduate level novices matured in logical reasoning (Sekiya & Yamaguchi,
2013), unlike K-12 students who are mostly at concrete or pre-formal phase of cognitive development. It is
undeniable that K-12 novices are facing more difficulties than the undergraduate ones. Novices have to
understand and apply abstract programming concepts to create concrete problem-solving algorithms (Gomes &
Mendes, 2007; Lahtinen et al., 2005; McKenna, 2004). Though many students did not develop sufficient
formal thinking abilities, learning programming appears hard for them, so they drop out (Gomes & Mendes,
2007), which is more emphasised at the K-12 level.
All mentioned refers to cognitive dimension. To attract students to affective programming dimension could
be crucial. It is irrelevant if the student has highly developed formal reasoning and problem-solving abilities
when lacking programming motivation. We could positively influence the affective dimension by choosing the
proper programming language, context, and pedagogical approach.
Programming languages for novices should have, in every case, the simple syntax simplifying the learning
process. The learning focus, in particular for novices, should be on language semantics not on syntax.
Brusilovsky et. al. coined the term mini-languages defining programming languages with simple syntax
(Brusilovsky, Calabrese, Hvorecky, Kouchnirenko, & Miller, 1997). Those languages should be an “easy-start”
to teach the programming principles for both educators and learners, but should also provide a support needed
for systematic problem-solving. Another advantage of mini-language is that is “built on metaphors that are
intrinsically engaging and visually appealing” with possibilities to create a new programming context, to
advance beyond math problems solving (Brusilovsky et al., 1997).
Paperts Logo was the first such language (Papert, 1980) stimulating the development of languages alike. The
Logo is a simple text-based programming language incorporating the visual feedback as the result of the
program execution. Keller and Pauch presented a taxonomy of languages and environments designed to make
programming more accessible to novice programmers of all ages (Kelleher & Pausch, 2005). Regardless of their
simplicity, text-based mini-languages are perhaps not suitable for K-12 level students. Textual languages appear
to be more appropriate for professionals (Myers, 1990). Based on the idea of mini-languages some new visual
programming languages emerged in the last decade. The main characteristic of those languages is that they are
block-based therefore, syntax problems are eliminated which allows students and educators to focus on the
algorithms instead struggling with syntax. By eliminating syntax problems, we enable students to learn
programming more quickly (Berland, Martin, Benton, Petrick Smith, & Davis, 2013). Scratch is one of those
languages appropriate for K-12 level education (Maloney, Peppler, Kafai, Resnick, & Rusk, 2008), but can also
be successfully used for undergraduate novices especially for future computer science teachers (S. Mladenović,
Krpan, & Mladenovic, 2016).
Visual programming languages also provide a possibility to program for "bricolage" thinkers (Clegg &
Kolodner, 2007; Turkle & Papert, 1992) which text-based programming languages do not. Bricolage way of
thinking refers to solving problems by trial and error methods, exploring and experimenting (Berland et al.,
2013). Bricolage is a concept related to concrete. “It has to do with abilities to find something—an object, tool,
document, a piece of code—and to use it to build something you deem important” (Brown, 2000). Bricolage is
the dominant way of thinking of a new generation, often called “digital natives” (Prensky, 2001). Opposite to
bricolage is a planning-oriented approach to programming, which refers to hierarchy and abstraction while
programming. For this type of programming, text-based languages are more suitable.
From the literature review of computing education at the K-12 level, we as researchers noticed that students
novices have lots of problems while programming in text-based programming languages although this could be
overwhelmed by the feeling of engagement with the professional tool (Garneli, Giannakos, & Chorianopoulos,
2015). Using text-based programming language for teaching programming could attract students with high
programming abilities, which is very important when teaching programming in the clubs or summer schools.
Classroom settings are more realistic, when compared to clubs or summer schools, since there are students with
different affinities in their natural environment which refers to physical (classroom), human (teacher) and
program (curricula) settings (Louis, Lawrence, & Keith, 2011). There is a lack of these studies because they are
difficult to conduct with a high degree of scientific reliability (Kölling & McKay, 2016) because the research
should not disrupt the natural environment. In this case, maybe the better choice is to use visual programming
languages as they provide a positive introduction to computing and support learning of programming concepts
(Garneli et al., 2015).
Visual programming languages are also offering an opportunity for context shifting, from solving math
problems, which is a dominant context when learning in text-based programming languages to programming
games, storytelling, animations, etc. All mentioned fits into the world of “digital natives” who raised up with
technology. They spent a significant share of time in front of screens, often playing video games, which
shouldn’t be neglected, like it or not. As a consequence, numerous games for learning appeared, hoping to make
learning easier and more fun, but this leads us to the crucial question, as Papert asked: “Does Easy Do It?”
(Papert, 2010). If games are not implemented carefully for the purpose of learning, then they would not affect the
educational domain, which is the goal. That is probably the reason why we have such discrepancy in learning
outcomes when using games (Kafai & Burke, 2015). Based on several studies we can ask is there a middle
between popular and educational gaming? The real answer is probably somewhere between the practice of
playing and making games which fit into two main approaches to using games in educations, instructional and
constructional (Kafai, 2006; Kafai & Burke, 2015). For instructional approach, we can say that playing games
are in focus while constructionist approach puts making (creating) games in focus (Papert, 1993). Again, the
question is what approach is suitable for K-12 novices since they do not know anything about programming
concepts so only discovering could not lead to the goal of learning programming concepts. Maybe the most
suitable approach for K-12 age is a combination of mentioned approaches, a combination of guided discovery
and instructions which could foster a deep learning rather than just pure discovery (Grover, Pea, & Cooper,
2015).
Kafai and Burke (Kafai & Burke, 2015) reviewed the set of studies, conducted in last 20 years with game-
based activities in different settings (formal and informal), with students from various ages. Results of their
review showed that: “making games proved to be a compelling context for learning computational concepts and
practices and broadening participants’ perspectives on computing and STEM overall”. Games are compelling
regardless of used programming tool (Scratch, Alice, Greenfoot, etc.), learning settings (school, clubs or online)
or age group.
In Israel, the study is conducted in middle school among seventh to ninth grade students among more than
4000 students through three years (2011. to 2013.) according to new CS curriculum program using Scratch. As
the result of this study, changes will be made in the teaching methods for loop concept. Loops will be taught by
developing a game (Zur-Bargury, Pârv, & Lanzberg, 2013). The results of this research were confirmed in
research conducted in a public middle school classroom in Northern California among 26 children from 7th to
8th grade enrolled in a “Computers” elective class (Grover, Cooper, & Pea, 2014).
Research also reported that programming computer games positively affect attitude, including self-
confidence, enjoyment and motivation, towards mathematics after self-making activities (Ke & Fengfeng, 2014)
which are also reported in attitude toward programming (M. Mladenović, Rosić, et al., 2016).
2.4 Misconceptions
As many studies confirmed the validity of using visual programming languages like Scratch, especially when
programming games it would be interesting to see is there a difference in misconceptions about programming
concepts, specifically the loop concept. By the way, it would also be interesting to compare K-12 and
undergraduate students misconceptions since most studies consider the undergraduate level.
The appearance of misconceptions for programming concepts could be addressed to the ability of the students,
methods of teaching and complexity of the programming (Dehnadi, 2009). When it comes to teaching methods,
it is important to thoroughly adopt the basic concepts before move on with new once, as resulting from the
research conducted among 500 students (Linn & Dalbey, 1985). Mastering basic facts and then practising more
complicated ones is a good way to turn a novice into an expert (Winslow, 1996).
Other reasons for the novices misconceptions appearing could be the syntax of a programming language
(Guzdial, 2004) which can imply the weakness of students in unnatural grammar errors in programming
languages (Mayer, 1981). Above claim refers to text-based programming languages which we could overcome
by using visual programming languages.
Most works on misconceptions in Computer Science are related to object-orientation on an undergraduate
level, which is not the focus of our study.
In the research conducted in K-12 school setting variable, loop, conditional, Boolean concepts in Scratch were
tested among 100 from 6th to 8th-grade students. These students were not novices since they previously
completed introductory programming CS course using Scratch. They faced some misconceptions related to
loops. In the case of a simple loop with multiple actions, researchers noticed that some students, instead to repeat
entire sequence were repeating each action separately. This misconception is called the grouping actions in the
loop. It is important to note that in this research teachers did not spend time on describing the changes of
variables within loop (Grover & Basu, 2017).
Common loops misconception reported for undergraduate students is “Neglect (ignore) For Loop” (NFL)
which refers to the case of ignoring the loop when the body has no control variables. Students with
misconception above achieved poorer results indicating that early detection of it may be helpful (Sekiya &
Yamaguchi, 2013).
3. Methodology
This research is part of broader research that observed that students are more successful in Scratch than in Logo
and Python based on problem-solving abilities. The idea for investigating misconceptions arose from those
results. Also, based on the pretest we divided students into three strength groups: stronger, intermediate and
weaker. We aspired to review if there is a difference in understanding programming concepts by comparing
success while using different programming languages and by comparing the success of the students based on
strength group affiliation. For this study, we were considering the comprehension of the loop concept as the test
had to follow the Informatics course curriculum and the age of the population observed. Besides that, previous
studies revealed statistically significant differences in the understanding of the loop concept using Scratch (M.
Mladenović, Rosić, et al., 2016). Therefore, we wanted to look deeper to this conclusion, so our focus was on the
loop concept.
The research was conducted in the natural environment in the school settings among four elementary schools
during 2015/2016 school year. All teachers are computer science (CS) teachers, with 5 to 15 years of teaching
experience, in their classes, with no presence of third parties. Therefore human and physical settings are
satisfied. Programming is part of the Informatics curricula from 5 th to 8th grade. According to curriculum,
teaching topics are determined, but programming languages are not. The teacher can choose between procedural
programming languages like BASIC or Python and languages with graphical results like Logo, Python using
turtle module or Scratch. For this research Logo, Python with turtle module and Scratch are programming
languages used for teaching programming. Loop concept is part of 5th and 6th-grade curricula topics. These
students are mostly at the same stage of cognitive development, so we analysed their results for this study. Prior
to any programming lectures, students were required to solve a problem-solving test as a form of pre-test.
Programming lectures lasted for three weeks. Logo and Python groups were learning programming in
“traditional” way, by drawing different shapes, while in Scratch they were learning programming by
programming games guided by the teacher. Researcher outlined the programming game assignments as a game
scenario in the form of the algorithm which students had to follow to program the game. Description of the
games used for programming is in previous work (M. Mladenović, Rosić, et al., 2016). We could say that
students were “learning by doing” by programming games partially following the constructional approach
(Papert, 1993) to game-based learning. We can classify the approach in this research as the blend of both
constructional and instructional, “CoInstructional” approach. As children are guided to create a game, which
would fit better in instructional approach, but still, the instructions were not just “served”, students were active
participants in creating a scenario for games which fit into the constructional approach. This “blended” approach
seems to be appropriate for this age as a formal introduction to basic programming concepts. After such
introduction and the first experience in programming games, students should meaningfully implement those
concepts when designing their games, which should be the purpose of learning programming. We could compare
this approach to a process of learning to swim or learning to ride a bike.
After programming lectures, the researchers tested the students on the understanding of the sequencing and
the loop concept. The test was equivalent for all languages with the only difference in a programming language.
While teaching, teachers did not spend any time to explain the class of problems later used for testing the loops
understanding.
Since the research was conducted in a classroom setting by experienced CS teachers with lectures in line with
the curricula, we can conclude that all conditions for an experiment in the natural environment are satisfied
(Louis et al., 2011). Thus, external validity is confirmed.
3.3 Participants
A total of 312 students participated in the research, but for this study, we were examining 5th and 6th-grade
student (10 to 12 years old) test results, so among collected, 207 students’ results were analysed. Most students
were programming novices. Table 1 shows population details.
Previous
Programming
School Class Students Boys Girls programming
Language
experience
S1 5 Scratch 30 14 16 No
S1 6 Python 17 7 10 Yes(Python)
S2 5 Logo 46 21 25 No
S2 6 Logo 52 29 23 Yes(Logo)
S3 5 Python 46 18 28 No
S4 6 Scratch 16 11 5 No
Total: 207 100 107
For this research, we used quantitative approach. The research tools included pre-test and post-test. The pre-test
was designed to determine students’ problem-solving abilities. The same test was used in several studies (M.
Mladenović, Krpan, et al., 2016). Based on the pre-test results students were divided into three groups: stronger,
intermediate and weaker.
Post-test was designed to ascertain students’ understanding of the sequencing and loop concepts with the
focus on the loop concept. A pilot test was conducted in one of the previous studies (M. Mladenović, Rosić, et
al., 2016). Results from that research determined the statistically significant difference in the understanding of
the loop concept, so we focused on the loop concept including some new tasks. Post-tests are made in three
versions with the only difference in the programming language: Scratch, Logo and Python. The test contained
five multiple choice tasks with one right answer. Multiple choice tests of programming skill assessment are
appropriate for testing programming skill for several reasons like objectivity, grading, higher chance of covering
a wide range of course topics, easily computed statistical analyses of the test results, etc. (Kuechler & Simkin,
2003).
In this section, we present our results by answering the posed research questions RQ1 and RQ2.
4.1 Comparison of the students results by affiliation to the groups based on problem-solving abilities
(strength groups)
All students solved pre-test before programming lectures. Students were distributed into three groups based on
the pre-test results. Table 2 shows groups distribution.
Scratch 19 16 11
Logo 30 33 35
Python 24 14 25
73 63 71
As Kolmogorov-Smirnov test results showed that data is not normally distributed (n=207, p=0.00), non-
parametric test Kruskal-Wallis is used to determine a difference in pre-test results between groups based on used
programming language. Results showed that there is no statistically significant difference among groups
(χ2(2)=2.603, p=0.272) so we can compare post-test results of the groups.
Chi-square test is used to compare post-test results based on the programming language used, and to compare
post-test results based on affiliation to the strength groups. Results showed that there is a statistically significant
association between used programming language, problem-solving abilities and post-test results for Logo
(χ2(10)=23.989, p=0.008) and Python groups (χ2(10) =19.006, p=0.04), but not for Scratch group (χ2(10) =13.99,
p=0.173). From these results, we can conclude that students with lower problem-solving abilities are more
successful in Scratch than in text-based programming languages Logo and Python. Therefore, we can answer the
RQ1and conclude that intermediate and weaker students have better scores when programming in Scratch than
programming in Logo or Python.
Post-test contained five tasks. The first task was examining sequencing concept while other tasks were related to
loops. We compared misconceptions for every task which will be presented in the next sections. Chi-square test
is used to determine the association between programming languages and answers to questions.
The question was the same for all tasks: How many steps will be made after execution of the next code?
The first task was testing the understanding of the sequencing. Table 3 shows the task 1.
Chi-square results showed that there is a statistically significant association between answers and
programming language (χ2 (10) =34.057, p=0.000). Table 4 shows the distribution of the answers by a
programming language.
Table 3. Task 1
The correct answer was d) which choose 59.9% of all students. Even 80.4% students from Scratch group
answered correctly, while 58.5% of Logo and 47.6% of Python group answered correctly. The high rate of
correct answers in Scratch could be attributed to the visual representation of the instruction where the turning
symbol on the instruction makes no doubts in its purpose.
No a b c d e Total
answer
Count 0 1 1 2 37 5 46
Scratch Expected 1.3 1.8 1.3 .9 27.6 13.1 46.0
% 0.0% 2.2% 2.2% 4.3% 80.4% 10.9% 100.0%
Count 0 2 4 0 57 35 98
Logo Expected 2.8 3.8 2.8 1.9 58.7 27.9 98.0
% 0.0% 2.0% 4.1% 0.0% 58.2% 35.7% 100.0%
Count 6 5 1 2 30 19 63
Python Expected 1.8 2.4 1.8 1.2 37.7 18.0 63.0
% 9.5% 7.9% 1.6% 3.2% 47.6% 30.2% 100.0%
Count 6 8 6 4 124 59 207
Total
% 2.9% 3.9% 2.9% 1.9% 59.9% 28.5% 100.0%
The most usual incorrect answer was e). Students who choose this answer were just adding the numbers in all
instructions that indicate that they don’t differ forward and turning instructions. This mistake made 28.5% of all
student, 10.9% of Scratch, 35.7% of Logo and 30.2% of Python students. It is interesting to notice that more of
these mistakes were found in Logo than in Python.
Other answers are dispersed and represented with the small rate, which indicates that students who didn't
know the correct answer were probably guessing it.
The second task was testing the understanding of the simple loop. Table 5 shows the task 2.
Table 5. Task 2
a b c d e Total
Count 1 1 3 2 39 46
Scratch Expected 2.4 2.0 5.3 7.6 28.7 46.0
% 2.2% 2.2% 6.5% 4.3% 84.8% 100.0%
Count 5 3 13 21 56 98
Logo Expected 5.2 4.3 11.4 16.1 61.1 98.0
% 5.1% 3.1% 13.3% 21.4% 57.1% 100.0%
Count 5 5 8 11 34 63
Python Expected 3.3 2.7 7.3 10.3 39.3 63.0
% 7.9% 7.9% 12.7% 17.5% 54.0% 100.0%
Count 11 9 24 34 129 207
Total
% 5.3% 4.3% 11.6% 16.4% 62.3% 100.0%
The correct answer was e) which choose 62.3% of all students. Students from Scratch group answered 84.8%
correctly, while 57.1% students in Logo group and 54% students in python group answered correctly. Again, a
high percentage of the correct answer in Scratch could be addressed to the visual representation of the
instructions, where is a clear difference between a loop and moving instructions in colour and shape (Table 2), so
students are not confused with the meaning. Lower, but still high percentages are for Logo and Python where
instructions are text-based, so the students must be sure in their meaning to answer correctly.
The most usual incorrect answer was d). Students who choose this answer ignored the first instruction, they
just reported the execution of the loop. Although repeat loop in Python seems simpler than for loop in Python
(Table 5), this error is more frequent in Logo (21.4%) than in Python group (17.5%). The same error made only
4.3% students in Scratch group.
This misconception could be addressed to the differences in the syntax. All instructions in the repeat loop in
Logo must be in the square brackets in one line, while all instructions inside for loop in Python have to be
indented one under other (Table 5) which makes instructions more clearly for reading.
The second usual incorrect answer was c) with 11.6% of all students. Students who chose this answer just
added all the numbers they saw in the instructions.
Other answers are dispersed and represented with the small rate, which indicates that students who didn't
know the correct answer were probably guessing it.
The third task was again testing the understanding of the simple loop. This time there are more instructions
inside the loop. Table 7 shows the task 3.
Table 7. Task 3
a)20
for i in range (10):
b)30
repeat 10[fd 10 rt 10 fd 10] fd(10)
c)40
rt(10)
d)200
fd(10)
e) 300
Chi-square results showed that there is a statistically significant association between answers and
programming language (χ2(10) =20.883, p=0.022). Table 8 shows the distribution of the answers by a
programming language.
Table 8. Task 3 - Distribution of the answers by programming language
No a b c d e Total
answer
Count 0 0 7 3 32 4 46
Scratch Expected .2 .9 6.0 4.4 22.4 12.0 46.0
% 0.0% 0.0% 15.2% 6.5% 69.6% 8.7% 100.0%
Count 0 1 10 11 43 33 98
Logo Expected .5 1.9 12.8 9.5 47.8 25.6 98.0
% 0.0% 1.0% 10.2% 11.2% 43.9% 33.7% 100.0%
Count 1 3 10 6 26 17 63
Python Expected .3 1.2 8.2 6.1 30.7 16.4 63.0
% 1.6% 4.8% 15.9% 9.5% 41.3% 27.0% 100.0%
Count 1 4 27 20 101 54 207
Total
% .5% 1.9% 13.0% 9.7% 48.8% 26.1% 100.0%
The correct answer was d) which choose 48.8% of all students. Students from Scratch group answered 69.6%
correctly, while 43.9% students in Logo group and 41.3% students in Python group answered correctly. Again,
Scratch group answered correctly in the higher rate, but the difference between Logo and Python was smaller
this time. This task was a little bit complicated than Task 2. There were three instructions inside the loop, the
value of two move instructions had to be summed and multiplied by the number of loop execution which is more
complicated than the previous task was only one instruction was inside the loop. This probably confused weaker
students, so the rate of correct answers was smaller than in previous tasks what was expected.
The most usual incorrect answer was e), which is the case with the Logo (33.7%) and Python group (27%).
But not the Scratch group (8.7%). For this answer students ignored the turn instructions, they sum all numbers
within instructions inside the loop. Only 8.7% students in Scratch group made this mistake, probably due to a
visual representation of the turn command in Scratch. This indicates that students didn’t have a problem with the
loop, they understand that instructions are repeating inside the loop. In Logo and Python groups students didn’t
pay attention to the meaning of instructions inside the loop. Probably because, in the rare cases or never, they
made programs with turning instructions with the same angle as the number of steps, which is the case in this
task (Table 7) which led them to this misconception that all numbers should be sum inside the loop.
The second usual incorrect answer was b) (13%), but the interesting is that this is the most usual error in
Scratch group (15.2%), unlike Logo group (10.2%) and Python group (15.9%) where the e) was the most
common incorrect answer. This answer was probably given by weaker students who sum the “blue” commands
ignoring the meaning of instructions, and ignoring the loop. This misconception is also highlighted in Python
(15.9%), probably because of indentations, they summed values in indented instructions and ignored the loop.
This error was 10.2% in Logo group, probably for the same reason.
Students who chose c) as an answer summed numbers they saw in the program. Those students didn’t adopt
loop concept. In Logo group, 10.2% of students had chosen this answer, 9.5% in Python and 6.5% of students in
Scratch group.
Answer a) is represented by the small rate (1.9%), which indicates that these students didn't know the correct
answer and were probably just guessing.
This task was the most complex of all; it consisted of two nested loops. Table 9 shows the task 4.
Chi-square results showed that there is a statistically significant association between answers and
programming language (χ2(10) =44.664, p=0.000). Table 10 shows the distribution of the answers by a
programming language.
Table 9. Task 4
a)10
for i in range (10):
b)20
repeat 10[fd 1 repeat 10[fd 1]] fd(1)
c)100
for i in range (10):
d)110
fd(1)
e) 1000
The answers were dispersed for this task. The correct answer was d) which choose only 24.6% of all students.
Students from Scratch group answered 50.0% correctly, while 24.5% students in Logo group and only 6.3%
students in Python group answered correctly. Half of the students in Scratch group answered correctly. This is
probably, again, due to a visual representation of the loops where it is obvious that one loop in inside the other.
Most students from all groups who gave the correct answer explained this correctly in the form of 10*(1+10*1).
No a b c d e Total
answer
Count 2 0 10 9 23 2 46
Scratch Expected 1.3 2.4 20.0 9.6 11.3 1.3 46.0
% 4.3% 0.0% 21.7% 19.6% 50.0% 4.3% 100.0%
Count 0 7 39 25 24 3 98
Logo Expected 2.8 5.2 42.6 20.4 24.1 2.8 98.0
% 0.0% 7.1% 39.8% 25.5% 24.5% 3.1% 100.0%
Count 4 4 41 9 4 1 63
Python Expected 1.8 3.3 27.4 13.1 15.5 1.8 63.0
% 6.3% 6.3% 65.1% 14.3% 6.3% 1.6% 100.0%
Total Count 6 11 90 43 51 6 207
% 2.9% 5.3% 43.5% 20.8% 24.6% 2.9% 100.0%
The most common answer was b) which is not correct. This answer chose students who ignored that loops
were nested. If the loops were one after other, this would be correct. This answer was the most common in the
Python group, even 65.1% of students in this group had chosen this answer, while 39.8% of students in Logo and
21.7% of students in Scratch group. Interesting is that the Python had the highest rate for this answer. When
comparing Logo and Python, there is a significant difference in syntax. As mentioned, in Logo syntax all
instructions within repeat loop are between square brackets in one line, so it is obvious that all instructions are
part of that loop. In Python, all instructions within for loop are indented under the for loop. This is not the
problem when the loop is not nested, but instructions within nested for loop are double indented which is
obviously confusing the students. This misconception is very important for teachers when teaching Python.
The next common incorrect answer was c). Students who chose this answer were multiplying the numbers
within the first loop in the form of 10*1*10*1. They superficial understood loop, so they interpreted that
everything within the loop is multiplying. This error made 20.8% of students in Scratch group, 24.5% in Logo
group and 6.3% in Python loop.
Other answers are dispersed and represented with the small rate, which indicates that these students didn't
know the correct answer and were probably just guessing.
This task consists of two simple loops. The task is somehow similar to the previous with the difference that loops
are not nested. Table 11 shows the task 5.
Table 11. Task 5
fd(1) a)20
for i in range (10): b)21
fd (1) repeat 10[fd 1] repeat 10[fd 1] fd(1) c)23
for i in range (10): d)110
fd(1) e) 103
Chi-square results showed that there is a statistically significant association between answers and
programming language (χ2(10) =34.021, p=0.000). Table 12 shows the distribution of the answers by the
programming language.
No a b c d e Total
answer
Count 2 0 43 0 1 0 46
Scratch Expected 1.3 1.8 33.1 3.6 4.0 2.2 46.0
% 4.3% 0.0% 93.5% 0.0% 2.2% 0.0% 100.0%
Count 0 3 64 8 15 8 98
Logo Expected 2.8 3.8 70.5 7.6 8.5 4.7 98.0
% 0.0% 3.1% 65.3% 8.2% 15.3% 8.2% 100.0%
Count 4 5 42 8 2 2 63
Python Expected 1.8 2.4 45.3 4.9 5.5 3.0 63.0
% 6.3% 7.9% 66.7% 12.7% 3.2% 3.2% 100.0%
Total Count 6 8 149 16 18 10 207
% 2.9% 3.9% 72.0% 7.7% 8.7% 4.8% 100.0%
The Correct answer was b) which choose even 72% of all students. Even 93.5% of Scratch group students
gave the correct answer which is maybe surprising because the lower rate of correct answers was in simple loops
in tasks 2 and 3. When comparing these tasks, we can conclude that one instruction within the loop is quite clear
in Scratch, but when there are more instructions within loop weaker students get confused. The correct answer
gave 65.3% of students in Logo group and 66.7% in Python group. It’s interesting to compare the answers from
Python group for previous and this task. It’s mentioned that the biggest difference between this two tasks is that
previous was nested loop, unlike this task. The high rate of correct answers for Python group confirms the
mentioned problem with indentations explained in the previous task. This misconception is caused with a syntax
which is important to have in mind when teaching Python.
Other answers are dispersed and represented with the small rate (under 10%), which indicates that students
who didn't know the correct answer were probably guessing.
Based on the tasks solutions analysis we can answer the RQ2 and conclude that programming language influence
the occurrence of the loops misconceptions. Said misconceptions are minimised for K-12 students when using
block-based programming language Scratch, compared to using text-based programming languages like Python
or Logo.
Programming is abstract which could be a problem for elementary school children who are mostly still on the
concrete level of cognitive development. Providing concrete to abstract experience (Dann & Cooper, 2009)
could help students to master programming concepts. It is usual that novice programmers often focus on the
syntax of the programming language instead on developing an algorithm. We can overcome this by using visual
programming languages (Grover & Pea, 2013). Many new visual programming languages emerged based on this
presumption. These languages also enable moving programming context from solving math problems to
programming games, storytelling, animations and others, thus making them more suitable for “digital natives”.
One of those languages, appropriate for elementary school children is Scratch.
This study focused on misconceptions about loops by using three programming languages—Scratch, Logo and
Python for K-12 novices. Equivalent tests were used for all programming languages so we could compare
student answers. We found that students misconceptions about loops are minimized when using a block-based
programming language - Scratch compared to text-based programming languages - Logo and Python. As the
tasks are more complex, such as using nested loops, the differences become more apparent. When comparing
Logo and Python answers, students were equally successful, except when the given task included nested loops.
When it comes to nested loops students using Python mostly didn’t recognize them, rather they recognized two
independent loops. This finding is addressed to Python syntax where all instructions within nested for loop have
double indentations which is obviously confusing to students.
Results from this research confirm the justification to use the visual programming language Scratch for teaching
K-12 novices programming by programming games. Syntax problems are eliminated thus students can focus on
algorithms. As 5th and 6th-grade students are mostly still in the pre-formal phase of cognitive development,
programming games in visual programming languages offer them a concrete experience when learning hard
programming concepts. When compared to students using text-based programming language misconceptions are
also minimised. According to our results, we can conclude that programming games by using visual
programming languages can facilitate the process of learning programming.
References
Berland, M., Martin, T., Benton, T., Petrick Smith, C., & Davis, D. (2013). Using learning analytics to understand the
learning pathways of novice programmers. Journal of the Learning Sciences, 22(4), 564–599.
Bonar, J., & Soloway, E. (1983). Uncovering principles of novice programming. In Proceedings of the 10th ACM SIGACT-
SIGPLAN symposium on Principles of programming languages (pp. 10–13).
Brown, J. S. (2000). GROWIING UP DIGITAL. How the Web Changes Work, Education, and the Ways People Learn. The
Magazine of Higher Learning, 32(2).
Brusilovsky, P., Calabrese, E., Hvorecky, J., Kouchnirenko, A., & Miller, P. (1997). Mini languages: A Way to Learn
Programming Principles. Education and Information Technologies, 2(1), 65–83.
https://doi.org/http://dx.doi.org/10.1023/A:1018636507883
Clegg, T. L., & Kolodner, J. L. (2007). Bricoleurs and planners engaging in scientific reasoning: A tale of two groups in one
learning community. Research and Practice in Technology Enhanced Learning, 2(3), 239–265.
Dann, W., & Cooper, S. (2009). Education: Alice 3: Concrete to Abstract. Commun. ACM, 52(8), 27–29.
https://doi.org/10.1145/1536616.1536628
Dehnadi, S. (2009). A cognitive study of learning to program in introductory programming courses. Middlesex University.
Fusco, E. (1981). Matching curriculum to students cognitive levels. Educational Leadership, 39(1), 47.
Garneli, V., Giannakos, M. N., & Chorianopoulos, K. (2015). Computing education in K-12 schools: A review of the
literature. In Global Engineering Education Conference (EDUCON), 2015 IEEE (pp. 543–551).
Gomes, A., & Mendes, A. J. N. (2007). Learning to program-difficulties and solutions. International Conference on
Engineering Education, 1–5.
Grover, S., & Basu, S. (2017). Measuring Student Learning in Introductory Block-Based Programming. In Proceedings of the
2017 ACM SIGCSE Technical Symposium on Computer Science Education - SIGCSE ’17 (pp. 267–272). New York,
New York, USA: ACM Press. https://doi.org/10.1145/3017680.3017723
Grover, S., Cooper, S., & Pea, R. (2014). Assessing computational learning in K-12. In Proceedings of the 2014 conference
on Innovation & technology in computer science education - ITiCSE ’14 (pp. 57–62).
https://doi.org/10.1145/2591708.2591713
Grover, S., & Pea, R. (2013). Computational Thinking in K--12 A Review of the State of the Field. Educational Researcher,
42(1), 38–43.
Grover, S., Pea, R., & Cooper, S. (2015). Designing for deeper learning in a blended computer science course for middle
school students. Computer Science Education, 25(2), 199–237. https://doi.org/10.1080/08993408.2015.1033142
Guzdial, M. (2004). Programming environments for novices. Computer Science Education Research, 2004, 127–154.
Kafai, Y. B. (2006). Playing and Making Games for Learning. Games and Culture, 1(1), 36–40.
https://doi.org/10.1177/1555412005281767
Kafai, Y. B., & Burke, Q. (2015). Constructionist Gaming: Understanding the Benefits of Making Games for Learning.
Educational Psychologist, 50(4), 313–334. https://doi.org/10.1080/00461520.2015.1124022
Ke, F., & Fengfeng. (2014). An implementation of design-based learning through creating educational computer games: A
case study on mathematics learning during design and computing. Computers & Education, 73, 26–39.
https://doi.org/10.1016/j.compedu.2013.12.010
Kelleher, C., & Pausch, R. (2005). Lowering the barriers to programming: A taxonomy of programming environments and
languages for novice programmers. ACM Computing Surveys (CSUR), 37(2), 83–137.
Kölling, M., & McKay, F. (2016). Heuristic Evaluation for Novice Programming Systems. ACM Transactions on Computing
Education (TOCE), 16(3), 12.
Kuechler, W. L., & Simkin, M. G. (2003). How well do multiple choice tests evaluate student understanding in computer
programming classes? Journal of Information Systems Education, 14(4), 389.
Lahtinen, E., Ala-Mutka, K., & Järvinen, H.-M. (2005). A study of the difficulties of novice programmers. ACM SIGCSE
Bulletin, 37(3), 14. https://doi.org/10.1145/1151954.1067453
Linn, M. C., & Dalbey, J. (1985). Cognitive consequences of Programming Instruction: Instruction, Access, and Ability.
Educational Psychologist, 20(4), 191–206. https://doi.org/10.1207/s15326985ep2004_4
Louis, C., Lawrence, M., & Keith, M. (2011). Research Methods in Education. Oxford, UK: Routledge.
https://doi.org/10.4324/9780203720967
Maloney, J. H., Peppler, K., Kafai, Y., Resnick, M., & Rusk, N. (2008). Programming by choice. ACM SIGCSE Bulletin,
40(1), 367. https://doi.org/10.1145/1352322.1352260
Mayer, R. E. (1981). The Psychology of How Novices Learn Computer Programming. ACM Computing Surveys, 13(1), 121–
141. https://doi.org/10.1145/356835.356841
McCracken, M., Almstrum, V., Diaz, D., Guzdial, M., Hagan, D., Kolikant, Y. B.-D., … Wilusz, T. (2001). A Multi-national,
Multi-institutional Study of Assessment of Programming Skills of First-year CS Students. SIGCSE Bull., 33(4), 125–
180. https://doi.org/10.1145/572139.572181
McKenna, P. (2004). Gender and black boxes in the programming curriculum. Journal on Educational Resources in
Computing, 4(1), 6--es. https://doi.org/10.1145/1060071.1060077
Mladenović, M., Krpan, D., & Mladenović, S. (2016). Introducing programming to elementary students novices by using
game development in Python and Scratch. In EDULEARN16 Proceedings (pp. 1622–1629). IATED.
https://doi.org/10.21125/edulearn.2016.1323
Mladenović, M., Rosić, M., & Mladenović, S. (2016). Comparing Elementary Students ’ Programming Success Based on
Programming Environment. International Journal of Modern Education and Computer Science, 8(August), 1–10.
https://doi.org/10.5815/ijmecs.2016.08.01
Mladenović, S., Krpan, D., & Mladenovic, M. (2016). Using games to help novices embrace programming: From elementary
to higher education. International Journal of Engineering Education, 32(1), 521–531.
Myers, B. A. (1990). Taxonomies of visual programming and program visualization. Journal of Visual Languages &
Computing, 1(1), 97–123.
Papert, S. (1980). Mindstorms: Children, Computers, and Powerful Ideas. New York, NY, USA: Basic Books, Inc.
Papert, S. (1993). The children’s machine: rethinking school in the age of the computer. BasicBooks. Retrieved from
http://dl.acm.org/citation.cfm?id=139395
Papert, S. (2010). Does Easy Do It? Children, Games, and Learning. Game Developer.
https://doi.org/10.1017/CBO9781107415324.004
Piaget, J. (1952). The origins of intelligence in children. American Psychological Association ({APA}).
https://doi.org/10.1037/11494-000
Prensky, M. (2001). Digital Natives,Digital Immigrants Part 1. On the Horizon, 9, 1–6.
https://doi.org/10.1108/10748120110424816
Robins, A., Rountree, J., & Rountree, N. (2003). Learning and teaching programming: A review and discussion. Computer
Science Education, 13(2), 137–172.
Sekiya, T., & Yamaguchi, K. (2013). Tracing quiz set to identify novices’ programming misconceptions. In Proceedings of
the 13th Koli Calling International Conference on Computing Education Research - Koli Calling ’13 (pp. 87–95).
New York, New York, USA: ACM Press. https://doi.org/10.1145/2526968.2526978
Turkle, S., & Papert, S. (1992). Epistemological Pluralism and the Revaluation of the Concrete. Journal of Mathematical
Behavior, 11(1), 3–33.
Winslow, L. E. (1996). Programming pedagogy---a psychological overview. ACM SIGCSE Bulletin, 28(3), 17–22.
https://doi.org/10.1145/234867.234872
Zur-Bargury, I., Pârv, B., & Lanzberg, D. (2013). A nationwide exam as a tool for improving a new curriculum. In
Proceedings of the 18th ACM conference on Innovation and technology in computer science education - ITiCSE ’13
(p. 267). New York, New York, USA: ACM Press. https://doi.org/10.1145/2462476.2462479