How Do Developers Use Type Inference: An Exploratory Study in Kotlin
Samuel W. Flint, Ali M. Keshk, Robert Dyer, Hamid Bagheri

TL;DR
This study investigates how Kotlin developers utilize type inference in real-world projects, revealing frequent use for local variables and insights for language design improvements.
Contribution
It provides the first large-scale empirical analysis of type inference usage patterns in Kotlin, informing language design and tooling.
Findings
Type inference is often used for local variables.
Variables initialized with external method calls are more likely to use inference.
Results inform optimization of type inference algorithms.
Abstract
Statically typed languages offer numerous benefits to developers, such as improved code quality and reduced runtime errors, but they also require the overhead of manual type annotations. To mitigate this burden, language designers have started incorporating support for type inference, where the compiler infers the type of a variable based on its declaration/usage context. As a result, type annotations are optional in certain contexts, and developers are empowered to use type inference in these situations. However, the usage patterns of type annotations in languages that support type inference are unclear. These patterns can help provide evidence for further research in program comprehension, in language design, and for education. We conduct a large-scale empirical study using Boa, a tool for mining software repositories, to investigate when and where developers use type inference in…
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
TopicsTechnology Adoption and User Behaviour
