Authors:
Lukas Poos
1
;
Stefan Hanenberg
2
;
Stefan Gries
3
and
Volker Gruhn
2
Affiliations:
1
Independent Researcher, Germany
;
2
University of Duisburg–Essen, Essen, Germany
;
3
codecentric AG, 42697 Solingen, Germany
Keyword(s):
Programming Languages, Empirical Study, User Study.
Abstract:
The programming language Rust introduces language constructs such as ownership rules and mutability whose effect is, that undesired side-effects can be detected by the compiler. However, it is relatively unknown what the effect of such constructs on developers is. The present work introduces an experiment, where Rust and Java code was given to ten participants. The code, that consisted of ten function calls, contained one function that performed an undesired side-effect which led to an error in the main function. The participants’ task was to identify the function that caused this effect. The experiment varied (in the Rust code) the number of calls where a parameter was passed as mutable (which is inherently the case in languages such as Java). Such variation had a strong (p < .001) and large (η 2p = .459) effect on participants. On average, it took the participants 29% more time to identify the function in Java. However, this number varied between -4.3% and 117%, depending on how ma
ny parameters where passed as mutable. Altogether, the experiment gives evidence that an explicit passing of variables as mutable has a positive effect on developers under the experimental conditions.
(More)