The subjective cost of writing reusable code: The case of functions

Itamar Lachman, Irit Hadar, Uri Hertz

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review


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.

Original languageEnglish
Title of host publicationAdvanced Information Systems Engineering Workshops - CAiSE 2019 International Workshops, Proceedings
EditorsHenderik A. Proper, Janis Stirna
PublisherSpringer Verlag
Number of pages11
ISBN (Print)9783030209476
StatePublished - 2019
Event31st International Conference on Advanced Information Systems Engineering, CAiSE 2019 - Rome, Italy
Duration: 3 Jun 20197 Jun 2019

Publication series

NameLecture Notes in Business Information Processing
ISSN (Print)1865-1348
ISSN (Electronic)1865-1356


Conference31st International Conference on Advanced Information Systems Engineering, CAiSE 2019

Bibliographical note

Publisher Copyright:
© Springer Nature Switzerland AG 2019.


  • Abstraction
  • Code-reuse
  • Cognition
  • Dual-process theory
  • Functions
  • Programming
  • Subjective cost

ASJC Scopus subject areas

  • Management Information Systems
  • Control and Systems Engineering
  • Business and International Management
  • Information Systems
  • Modeling and Simulation
  • Information Systems and Management


Dive into the research topics of 'The subjective cost of writing reusable code: The case of functions'. Together they form a unique fingerprint.

Cite this