How do programmers use optional typing?: an empirical study

Carlos Souza, Eduardo Figueiredo
{"title":"How do programmers use optional typing?: an empirical study","authors":"Carlos Souza, Eduardo Figueiredo","doi":"10.1145/2577080.2582208","DOIUrl":null,"url":null,"abstract":"The recent popularization of dynamically typed languages, such as Ruby and JavaScript, has brought more attention to the discussion about the impact of typing strategies on development. Types allow the compiler to find type errors earlier and potentially improve the readability and maintainability of code. On the other hand, \"untyped\" code may be easier to change and require less work from programmers. This paper tries to identify the programmers' point of view about these tradeoffs. An analysis of the source code of 6638 projects written in Groovy, a programming language which features optional typing, shows in which scenarios programmers prefer to type or not to type their declarations. Our results show that types are popular in the definition of module interfaces, but are less used in scripts, test classes and frequently changed code. There is no correlation between the size and age of projects and how their constructs are typed. Finally, we also found evidence that the background of programmers influences how they use types.","PeriodicalId":357928,"journal":{"name":"Proceedings of the 13th international conference on Modularity","volume":"3 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2014-04-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"12","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 13th international conference on Modularity","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2577080.2582208","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 12

Abstract

The recent popularization of dynamically typed languages, such as Ruby and JavaScript, has brought more attention to the discussion about the impact of typing strategies on development. Types allow the compiler to find type errors earlier and potentially improve the readability and maintainability of code. On the other hand, "untyped" code may be easier to change and require less work from programmers. This paper tries to identify the programmers' point of view about these tradeoffs. An analysis of the source code of 6638 projects written in Groovy, a programming language which features optional typing, shows in which scenarios programmers prefer to type or not to type their declarations. Our results show that types are popular in the definition of module interfaces, but are less used in scripts, test classes and frequently changed code. There is no correlation between the size and age of projects and how their constructs are typed. Finally, we also found evidence that the background of programmers influences how they use types.
程序员如何使用可选类型?实证研究
最近流行的动态类型语言,如Ruby和JavaScript,引起了更多关于类型策略对开发影响的讨论。类型允许编译器更早地发现类型错误,并可能提高代码的可读性和可维护性。另一方面,“未类型化”的代码可能更容易更改,并且需要程序员做的工作更少。本文试图确定程序员对这些权衡的观点。对用Groovy编写的6638个项目的源代码进行了分析,Groovy是一种具有可选类型特性的编程语言,它显示了程序员喜欢在哪些场景中键入或不键入他们的声明。我们的结果表明,类型在模块接口的定义中很流行,但在脚本、测试类和经常更改的代码中使用较少。项目的大小和年龄与它们的构造类型之间没有关联。最后,我们还发现了程序员的背景影响他们使用类型的证据。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信