Global variables lie at the root of many programmer complaints about computational notebooks.While programmers in other environments often address these barriers with function scopes, notebook programmers use functions less often. Analyzing the interaction between user behaviors, the programming language, and the notebook environment, we propose one possible explanation: that functions interfere with using notebooks in the exploratory ways users value. For example, because partial functions are not parseable, they cannot be run in isolation, so programmers cannot split function bodies across cells to iteratively tweak and rerun the last few lines. To explore how to offer non-global scopes without hampering exploratory notebook interactions, we built Pagebreaks, a small language construct for adding scopes around multiple Jupyter Notebook cells. In an in-situ study, we explored how programmers used Pagebreaks to manage variables with non-global scopes but also to visually and conceptually organize programs in a way akin to functions.
https://dl.acm.org/doi/10.1145/3706598.3713620
The ACM CHI Conference on Human Factors in Computing Systems (https://chi2025.acm.org/)