Programming assistants have reshaped the experience of programming into one where programmers spend less time writing and more time critically examining code. In this paper, we explore how programming assistants can be extended to accelerate the inspection of generated code. We introduce an extension to the programming assistant called Ivie, or instantly visible in-situ explanations. When using Ivie, a programmer's generated code is instantly accompanied by explanations positioned just adjacent to the code. Our design was optimized for extremely low-cost invocation and dismissal. Explanations are compact and informative. They describe meaningful expressions, from individual variables to entire blocks of code. We present an implementation of Ivie that forks VS Code, applying a modern LLM for timely segmentation and explanation of generated code. In a lab study, we compared Ivie to a contemporary baseline tool for code understanding. Ivie improved understanding of generated code, and was received by programmers as a highly useful, low distraction, desirable complement to the programming assistant.
翻译:摘要:编程助手已将编程体验重塑为程序员花更少时间编写、花更多时间批判性审查代码的模式。本文探索如何扩展编程助手以加速对生成代码的审查。我们提出了一种名为Ivie(即时可见原位解释)的编程助手扩展。使用Ivie时,程序员生成的代码会立即附带紧邻代码的定位解释。我们的设计针对极低成本的调用与关闭进行了优化,解释内容紧凑且信息丰富,涵盖从单个变量到整个代码块的有意义表达式。我们实现了Ivie的原型,该原型对VS Code进行分支改造,运用现代大语言模型对生成的代码进行及时分段与解释。在实验室研究中,我们将Ivie与当代代码理解基线工具进行了对比。结果显示,Ivie提升了对生成代码的理解,并被程序员视为一种高度实用、低干扰、与编程助手互补的理想工具。