Method Chaining Redux: An Empirical Study of Method Chaining in Java, Kotlin, and Python
Ali M. Keshk, Robert Dyer

TL;DR
This study empirically compares method chaining in Java, Kotlin, and Python, revealing language-specific usage patterns and trends across a large dataset of open-source projects.
Contribution
It extends prior Java-focused research by analyzing a larger dataset and includes Kotlin and Python to generalize findings about method chaining practices.
Findings
Method chaining is most popular in Java and Kotlin.
Chaining use in Kotlin is stable over time.
Python uses chaining more in non-testing code.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Engineering Techniques and Practices · Software System Performance and Reliability
