Abstract
Functions provide substantial benefits for software development, simplifying programming through decomposition, reusability and abstraction. In a previous study, our group identified a tendency of high-school students to not use functions, even in programming tasks where functions can be a good solution strategy. The current research extends this observation to university students and aims to provide an explanation for the factors underlying this tendency. We focus on the subjective cost of the cognitive effort required for writing functions. Our experiment examined how information systems students solved a set of programming tasks, which varied by the number of repetitive questions. The results showed that most of the students avoided using functions altogether. We further found that in the subgroup of students who used functions at least once, the likelihood of using functions was positively associated with (a) the number of repetitive questions in each task, and (b) the task order, i.e., the progress of the experiment. These results indicate that the subjective cost of writing functions is taken into account when making a decision on how to solve a task at hand and is compared with the cost of repetitive work without using function, and that the former cost is updated with experience.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Brown, M.: Comfort Zone: model or metaphor? Aust. J. Outdoor Educ. 12, 3–12 (2008)
Chen, W.J., Krajbich, I.: Computational modeling of epiphany learning. Proc. Natl. Acad. Sci. 114, 4637–4642 (2017). https://doi.org/10.1073/pnas.1618161114
Green, L., Myerson, J.: A discounting framework for choice with delayed and probabilistic rewards. Psychol. Bull. 130, 769–792 (2004). https://doi.org/10.1037/0033-2909.130.5.769
Hadar, I.: When intuition and logic clash: the case of the object-oriented paradigm. Sci. Comput. Program. 78, 1407–1426 (2013). https://doi.org/10.1016/j.scico.2012.10.006
Hashim, K., Key, E.: A software maintainability attributes model. Malays. J. Comput. Sci. 9, 92–97 (1996)
Kable, J.W., Glimcher, P.W.: The neural correlates of subjective value during intertemporal choice. Nat. Neurosci. 10, 1625–1633 (2007). https://doi.org/10.1038/nn2007
Kahneman, D.: Maps of bounded rationality: a perspective on intuitive judgment and choice. Sveriges Riksbank Prize Econ. Sci. Mem. Alfred Nobel, 449–489 (2002). https://doi.org/10.1037/0003-066x.58.9.697
Kool, W., McGuire, J.T., Rosen, Z.B., Botvinick, M.M.: Decision making and the avoidance of cognitive demand. J. Exp. Psychol. Gen. 139, 665–682 (2010). https://doi.org/10.1037/a0020198
Kramer, J.: Is abstraction the key to computing? Commun. ACM 50, 36–42 (2007). https://doi.org/10.1145/1232743.1232745
Maddala, G.S.: Limited-Dependent and Qualitative Variables in Econometrics. Cambridge University Press, Cambridge (1986)
Manlove, K.: Introduction to Statistical Analysis using R commander, pp. 1–23 (2014)
Omar, A., Hadar, I., Leron, U.: Investigating the under-usage of code decomposition and reuse among high school students: the case of functions. In: Metzger, A., Persson, A. (eds.) CAiSE 2017. LNBIP, vol. 286, pp. 92–98. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-60048-2_9
Patzelt, E.H., Kool, W., Millner, A.J., Gershman, S.J., Note, A., Patzelt, E.H.: Building N In press at Scientific Reports 4729
Simon, H.A.: Administrative behaviour. Aust. J. Public Adm. (1947). https://doi.org/10.1111/j.1467-8500.1950.tb01679.x
Stanovich, K.E.: What Intelligence Tests Miss: The Psychology of Rational Thought. Yale University Press, New Haven (2009)
Westbrook, A., Braver, T.S.: Cognitive effort: a neuroeconomic approach. Cogn. Affect Behav. Neurosci. 15, 395–415 (2015). https://doi.org/10.3758/s13415-015-0334-y
Westbrook, A., Kester, D., Braver, T.S.: What is the subjective cost of cognitive effort? Load, trait, and aging effects revealed by economic preference. PLoS One 8, 1–8 (2013). https://doi.org/10.1371/journal.pone.0068210
Zipf, G.K.: Human Behaviour and the Principle of Least Effort: An Introduction to Human Ecology, 588 pages. Addison-Wesley Press, Cambridge (1949)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Lachman, I., Hadar, I., Hertz, U. (2019). The Subjective Cost of Writing Reusable Code: The Case of Functions. In: Proper, H., Stirna, J. (eds) Advanced Information Systems Engineering Workshops. CAiSE 2019. Lecture Notes in Business Information Processing, vol 349. Springer, Cham. https://doi.org/10.1007/978-3-030-20948-3_3
Download citation
DOI: https://doi.org/10.1007/978-3-030-20948-3_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-20947-6
Online ISBN: 978-3-030-20948-3
eBook Packages: Computer ScienceComputer Science (R0)