How do Scratch Programmers Name Variables and Procedures?

Alaaeddin Swidan, Alexander Serebrenik, Felienne Hermans

Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

20 Citations (Scopus)
144 Downloads (Pure)

Abstract

Research shows the importance of selecting good names to identifiers in software code: more meaningful names improve readability. In particular, several guidelines encourage long and descriptive variable names. A recent study analyzed the use of variable names in five programming languages, focusing on single-letter variable names, because of the apparent contradiction between their frequent use and the fact that these variables violate the aforementioned guidelines.,In this paper, we analyze variables in Scratch, a popular block-based language aimed at children. We start by replicating the above single-letter study for Scratch. We augment this study by analyzing single-letter procedure names, and by investigating the use of Scratch specific naming patterns: spaces in variable names, numerics as variables and textual labels in procedure names.,The results of our analysis show that Scratch programmers often prefer longer identifier names than developers in other languages, while Scratch procedure names have even longer names than Scratch variables. For the single-letter variables, the most frequent names are x, y, and i. Single-letter procedures are less popular, but show more tendency to be in upper case. When compared to the other programming languages, the usage of single uppercase letters in Scratch variables seems to be similar to the pattern found in Perl, while for the lowercase letters - to the pattern found in Java. Concerning Scratch specific features, 44% of the unique variable names and 34% of the projects in the dataset include at least one space. The usage of textual labels between parameters in procedure names appears as not common, however textual patterns used imply an influence from textual languages, for example by using brackets.,Previous research indicate the identifier names as one significant issue in transitioning from visual block-based to textual programming languages. The naming patterns we found support this claim for Scratch programmers who may incur difficulties when transitioning to the use of mainstream textual programming languages. Those languages restrict the use of spaces in identifiers and more often divert into short and single-letter names - tendencies opposite to the naming preferences in Scratch.

Original languageEnglish
Title of host publicationProceedings - 2017 IEEE 17th International Working Conference on Source Code Analysis and Manipulation, SCAM 2017
PublisherInstitute of Electrical and Electronics Engineers (IEEE)
Pages51-60
Number of pages10
Volume2017-October
ISBN (Electronic)9781538632383
DOIs
Publication statusPublished - 30 Oct 2017
Event17th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2017 - Shanghai, China
Duration: 17 Sept 201718 Sept 2017

Conference

Conference17th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2017
Country/TerritoryChina
CityShanghai
Period17/09/1718/09/17

Keywords

  • scratch
  • variable name

Fingerprint

Dive into the research topics of 'How do Scratch Programmers Name Variables and Procedures?'. Together they form a unique fingerprint.

Cite this