Abstract
Block-based programming languages (BBLs) have been proposed as a way to prepare students for learning to program in more sophisticated, text-based languages, such as Java. Hybrid BBLs add the ability to view and edit the block commands in auto-generated, text-based code. We compared the use of a non-hybrid BBL (Scratch), a hybrid BBL (Pencil Code), and no BBL across three sections of an introductory CS course that taught Java programming, to determine whether either type of BBL offered cognitive or affective advantages for learning Java. Students in the BBL groups were surveyed about their perceptions of each BBL in terms of ease of use and helpfulness in learning Java, and all three groups were compared on their performance in Java programming. The results showed that, in this introductory CS course, neither type of BBL offered an advantage in preparing students for learning Java. These results held regardless of the students’ level of Java knowledge prior to the course.
Keywords
A significant issue for computer science education researchers is the high failure rate in introductory college programming courses (Vihavainen et al., 2014). Studies by Watson and Li (2014) and Bennedsen and Caspersen (2007) estimate the worldwide failure rate at about 30%. Failure or poor performance in an introductory programming course, such as “CS1,” the standard first-year computer-science course, can discourage students and cause them to abandon the computer-science major (Bergin & Reilly, 2005). This situation may be contributing to the observed decline in computer science majors (Watson & Li, 2014).
One approach to solving this problem has been establishing a “Computer Science Orientation” (CS0) course—a preparatory (but usually non-prerequisite) course for CS1 (Cook, 1997; Vihavainen et al., 2014). Another approach has been to develop new programming languages that are specifically designed for teaching programming—transitional tools to facilitate the learning of more sophisticated, industry-standard languages such as Java. These new languages, which include Alice, Scratch, and MIT App Inventor, share two main pedagogical features. First, their “block-based” structure greatly reduces the amount of syntax (coding grammar) that students must learn (Resnick et al., 2009), enabling them to more quickly understand broader programming concepts (Bau et al., 2017; Kaucic & Asic, 2011). Second, these block-based languages (BBLs) make it easy to program interactive stories, games, and animations, which can be fun and motivating for students and can simplify error-detection and debugging (Moors et al., 2018). In other words, BBLs are theorized to have both affective and cognitive benefits for learners. BBLs were originally developed for children, but they have increasingly been incorporated into college-level CS0 and CS1 courses (Kaucic & Asic, 2011; Resnick et al., 2009; Rizvi & Humphries, 2012).
More recently, hybrid languages have emerged in K-12 computer-science education. Hybrid languages are block-based, but they allow students to “toggle” to a code view, where they can read and, in some cases, edit a translation of the block command into a more traditional, text-based language. Hybrid BBLs ostensibly facilitate the transition from non-hybrid BBLs to Java or other traditional, text-based languages (Bau et al., 2017).
Because hybrid BBLs are relatively new, their use, especially in college programming courses, has been little studied. This is unfortunate, given the hunger of CS educators for ways to attract and retain CS majors. Presumably, a tool that helped students learn the language used in CS1 and later courses would mitigate failure and dropout rates. In this article, we report on an investigation of student perceptions of a hybrid and a non-hybrid BBL in an introductory, college computer science (CS0) course and the comparative impact of these tools on learning Java.
Literature Review
Purposes for Teaching Programming
Computer-science educators commonly grapple with the question of what programming language to use in the classroom (Kolling, 1999; Pane et al., 2001; Pears et al., 2007). This decision should take into account the course’s purpose for teaching programming (Pears et al., 2007). One main purpose for teaching programming is to prepare programmers, either for programming jobs or for future courses that require programming (Bau et al., 2017). For this purpose, the choice of language should reflect the profession, ultimately training students to code in Java, C, C++, or another industry standard. An alternative purpose for teaching programming is to developing general problem-solving and thinking skills that are presumed to be useful and usable in non-programming situations (Bau et al., 2017; Klahr & Carver, 1988; Pears et al., 2007). The term computational thinking has been used to encompass a range of competencies that are related to programming but more broadly applicable, including understanding abstractions and pattern generalizations; using symbol systems and representations; iterative, recursive, and parallel thinking; and conditional logic (Grover & Pea, 2013; Lye & Koh, 2014). For this purpose, the choice of programming language is irrelevant as an outcome, because learning that language is not the primary goal. An easier-to-learn language would be a sensible choice in this case, on the theory that the general cognitive skills can be gained from programming experience regardless of the specific language used.
Despite the fundamental difference between these two purposes for teaching programming, a BBL could be a reasonable choice for a programming course with either purpose, with the caveat that preparing future programmers would require an eventual transition to an industry-standard language.
Block-Based Languages
Block-based languages (BBLs) are a subcategory of visual programming languages. Students create programs by intuitively dragging and dropping predefined, block-shaped commands into stacks; writing lines of code is not required. Commands of a type, such as control structures, are represented with the same-shaped block, with the shapes ensuring that command blocks can only be stacked in syntactically correct orders. BBL programs are interactive, with graphical user interfaces; for example, users often program simple video games or animations. BBLs are theorized to be easier to learn than text-based languages because they reduce the cognitive load required to learn complicated syntax, thus freeing up cognition for learning programming concepts (Bau et al., 2017). BBLs have a “low bar” for entry: Beginners can create basic animations with minimal instruction, and trial and error is a feasible route to a working program. The experience of quick success can motivate continued effort (Resnick et al., 2009). Young children can become proficient in, and excited by, BBLs, which could help recruit new generations of CS majors. And eliminating the frustration of the inevitable and ubiquitous syntax errors of text-based programming could remove a suspected cause of retention problems in computer-science courses (Besana et al., 2006; Kay et al., 2000; Kaucic & Asic, 2011).
Scratch, a web-based, open-source language, is one of the most commonly used BBLs (Lamb & Johnson, 2011; Lye & Koh, 2014). With Scratch, students intuitively drag and drop the block commands into stacks, as shown in Figure 1, to create animations of a “sprite”—a character the student selects or designs. Programs can be quickly run without compiling, by clicking on the flags (as shown in Figure 1), allowing for immediate testing and viewing of results. Motivation and learning with Scratch are enhanced by a large online community who shares animations on the Scratch website and can explore, borrow, and modify each other’s programs (Brennan et al., 2010).

Example of Scratch Interface.
Although Scratch has the advantage of using predefined command blocks that save students from having to type code, the limited number of block types and the inability to manually edit code renders Scratch a relatively inflexible language. In response, hybrid programming languages have emerged as the next generation of visual tools for K-12 programming (Bau et al., 2017; Weintrop & Holbert, 2017). Hybrid languages offer all the advantages of earlier BBLs but add the ability to view (and edit) the block commands in the form of auto-generated, text-based code. Pencil Code (pencilcode.net) and Tynker (tynker.com) are examples of hybrid BBLs. In Pencil Code, an open-source, hybrid BBL, students toggle between block-view and code-view windows. They create programs by dragging and stacking blocks in the block-view window or editing auto-generated code in the code-view window, or both (see Figure 2).

Example of Pencil Code interface.Note. Block view appears on the left side; code view appears on the right side.
BBLs have been used in educational settings where the goal is to develop computational thinking or other general problem-solving skills, which BBLs are presumed to engender. BBLs are also used in courses aimed at preparing programmers, to facilitate the learning of an industry-standard (target) language such as Java. Here, the presumption is that the time invested in teaching and learning the BBL is a worthy tradeoff for time that could be spent directly teaching the target language, even though learning the BBL is not the eventual goal (de Kereki, 2008; Weintrop & Holbert, 2017). Because this study focuses on this latter purpose (preparation to learn Java), we now discuss two types of rationale—affective and cognitive—that support this tradeoff.
Affective Rationales for Using BBLs to Prepare Programmers
Affective rationales have been used to support the idea of starting with a BBL even when the goal is to eventually learn an industry-standard language. BBLs are designed to motivate students, leveraging the inherent fun of creating animations to excite students about programming. Motivation has long been known to promote learning, provided the motivation is intrinsic (e.g., due to enjoyment or interest) as opposed to extrinsic (e.g., for the reward of a good grade) (National Research Council, 2000; Pintrich, 1999); this has been shown to be true of programming in particular (Bergin & Reilly, 2005).
In addition to being motivational, BBLs are designed to reduce anxiety and build self-efficacy (Malan & Leitner, 2007; Meerbaum-Salant et al., 2013; Price & Barnes, 2015). Much literature demonstrates the negative impact of anxiety on learning (Derakshen & Eysenck, 2009; Wood, 2006). Computer anxiety—a fear of computers when using a computer or considering the possibility of computer use (Chua et al., 1999)—is a major and widely recognized problem for students and other adults (Brosnan, 1998; Wilfong, 2006). Computer anxiety can cause individuals to avoid computers and computer courses, but it can be mitigated through training (Chua et al.,1999). Programming anxiety is a specific case of computer anxiety that plagues many CS students and has been shown to cause poor performance and negatively impact retention in CS programs (Connolly et al., 2009; Nolan & Bergin, 2016). Theorized causes of programming anxiety include the inherent difficulty of programming, the lack of prior programming experience many students bring to introductory college CS courses, intimidation by the constant negative feedback of error messages, and the public nature of computer labs, which invites peer comparison (Connolly et al., 2009; Nolan & Bergin, 2016). Programming anxiety has only intensified over the past few decades as introductory programming courses have become more abstract and conceptual (Connolly et al., 2009).
Closely related to anxiety is self-efficacy—a judgment of “how well one can execute courses of action required to deal with prospective situations” (Bandura, 1982, p. 122), in this case in programming (Nolan & Bergin, 2016). Low programming self-efficacy correlates with reduced performance in CS courses (Bergin & Reilly, 2005), and self-efficacy has been found to mediate the relationship between anxiety and performance (Brosnan, 1998; Wilfong, 2006). As Brosnan (1998) demonstrated, only if a student’s programming anxiety reduces her programming self-efficacy will her performance be compromised; similarly, only if a reduction in programming anxiety is accompanied by an increase in programming self-efficacy will performance be improved. These findings suggest that CS educators should focus directly on building programming self-efficacy rather than just aiming to reduce anxiety. With regard to BBLs, the “low bar” for entry (the ease with which a novice can create a simple program) and the quick and continued success that BBLs offer new programmers could be expected to develop programming self-efficacy, therefore enabling and motivating students to learn more challenging programming languages in the future.
Some research indicates that BBLs have produced positive affective outcomes with college students. Small-scale studies report that college students find Scratch to be motivating and enjoyable (Chang, 2014; de Kereki, 2008; Krafft et al., 2020; Malan & Leitner, 2007; Rizvi & Humphries, 2012) and that it can help build programming self-efficacy (Krafft et al., 2020; Rizvi & Humphries, 2012). Yet, a large-scale study of college students by Chen et al. (2019) found that prior BBL experience was no likelier to improve attitudes towards programming than was prior experience with textual languages. Few studies have examined the impact of hybrid BBLs in particular on programming anxiety or self-efficacy. High school students studied by Weintrop and Wilensky (2015) found that Snap!, a BBL that can be configured into a hybrid mode, was easier to read and program in than Java. Weintrop and Holbert (2017) observed high-school and graduate-school students using Pencil Code. Both groups of students chose mainly to work with the block commands, though they toggled to code view with gradually increasing frequency as they gained experience. That this hybrid BBL allows students to control their learning experience and choose their own level of support might serve to increase self-efficacy. Blanchard et al. (2019) found that 8th graders who transitioned to the use of a hybrid language after using a BBL and before transitioning to a text-only environment had more positive perceptions about the text-based environment than their counterparts who either transitioned from the BBL directly to the text-only environment or worked in the text-only environment for the entire study period. Deng et al. (2015), similarly, found that high school students who learned Pencil Code were more confident about programming than those who learned in a text-based environment.
Cognitive Rationale for Using BBLs to Prepare Programmers
Learning to program requires a solid understanding of key programming concepts, such as variables and control structures. It also requires learners to construct mental models of programs (Robins et al., 2003). The cognitive rationale for having students first learn a BBL, even when the ultimate goal is to learn a text-based language, is that these cognitive accomplishments are presumed to be achieved equally well in a BBL as in the target language (Bau et al., 2017; Kaucic & Asic, 2011; Price & Barnes, 2015). But without the interference of having simultaneously to learn the complicated syntax of the target language, these critical cognitive accomplishments are presumed to occur more quickly and deeply in a BBL. Thus, when BBL-trained students transition to the target language, they learn it more rapidly than students who had been taught these concepts and skills in the target language from the start.
This cognitive rationale depends on the phenomenon of learning transfer. We next discuss two theoretical perspectives on transfer.
The Traditional View of Transfer
In the traditional view of transfer, a learner directly applies what she has learned in one setting (such as a school course) to another (a different course or an out-of-school situation). To use a programming example, in traditional transfer, the student who learned general programming concepts and mental models via a BBL would directly apply them to a new language, such as Java, being able to understand and code in the new language without additional assistance or training. Historically, direct transfer has been notoriously difficult to document (Bransford & Schwartz, 1999). Furthermore, in many situations, including teaching programming, it is a higher bar than educators are interested in.
Preparation for Future Learning
A more recent view of transfer—preparation for future learning (PFL) (Bransford & Schwartz, 1999; Schwartz et al., 2005)—resolves many of the problems with the traditional view. In the PFL view of transfer, the outcome of interest is an increased readiness to learn new knowledge. Learning activities that do not result in traditional (directly applicative) transfer may nevertheless build the learner’s potential for further learning, a phenomenon that Schwartz and his colleagues have empirically demonstrated in multiple school activities (Schwartz et al., 2005). The PFL view of transfer better reflects the interests of college CS educators. While their desired outcome is for students to be able to program in an industry-standard, target language such as Java, they do not expect a BBL to enable students to program in the target language automatically, without any instruction in it. CS instructors of course intend to teach and provide opportunities for students to practice the target language. Their hope for teaching a BBL prior to the target language is that it will better prepare students to learn the target language—more deeply and more easily—when instruction in the target language is ultimately offered (Han Koh et al., 2010; Weintrop & Holbert, 2017).
A few studies have examined whether BBLs prepare college-level students to learn Java. Malan and Leitner (2007) found that teaching Scratch in a summer-school setting helped college students learn Java, presumably because of the key programming concepts learned via Scratch. Studies by Moskal et al. (2004) and Dann et al. (2012) document the advantage enjoyed by college students who first learned Alice over those who did not, when learning Java. Moskal et al. (2004) also found that taking a supplemental course in Alice improved the likelihood of CS1 students continuing into CS2. In contrast, de Kereki (2008) found no learning benefits in a CS1 course when Scratch was used as preparation for learning Java; the time spent learning an extra language was inferred to have mitigated any pedagogical advantage over learning Java only.
Hybrid BBLs, such as Pencil Code and Tynker, could theoretically prepare students to learn Java or other industry-standard languages even better than could a block-only language (a non-hybrid BBL) like Scratch. The ability to view block commands in auto-generated code, and to edit that code, would seem to offer a smoother transition to text-based programming (Bau et al., 2017; Weintrop & Holbert, 2017). Two studies, one by Blanchard et al. (2019) and the other by Alrubaye et al. (2019), suggest that learning a hybrid language, for 8th graders and undergraduates, respectively, can facilitate the subsequent learning of a simple text-based language. At the college level, Blanchard et al. (2020) found that the use of a hybrid BBL in a CS1 course benefited students on course assessments of reading and writing Java code but not on a validated assessment of programming concepts, compared to students who received solely text-based instruction.
Overview of Study
Our study aimed to understand the benefits of two BBLs—one non-hybrid, Scratch, and one hybrid, Pencil Code—for preparing students in an introductory-level CS course for future learning of an industry-standard language, Java. We examined both the affective and cognitive influences of these languages by asking these research questions:
RQ 1 How do students in an introductory-level CS course perceive the experience of learning an industry-standard language after learning a non-hybrid block-based programing language (BBL), a hybrid BBL, or no BBL? RQ 2 Does learning a non-BBL or hybrid BBL prepare students to learn an industry-standard language better than does not learning a BBL?
Three sections of a CS0 course were introduced to Java programming. One section was first taught Scratch prior to being introduced to Java; one section was first taught Pencil Code prior to Java; and the remaining section was only taught Java. RQ 1 was addressed via questionnaires to students regarding their perceptions of the ease of learning of Scratch, Pencil Code, and/or Java as a way of measuring their self-efficacy in these languages. RQ 2 was addressed with unit tests from the CS0 course that assessed the students’ learning of programming concepts and Java coding.
Method
Participants and Setting
California State University, Northridge (CSUN), is a large, public institution in southern California that, by state policy, accepts students from the top third of their high-school classes, prioritizing local applicants. The student body is highly diverse, and CSUN is a designated Hispanic Serving Institution, Asian American and Native American Pacific Islander Serving Institution, and Minority Institution. This study took place in 3 CSUN CS0 course sections during the Fall 2019 semester, all taught by the first author. This CS0 course is recommended, but not required, for incoming computer science and engineering majors with limited computing experience. It focuses on developing skills in problem solving, algorithm development, critical thinking, and programming, mainly in the context of computer science. The course also provides an orientation to the University and addresses campus resources, study skills, and career awareness. The department has chosen Java as the target language for its CS1 course. Because one potential benefit of CS0 is to help students transition into CS1, the first author decided to use Java as the target language for her CS0 course. Another reason for her choice of Java over a more user-friendly language was that some important course concepts could only be taught via an object-oriented language.
Data were collected from all 84 students across the 3 CS0 sections. The students completed a questionnaire that asked basic demographic information. By self-report, 78% of the participating students were freshman, and 80% were male. Computer science was the anticipated major for 62% of these students, with another 24% intending to major in a computer-related area. The questionnaire also asked the students to rate their prior level of experience with Scratch, Pencil Code, Java, and any other programming language. Most students reported at least “A little” prior experience with some programming language, and about half cited at least “Some,” but only a few had “Quite a bit” or “A lot” of experience in any language. As a group, the students had less prior experience in Pencil Code than in Scratch or Java.
This level of prior programming experience is somewhat surprising for a CS0 course, which presumes no prior experience. We can only guess why students with prior programming experience would have self-selected into this course: We suspect these students either lacked the math-course prerequisites for our university’s CS1 course, had scheduling conflicts with CS1, or underestimated their qualification for CS1. The range of prior experience in our participants offered a built-in advantage for our study, however, in that it allowed us to explore whether the BBLs were differently effective in preparing more and less experienced programmers for learning Java.
Procedures
Languages
Java is the department-determined target language for the CS1 course and so was the first author’s target language choice for these CS0 sections. For this study, two BBLs were selected: one non-hybrid (Scratch) and one hybrid (Pencil Code). These two were selected among other possible BBLs because they were free and web-based, which allowed students to run them on any device. When students toggle to code view in Pencil Code, they are offered four language choices: CoffeeScript, JavaScript, CSS, and HTML. Students in this study were instructed to select JavaScript, because it was the closest of the four languages to Java. Another popular hybrid BBL, Alice, uses Java in its code view, which might have made Alice a better choice for a course that aimed ultimately to teach Java. In Alice, however, students program 3-D animations, which we felt presented an unnecessary degree of complexity for this study. And because we wanted to minimize the differences (other than hybridity) between the two BBLs for a fairer comparison, it made sense to select the 2-D Pencil Code to compare with 2-D Scratch.
Conditions
The 84 students self-enrolled into one of three, separately taught sections of CS0 taught by the first author, who randomly designated one section as the Scratch section, one as the Pencil Code section, and one as the Java section; these designations were unknown to students when they enrolled. A limitation of this study is that the students were not assigned to sections randomly, but we can think of no reason why the different sections might systematically have sorted the students on any relevant factor. All sections met during the daytime, with two sections meeting twice a week, Mondays and Wednesdays, and the third meeting Fridays for twice as long. Indeed, Table 1 shows that the students in the three sections were reasonably equivalent in terms of year, gender, major, and prior programming experience, with the exception that the Java section had slightly more males and slightly more students entering the course with self-reported prior Java experience but slightly fewer students reporting at least “Some” prior experience in any language.
Participant Characteristics.
Pretesting
At the start of the semester, students in all three sections took two pretests (see Online Appendix A for sample questions) as a means of establishing a baseline level of programming knowledge:
A Java pretest asked students to read and interpret a simple Java program and answer ten questions about what output the program would produce at various points. Scores ranged from 0 (no correct answers) to 10 (all correct answers). A programming concepts quiz asked students questions about basic programming concepts such as variables and loops; questions were written in English and involved no computer language. Scores ranges from 0 to 20.
Table 2 shows the results of these two pretests for each section. For each pretest, a one-way ANOVA was conducted to compare the three sections. No significant differences were found (for the Java pretest, F(2, 78) = 0.12, p = 0.887; for the concepts quiz, F(2, 68) = 2.49, p = 0.091), suggesting that the sections were equivalent in terms of prior knowledge of basic programming concepts and Java. On average, the students had a fairly strong prior knowledge of basic programming concepts but weak knowledge of Java.
Pretest Scores.
Note. No F-test was statistically significant at p < .05.
Instruction
In the first three weeks of the semester, students in all sections received the same introduction to the concepts of personal computers, data storage, basic machine codes, and algorithms. The remainder of the course addressed four major topics: variables, selections, loops, and functions. Each of these four units included individual assignments, a group project, and a unit test. In the Scratch section, Units 1 and 2 were taught with Scratch and Units 3 and 4 were taught with Java. In the Pencil Code section, Units 1 and 2 were taught with Pencil Code and Units 3 and 4 were taught with Java. In the Java section, all four Units were taught with Java. The instructor based this configuration on two considerations: She wanted students to have enough experience with the BBL to reap its pedagogical benefits, and she knew that Units 3 and 4 involved more challenging topics and so wanted students to be able to devote their time to learning them in a single language. This instructional sequence is shown in Table 3.
Instructional Sequence.
To the degree possible, all assignments, projects, and tests were identical across sections except for the difference in language. An example of how a topic was addressed follows.
In the Scratch section, to start Unit 1, the instructor explained the concept of variables and common numerical operations and showed the students how to create variables, mathematical expressions, and short programs in Scratch. Figures 3 and 4 show examples of the instructor-prepared slides that accompanied this early Scratch lesson. The instructor first displayed a possible algorithm for division, with intermediate phases written in English (left side of Figure 3). Then she showed how to translate Phase 1 from English into its corresponding Scratch command in the following slide (right side of Figure 3). She continued to translate all phases into their Scratch commands in subsequent slides. Finally, she displayed the complete translation of the algorithm in Scratch as a review (Figure 4) and prompted students to build the program by dragging and dropping the blocks.

Slides from an Early Lesson in Scratch.

Example Exercise in Scratch.
In subsequent lessons, students practiced writing short Scratch programs from given English algorithms, then began to write their own algorithms prior to coding. Early lessons in the Pencil Code and Java sections proceeded similarly.
For Unit 3 (loops), the BBL sections transitioned to Java for the first time. The instructor leveraged the students’ knowledge of the BBL by first demonstrating a program with a loop in the BBL, then translating from BBL commands to Java commands. Figure 5 shows an example slide that the instructor displayed to show the Scratch section how Scratch commands translated to Java. In comparison, students in the Java section only needed to be taught loop-related commands, as they had been using Java through the first two units.

Example Slide Demonstrating the Translation of Scratch Commands to Java.
Data Collection and Analysis for RQ1
To answer RQ 1—How do students in an introductory-level CS course perceive the experience of learning an industry-standard language after learning a non-hybrid block-based programing language (BBL), a hybrid BBL, or no BBL?—the students completed a brief, anonymous, Perceptions Questionnaire at the end of the semester, via the online course-management platform. It asked:
How challenging was it for you to learn [Scratch/Pencil Code/Java] this semester? (10-point Likert scale; students asked only about the language[s] taught in their section) How confident do you feel now about your ability to program in [Scratch/Pencil Code/Java]? (10-point Likert scale; students asked only about the language[s] taught in their section) Do you think learning [Scratch/Pencil Code] first made it easier for you to learn Java? (10-point Likert scale; students asked only about the language taught in their section; not asked in Java section)
Responses for each question were disaggregated by group and descriptive statistics were calculated. Items asking about the BBLs were only answered by two groups: the Scratch and Pencil Code groups; for these items, independent t-tests were conducted to determine the significance of the differences between the groups’ ratings. The other items were answered by all three groups; for these items, one-way ANOVAs or ANCOVAs were conducted.
This questionnaire also asked:
If you feel learning [Scratch/Pencil Code] first made it easier for you to learn Java, please explain why. (Write-in response, not asked in Java section).
Students wrote short explanations, which we grouped into categories; we then tallied the frequency of responses in each category.
Data Collection and Analysis for RQ2
To answer RQ 2—Does learning a non-hybrid BBL or hybrid BBL prepare students to learn an industry-standard language better than does not learning a BBL?—we examined the scores on the final two unit tests. All students, regardless of section, took these same two unit tests, which assessed their knowledge of Java. Multiple-choice and short-answer questions asked students to predict the output of sections of Java code; other questions required students to write Java code to complete incomplete programs or to create entire programs (sample tasks from these unit tests can be found in Online Appendix B). The instructor evaluated these tests for completeness and correctness of coding. In total, these tests constituted 40% of the students’ course grade.
The means and standard deviations of the scores on each unit test were calculated for each of the three groups and compared. A one-way ANOVA was conducted to determine the significance of any differences among the groups’ means.
Because some students had brought prior Java experience to the course, we were interested to see whether RQ2 might be answered differently for students with different degrees of prior Java knowledge. For example, we might predict that learning a BBL before learning Java might be more helpful for students with little initial knowledge of Java but less useful to students with more initial Java knowledge. To explore this idea, we ran an ANCOVA to test for differences among the unit test results for the three groups while controlling for scores on the Java pretest. A univariate ANOVA was first used to confirm the required assumptions of ANCOVA.
Results
RQ1: Student Perceptions
Difficulty and Confidence With Each Language
Table 4 shows the mean ratings that students in each section gave for how challenging it was to learn each language and their confidence, by the end of the course, in programming in that language.
Mean Difficulty and Confidence Ratings.
Note. The first two outcomes were tested with a one-way ANOVA, and the second three with an independent t-test.
*p < .05.
In general, students who learned either of the BBLs found the BBL easier to learn than Java, as would be expected, given that these BBLs were designed to be easier to learn (p-values < 0.001). Students in the Scratch group were also more confident about their ability to program in Scratch than in Java. (p < 0.001), but the Pencil Code group did not feel differently confident about programming in Pencil Code and Java. Independent t-tests showed no significant difference between Scratch and Pencil Code in terms of how easy students felt these languages were to learn (t = −1.231, p = 0.224) or how confident students were in using them (t = 1.481, p = 0.154).
More important are the perceptions across groups about learning Java. We conducted one-way ANOVAs to test differences among the three groups in terms of their perceived difficulty in learning Java and their confidence in Java. There was a significant omnibus effect for Java confidence (F[2, 77] = 3.58, p = 0.033) but not for difficulty (F[2, 77] = 3.12, p = 0.050). Tukey HSD tests showed a difference in only one mean comparison: students in the Scratch section found learning Java more difficult (M = 7.57) than did students in the Java section (M = 5.72, p = 0.044). The interpretation is that the students who learned only Java for the entire semester felt that learning Java was easier than did the students who spent the first part of the semester learning Scratch (but not Pencil Code) before being introduced to Java. Similarly, students in the Java section felt more confident (M = 6.96) about programming in Java than did the Scratch section (M = 5.29, p = 0.039), but not significantly more than did the Pencil Code section. Overall, these data suggest that, while Scratch and Pencil Code are easier to learn than Java, spending time learning them did not pay off in terms of students’ feelings of ease or confidence in learning the target language, Java.
When directly asked whether learning the BBLs made learning Java easier, students in the Scratch section gave Scratch a mildly positive rating (M = 6.56 on a scale of 1 [Not easier] to 10 [Much easier]) but students in the Pencil Code section gave a mildly negative rating (M = 4.62), a difference that was significant (t = 2.344, p = 0.023). This is a somewhat surprising finding: Pencil Code, as a hybrid between a BBL and code-based language, would seem to provide a smoother transition to Java than would Scratch, which offers no code-writing practice.
How the BBL Helped Students Learn Java
Students who felt that learning a BBL had helped them learn Java were asked to briefly explain why they felt this way. Table 5 shows the categories of reasons and the frequencies of responses within each.
Reasons Why the BBL Helped Students Learn Java.
According to these students, the main value of the BBLs was that they helped students understand basic programming concepts, which may have prepared them indirectly to learn Java, by giving them a conceptual understanding of what a Java program was “doing.” Less cited were more direct links between the BBL and Java, though, as expected, such reasons were more prevalent in the Pencil Code section. Interestingly, only students in the Scratch section cited the simplicity or visual nature of the blocks or the elimination of complicated syntax, even though Pencil Code offers these same features.
An important question is whether students in the Pencil Code section actually took advantage of the hybrid nature of Pencil Code. If students never toggled to Pencil Code’s code-view window and edited or wrote code, they were for all practical purposes using a non-hybrid BBL—that is, only manipulating blocks. In the end-of-course Perceptions Survey, students in the Pencil Code section were asked whether they used both views (block and code) or exclusively worked in one view. Of the 26 Pencil Code students who responded to this question, 20 indicated that they used both views, presumably practicing some code-writing or editing, while only four stayed exclusively in block view and two in code view. Because most Pencil Code students used both block and code view, it is surprising that so few of them cited this transitional experience to coding as a reason why Pencil Code helped them learn Java.
RQ 2: Preparation for Learning Java
Overall Java Performance
Table 6 shows the mean scores on the two unit tests on Java.
Scores on Java Unit Tests Without Controlling for Pretest Scores.
Note. No F-test was statistically significant at p < .05.
ANOVAs showed no differences among the three groups on either Java unit test (for the first Java unit test: (F[2, 74] = 0.018, p = 0.982); for the second Java unit test: F[2, 80] = 1.373, p = 0.259). On average, then, spending time on Scratch or Pencil Code appears not to have harmed students’ learning of Java, despite those students spending less time learning Java than students in the Java section, but it also does not appear to have prepared them any better for learning Java.
Java Performance Controlled for Prior Java Knowledge
Prior to running the ANCOVA to determine whether prior Java knowledge mediated the effect of the BBLs on Java performance, we used a univariate ANOVA to confirm the required assumptions for ANCOVA. Tables 7 and 8 show the results. This ANOVA indicted that the required assumptions were met: There was no difference in Java pretest scores among the three groups at the p < 0.05 level (p = 0.887) and there was homogeneity of regression (p = 0.063). As shown in Table 7, the ANCOVA showed that, even when controlling for Java pretest scores, there were no differences among the three groups on either unit test (for the first Java unit test, F[2, 71] = 0.02, p = 0.981; for the second Java unit test, F[2, 75] = 1.04, p = 0.357). Thus, while prior Java knowledge was helpful to students on their Java unit tests, it appears that the level of prior Java knowledge did not mediate the impact of learning a BBL.
Scores on Java Unit Test 1 After Controlling for Java Pretest Score.
R2 = .16 (Adjusted R2 = .13).
**p < 0.01.
***p < 0.001.
Scores on Java Unit Test 2 After Controlling for Java Pretest Score.
R2 = .11 (Adjusted R2 = .08).
*p < 0.05.
***p < 0.001.
Discussion and Conclusions
In this study, we investigated the degree to which learning a BBL (Scratch or Pencil Code) in a CS0 course prepared college students for learning Java later in the course, compared to learning only Java throughout the course. Both student perceptions and actual Java performance were examined. Overall, the results show no advantage to learning a BBL, and weak evidence of possible disadvantage.
While students who learned a BBL found it easier to learn than Java, they found learning Java more difficult than did the students who had learned Java from the start of the course, and by the end of the course, the BBL students felt less confident in Java programming than the Java-only group (although these differences were only statistically significant for the Scratch group). Many students (especially in the Scratch group) perceived that learning the BBL had helped them learn Java, but their perceived competency in Java at the end of the course indicated otherwise. A hope for CS0 courses is that students will leave feeling motivated and confident about taking future CS courses and majoring in CS. These findings suggest that taking time away from Java learning at the start of a CS0 course in order to learn a BBL may work against this hope, rendering students less confident about programming in a language that is central to future CS courses.
Paralleling these perceptional findings, the students’ unit test scores showed no impact, positive or negative, of first learning a BBL on learning Java. Controlling for the students’ level of prior Java knowledge did not change this finding; learning a BBL was equally ineffective as preparation for learning Java regardless of the student’s prior Java knowledge.
The hybridity of Pencil Code did not offer the hypothesized advantage. Even though individual students in the Pencil Code section used both its block and editing views, their outcomes were no better than those of the students who only worked with blocks (Scratch) or text (Java).
These findings echo the results of a related study by Weintrop and Wilensky (2019), who compared two high school classes in which students learned to program in either a BBL or simple text-based (non-Java) environment for five weeks, before transitioning to Java for the remaining ten weeks of the course. Weintrop and Wilensky found no differences between the groups in Java performative, programming confidence, enjoyment, or intent to take further CS courses, leading them to conclude that, when the goal is to prepare students to learn an industry-standard text-based language, a BBL offers no advantage over a text-based language. Our study makes additional contributions by examining a different population—college students, by adding a hybrid BBL to the comparison, and by using a “control” situation that is more realistic for a college-level course: teaching the target language from Day 1.
Like Weintrop and Wilensky, we believe that BBLs and hybrid BBLs may have important advantages that our studies do not diminish. BBLs may enhance students’ enjoyment of and confidence in programming, especially for young students and true beginners. They may also help beginning programmers grasp key programming concepts. But for college students, our study suggests that BBLs and hybrid BBLs are unnecessary as preparation for learning Java; even students in the lowest-level CS course appear ready to learn Java from the start. We note that many students in our study were not beginners but brought some prior programming experience to the course. This, however, is probably typical of first-year college students today, reflecting increasing opportunities to learn programming in K-12 classes or afterschool activities (Google & Gallup, 2016). Our findings resonate somewhat with Chen et al.’s (2019) study and Hu et al.’s (2020) meta-analysis, both of which found decreased academic benefits from experience with BBLs for college students.
This study has several limitations. It examined a single instructor at one university, which restricts generalization to other settings. The small numbers of students in each group and subgroup limited statistical power. Many other instructional conditions are possible beyond the ones used here, in which a period of instruction solely in the BBL was followed by a period of instruction solely in Java. Different outcomes might result from a shift in the relative length of these periods, or from a different kind of sequence, where, for example, the BBL is revisited briefly for new topics. Because the instructor wanted to keep the instruction across sections as similar as possible, she did not take full advantage of the capacity of Scratch and Pencil Code to create videos and games, which might have compromised these BBLs’ power to develop programming confidence. The instruments that were used to measure the students’ perceptions and performances were not empirically validated; the performance measures in particular were the normal course assessments. Finally, we did not follow the students in our study into the subsequent semester to try to detect differences among the sections in terms of persistence into future CS courses or the CS major, although these are the outcomes of perhaps the greatest interest to educators.
Future research could investigate whether the use of a hybrid BBL, such as Alice, that uses Java as the default code, serves as a better transition to Java than does Pencil Code, whose default code is not Java. Another research direction stems from the observation that the students in this study, on average, entered the CS0 course with a fairly strong grasp of basic programming concepts but little Java knowledge. This suggests that CS0 students may not need the support of a BBL to understand programming concepts and may be ready to start with a text-based language. It would be fruitful to explore the benefits of starting with a less complex and intimidating text-based language (e.g., Python or Swift), rather than a BBL, before transitioning to an industry-standard one (e.g., Java).
Footnotes
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Supplemental Material
Supplemental material for this article is available online.
