一句话:通过随机对照试验考察多语言编程中嵌入式语言切换对开发者的影响,发现其生产力效应随经验水平而异。
多语言编程在现代软件开发中很常见,但嵌入式语言切换对开发者生产力的影响尚不明确。本文在数据库编程情境下开展随机对照试验,让参与者使用 Java 与三种 SQL 类嵌入式语言之一完成编码任务:字符串中的普通 SQL、纯 Java,以及更接近宿主语言的混合嵌入式语言。研究共收集 109 个有效数据点。结果表明,不同经验水平的开发者使用多语言技术时存在显著差异:经验较少的程序员在混合条件下更快写出正确程序(切换频繁但幅度较小),而已掌握两种语言的资深开发者在传统 SQL 下表现更好(切换较少但更完整)。这说明多语言编程的生产力影响复杂,且依赖开发者的经验水平。
Polyglot programming, the use of multiple programming languages during the development process, is common practice in modern software development. This study investigates this practice through a randomized controlled trial conducted under the context of database programming. Participants in the study were given coding tasks written in Java and one of three SQL-like embedded languages. One was plain SQL in strings, one was in Java only, and the third was a hybrid embedded language that was closer to the host language. We recorded 109 valid data points. Results showed significant differences in how developers of different experience levels code using polyglot techniques. Notably, less experienced programmers wrote correct programs faster in the hybrid condition (frequent, but less severe, switches), while more experienced developers that already knew both languages performed better in traditional SQL (less frequent but more complete switches). The results indicate that the productivity impact of polyglot programming is complex and experience level dependent.
@inproceedings{paperbot5825,
title = {A randomized controlled trial on the effects of embedded computer language switching},
author = {P. Merlin Uesbeck and Cole S. Peterson and Bonita Sharif and Andreas Stefik},
booktitle = {FSE},
year = {2020},
doi = {10.1145/3368089.3409701}
}