How do Scratch Programmers Name Variables and Procedures?

Alaaeddin Swidan, Alexander Serebrenik, F. Hermans
{"title":"How do Scratch Programmers Name Variables and Procedures?","authors":"Alaaeddin Swidan, Alexander Serebrenik, F. Hermans","doi":"10.1109/SCAM.2017.12","DOIUrl":null,"url":null,"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.","PeriodicalId":306744,"journal":{"name":"2017 IEEE 17th International Working Conference on Source Code Analysis and Manipulation (SCAM)","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2017-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"25","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 IEEE 17th International Working Conference on Source Code Analysis and Manipulation (SCAM)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SCAM.2017.12","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 25

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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Scratch程序员如何命名变量和过程?
研究表明,在软件代码中选择好名字对标识符很重要:更有意义的名字可以提高可读性。特别是,一些准则鼓励使用长且描述性的变量名。最近的一项研究分析了五种编程语言中变量名的使用,重点关注单字母变量名,因为它们的频繁使用与这些变量违反上述指导原则之间存在明显的矛盾。在本文中,我们分析了Scratch中的变量,这是一种针对儿童的流行的基于块的语言。我们首先为Scratch复制上述单字母研究。我们通过分析单字母过程名和研究Scratch特定命名模式的使用来扩展这项研究:变量名中的空格、变量名中的数字和过程名中的文本标签。我们的分析结果表明,与其他语言的开发人员相比,Scratch程序员通常更喜欢较长的标识符名称,而Scratch过程名称甚至比Scratch变量名称更长。对于单字母变量,最常见的名称是x、y和i。单字母过程不太流行,但更倾向于使用大写。与其他编程语言相比,Scratch变量中单个大写字母的使用似乎与Perl中的模式相似,而小写字母的使用则与Java中的模式相似。关于Scratch的特定功能,数据集中44%的唯一变量名和34%的项目至少包含一个空格。在过程名的参数之间使用文本标签似乎并不常见,但是使用的文本模式暗示了文本语言的影响,例如通过使用括号。以往的研究表明,标识符名称是从基于视觉块的编程语言向文本编程语言过渡的一个重要问题。我们发现的命名模式支持Scratch程序员在过渡到使用主流文本编程语言时可能遇到的困难。这些语言限制了标识符中空格的使用,并且更经常地使用简短的单字母名称——这与Scratch中的命名首选项相反。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
How do Scratch Programmers Name Variables and Procedures? Extracting Timed Automata from Java Methods An Exploratory Study of Functional Redundancy in Code Repositories Investigating the Use of Code Analysis and NLP to Promote a Consistent Usage of Identifiers Supporting Analysis of SQL Queries in PHP AiR
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1