A Study on the Pythonic Functional Constructs' Understandability
Cyrine Zid, Fiorella Zampetti, Giuliano Antoniol, Massimiliano Di Penta
摘要
The use of functional constructs in programming languages such as Python has been advocated to help write more concise source code, improve parallelization, and reduce side effects. Nevertheless, their usage could lead to understandability issues. This paper reports the results of a controlled experiment conducted with 209 developers to assess the understandability of given Pythonic functional constructs---namely lambdas, comprehensions, and map/reduce/-filter functions---if compared to their procedural alternatives. To address the study's goal, we asked developers to modify code using functional constructs or not, to compare the understandability of different implementations, and to provide insights about when and where it is preferable to use such functional constructs. Results of the study indicate that code snippets with lambdas are more straightforward to modify than the procedural alternatives. However, this is not the case for comprehension. Regarding the perceived understandability, code snippets relying on procedural implementations are considered more readable than their functional alternatives. Last but not least, while functional constructs may help write compact code, improving maintainability and performance, they are considered hard to debug. Our results can lead to better education in using functional constructs, prioritizing quality assurance activities, and enhancing tool support for developers.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper4
- Making Python code idiomatic by automatic refactoring non-idiomatic Python code with pythonic idiomsZejun Zhang, Zhenchang Xing, Xin Xia, Xiwei Xu 等FSE 2022 · 被引用 35 次
- Faster or Slower? Performance Mystery of Python Idioms Unveiled with Empirical EvidenceZejun Zhang, Zhenchang Xing, Xin Xia, Xiwei Xu 等ICSE 2023 · 被引用 16 次
- Why Do Developers Remove Lambda Expressions in Java?Mingwei Zheng, Jun Yang, Ming Wen, Hengcheng Zhu 等ASE 2021 · 被引用 9 次
- An exploratory study on the predominant programming paradigms in Python codeRobert Dyer, Jigyasa ChauhanFSE 2022 · 被引用 6 次
相关 Paper
- Hard to Read and Understand Pythonic Idioms? DeIdiom and Explain Them in Non-Idiomatic Equivalent CodeZejun Zhang, Zhenchang Xing, Dehai Zhao, Qinghua Lu 等ICSE 2024 · 被引用 7 次
- Imperative versus Declarative Collection Processing: An RCT on the Understandability of Traditional Loops versus the Stream API in JavaNils Mehlhorn, Stefan HanenbergICSE 2022 · 被引用 4 次
- Does the Stream API Benefit from Special Debugging Facilities? A Controlled Experiment on Loops and Streams with Specific DebuggersJan Reichl, Stefan Hanenberg, Volker GruhnICSE 2023 · 被引用 1 次
- On the Relationship between Code Verifiability and UnderstandabilityKobi Feldman, Martin Kellogg, Oscar ChaparroFSE 2023 · 被引用 2 次
- Convergent Representations of Computer Programs in Human and Artificial Neural NetworksShashank Srikant, Ben Lipkin, Anna A. Ivanova, Evelina Fedorenko 等NeurIPS 2022 · 被引用 16 次
