conference-paper

Why Do Developers Remove Lambda Expressions in Java?

  • 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)
Research footprint

At a glance

Citations
9
References
15
Comments
0
Paper overview

Abstract

Java 8 has introduced lambda expressions, a core feature of functional programming. Since its introduction, there is an increasing trend of lambda adoptions in Java projects. Developers often adopt lambda expressions to simplify code, avoid code duplication or simulate other functional features. However, we observe that lambda expressions can also incur different types of side effects (i.e., performance issues and memory leakages) or even severe bugs, and developers also frequently remove lambda expressions in their implementations. Consequently, the advantages of utilizing lambda expressions can be significantly compromised by the collateral side effects. In this study, we present the first large-scale, quantitative and qualitative empirical study to characterize and understand inappropriate usages of lambda expressions. Particularly, we summarized seven main reasons for the removal of lambdas as well as seven common migration patterns. For instance, we observe that lambdas using customized functional interfaces are more likely to be removed by developers. Moreover, from a complementary perspective, we performed a user study over 30 developers to seek the underlying reasons why they remove lambda expressions in practice. Finally, based on our empirical results, we made suggestions on scenarios to avoid lambda usages for Java developers and also pointed out future directions for researchers.

Record transparency

Publication details

DOI
10.1109/ase51524.2021.9678600
OpenAlex
W4206716941
Document type
conference-paper
Language
EN
Source
2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)
Last metadata update
Community

Comments

Log in to join the discussion.

  1. No comments yet. Start the discussion.