There are possible benefits and drawbacks to chaining methods together, as is often done in fluent APIs. A prior study investigated how Java developers chain methods in over 2.7k open-source projects. That study observed, for the dataset analyzed, that the use of method chaining in Java is popular and seems to be increasing over time. That study however was limited to a smaller sample of Java projects, and it is also not clear if the results generalize to other languages. In this work, we first replicate the prior results by building a similar dataset and our own analysis scripts. We then extend those results by analyzing a much larger dataset of 89k Java projects and generalizing to other programming languages by analyzing 26k Kotlin projects and 98k Python projects. The results show chaining is more popular in Java and Kotlin than Python, chaining use in Kotlin is not growing, and Python sees more use in non-testing code.


翻译:---- 方法链将方法链接在一起可能存在优点和缺点,这通常在流畅的API中使用。先前的研究调查了Java开发人员在超过2.7k个开源项目中如何链接方法。对于所分析的数据集,该研究观察到,在Java中使用方法链接很流行,并且似乎随时间推移而增加。但是,该研究仅限于较小的Java项目样本,并且不清楚结果是否可以推广到其他语言。在这项工作中,我们首先通过构建类似的数据集和我们自己的分析脚本来复制先前的结果。然后,我们通过分析89k个Java项目的更大数据集并通过分析26k个Kotlin项目和98k个Python项目来推广到其他编程语言。结果显示,在Java和Kotlin中更受欢迎,并且不断增长,而Kotlin中的链接使用并未增长,Python在非测试代码中的使用更多。

0
下载
关闭预览

相关内容

Kotlin 是一种运行于 Java 虚拟机上的静态类型编程语言。
《Julia数据科学》及代码,166页pdf
专知会员服务
44+阅读 · 2021年11月4日
【2020新书】Ruby 3 编程: 从小白到专家,598页pdf
专知会员服务
29+阅读 · 2020年12月17日
专知会员服务
123+阅读 · 2020年9月8日
Python分布式计算,171页pdf,Distributed Computing with Python
专知会员服务
105+阅读 · 2020年5月3日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
说好的 Swift 取代 Python 呢?
CSDN
0+阅读 · 2022年9月8日
JavaScript、Python 比 C++ 慢 8 倍、29 倍?
CSDN
3+阅读 · 2022年7月29日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
基于LSTM-CNN组合模型的Twitter情感分析(附代码)
机器学习研究会
50+阅读 · 2018年2月21日
【推荐】MXNet深度情感分析实战
机器学习研究会
16+阅读 · 2017年10月4日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2010年12月31日
Arxiv
0+阅读 · 2023年5月9日
Arxiv
38+阅读 · 2021年8月31日
VIP会员
相关资讯
说好的 Swift 取代 Python 呢?
CSDN
0+阅读 · 2022年9月8日
JavaScript、Python 比 C++ 慢 8 倍、29 倍?
CSDN
3+阅读 · 2022年7月29日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
基于LSTM-CNN组合模型的Twitter情感分析(附代码)
机器学习研究会
50+阅读 · 2018年2月21日
【推荐】MXNet深度情感分析实战
机器学习研究会
16+阅读 · 2017年10月4日
相关基金
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2010年12月31日
Top
微信扫码咨询专知VIP会员