Authoring multi-stage code examples with editable code histories

  • Authors:
  • Shiry Ginosar;Luis Fernando De Pombo;Maneesh Agrawala;Bjorn Hartmann

  • Affiliations:
  • University of California, Berkeley, Berkeley, California, USA;University of California, Berkeley, Berkeley, California, USA;University of California, Berkeley, Berkeley, California, USA;University of California, Berkeley, Berkeley, California, USA

  • Venue:
  • Proceedings of the 26th annual ACM symposium on User interface software and technology
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Multi-stage code examples present multiple versions of a program where each stage increases the overall complexity of the code. In order to acquire strategies of program construction using a new language or API, programmers consult multi-stage code examples in books, tutorials and online videos. Authoring multi-stage code examples is currently a tedious process, as it involves keeping several stages of code synchronized in the face of edits and error corrections. We document these difficulties with a formative study examining how programmers author multi-stage code examples. We then present an IDE extension that helps authors create multi-stage code examples by propagating changes (insertions, deletions and modifications) to multiple saved versions of their code. Our system adapts revision control algorithms to the specific task of evolving example code. An informal evaluation finds that taking snapshots of a program as it is being developed and editing these snapshots in hindsight help users in creating multi-stage code examples.