skip to main content
US FlagAn official website of the United States government
dot gov icon
Official websites use .gov
A .gov website belongs to an official government organization in the United States.
https lock icon
Secure .gov websites use HTTPS
A lock ( lock ) or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.


Title: The Common Coder’s Scratch Programming Idioms and Their Impact on Project Remixing
As Scratch has become one of the most popular educational programming languages, understanding its common programming idioms can benefit both computing educators and learners. This understanding can fine-tune the curricular development to help learners master the fundamentals of writing idiomatic code in their programming pursuits. Unfortunately, the research community’s understanding of what constitutes idiomatic Scratch code has been limited. To help bridge this knowledge gap, we systematically identified idioms as based on canonical source code, presented in widely available educational materials. We implemented a tool that automatically detects these idioms to assess their prevalence within a large dataset of over 70K Scratch projects in different experience backgrounds and project categories. Since communal learning and the practice of remixing are one of the cornerstones of the Scratch programming community, we studied the relationship between common programming idioms and remixes. Having analyzed the original projects and their remixes, we observed that different idioms may associate with dissimilar types of code changes. Code changes in remixes are desirable, as they require a meaningful programming effort that spurs the learning process. The ability to substantially change a project in its remixes hinges on the project’s code being easy to understand and modify. Our findings suggest that the presence of certain common idioms can indeed positively impact the degree of code changes in remixes. Our findings can help form a foundation of what comprises common Scratch programming idioms, thus benefiting both introductory computing education and Scratch programming tools.  more » « less
Award ID(s):
1712131
PAR ID:
10295568
Author(s) / Creator(s):
; ;
Date Published:
Journal Name:
Proceedings of ACM SIGPLAN SPLASH Educational Symposium 2021 (SPLASH-E 2021)
Format(s):
Medium: X
Sponsoring Org:
National Science Foundation
More Like this
  1. null (Ed.)
    As a popular language for teaching introductory programming, Java can profoundly influence beginner programmers with its coding style and idioms. Despite its many advantages, the paradigmatic coding style in Java is often described as verbose. As a result, when writing code in more concise languages, such programmers tend to emulate the familiar Java coding idioms, thus neglecting to take advantage of the more succinct counterparts in those languages. As a result of such verbosity, not only the overall code quality suffers, but the verbose non-idiomatic patterns also render code hard to understand and maintain. In this paper, we study the incidences of Java-like verbosity as they occur in Python codebases. We present a collection of Java-Like Verbosity Anti-patterns and our pilot study of their presence in representative open-source Python codebases. We discuss our findings as a call for action to computing educators, particularly those who work with introductory students. We need novel pedagogical interventions that encourage budding programmers to write concise idiomatic code in any language. 
    more » « less
  2. null (Ed.)
    Given the importance of broadening participation in the field of computing, goals of supporting personal expression and developing a sense of belonging must live alongside the goals of conceptual knowledge and developing disciplinary expertise. Integrating opportunities for students to be creative in how they enact computing ideas plays an important role when designing curricula. We examine how student creativity, as expressed through theme and the use of costumes, backdrops, and narrative in Scratch projects, is affected by using a themed starter project. Starter projects are Scratch projects that include a set of sprites and backdrops aligned to a theme (e.g. baseball), but no code. Using within-group and between- group comparisons, we establish a baseline of what students do when they are given a starter project and explore how their projects differ in the absence of a starter project. This work contributes to our understanding of the impacts of structured elements within open-ended learning tasks and how we can design computer science learning experiences for students that promote opportunities for self-expression while engaging them in computing. 
    more » « less
  3. Block-based programming has been overwhelmingly successful in revitalizing introductory computing education and in facilitating end-user development. However, poor code quality makes block-based programs hard to understand, modify, and reuse, thus hurting the educational and productivity effectiveness of blocks. There is great potential benefit in empowering programmers in this domain to systematically improve the code quality of their projects. Refactoring--improving code quality while preserving its semantics--has been widely adopted in traditional software development. In this work, we introduce refactoring to Scratch. We define four new Scratch refactorings: Extract Custom Block, Extract Parent Sprite, Extract Constant, and Reduce Variable Scope. To automate the application of these refactorings, we enhance the Scratch programming environment with powerful program analysis and transformation routines. To evaluate the utility of these refactorings, we apply them to remove the code smells detected in a representative dataset of 448 Scratch projects. We also conduct a between-subjects user study with 24 participants to assess how our refactoring tools impact programmers. Our results show that refactoring improves the subjects' code quality metrics, while our refactoring tools help motivate programmers to improve code quality. 
    more » « less
  4. Open-ended tasks can be both beneficial and challenging to students learning to program. Such tasks allow students to be more creative and feel ownership over their work, but some students struggle with unstructured tasks and, without proper scaffolds, this can lead to negative learning experiences. Scratch is a widely used coding platform to teach computer science in classrooms and is designed to support learner creativity and expression. With its open-ended nature, Scratch can be used in various ways in the classroom to meet the needs of schools and districts. One challenge of using Scratch in classrooms is supporting learners in exploring their interests and fostering creativity while still meeting the instructional goals of a lesson and ensuring all students are engaged with, and understand, focal concepts and practices. In this paper, we investigate the use of planning sheets to fa- cilitate novice programmers designing and implementing Scratch programs based on open-ended prompts. To evaluate the plan- ning sheets, we look at how closely students’ implemented Scratch projects match their plans and whether the implemented Scratch projects met the technical requirements for the given lesson. We analyzed 303 Scratch projects from 155 middle grade students (ages 10-14) who were introduced to programming via the Scratch Encore Curriculum. Completed Scratch projects that used planning sheets (202) were qualitatively coded to evaluate how closely they matched the initial plan, and Scratch programs (303) were analyzed with an automated grader to check if technical project requirements were met. Our results reveal that students that used planning sheets met significantly more technical project requirements and had more complex structures than those that did not have planning sheets. Results differ based on teacher and type of planning sheet used (physical vs. virtual). This work suggests that planning sheets are a helpful tool for young learners when completing open-ended coding projects. 
    more » « less
  5. Visual block-based programming environments (VBBPEs) such as Scratch and Alice are increasingly being used in introductory computer science lessons across elementary school grades. These environments, and the curricula that accompany them, are designed to be developmentally-appropriate and engaging for younger learners but may introduce challenges for future computer science educators. Using the final projects of 4th, 5th, and 6th grade students who completed an introductory curriculum using a VBBPE, this paper focuses on patterns that show success within the context of VBBPEs but could pose potential challenges for teachers of follow-up computer science instruction. This paper focuses on three specific strategies observed in learners' projects: (1) wait blocks being used to manage program execution, (2) the use of event-based programming strategies to produce parallel outcomes, and (3) the coupling of taught concepts to curricular presentation. For each of these outcomes, we present data on how the course materials supported them, what learners achieved while enacting them, and the implications the strategy poses for future educators. We then discuss possible design and pedagogical responses. The contribution of this work is that it identifies early computer science learning strategies, contextualizes them within developmentally-appropriate environments, and discusses their implications with respect to future pedagogy. This paper advances our understanding of the role of VBBPEs in introductory computing and their place within the larger K-12 computer science trajectory. 
    more » « less