May 11–16, 2024 | Litao Yan, Alyssa Hwang, Zhiyuan Wu, Andrew Head
**IvIE: Lightweight Anchored Explanations of Just-Generated Code**
**Abstract:**
Programming assistants have transformed the coding experience, shifting focus from writing to critical examination of generated code. This paper introduces IvIE, an extension to programming assistants that provides instant, anchored explanations of generated code. IvIE annotates suggested code with brief, informative labels, appearing at the level of blocks and expressions. The design emphasizes low-cost invocation and dismissal, with explanations tailored to help programmers understand complex or unfamiliar code. An implementation in VS Code demonstrates the concept, and a usability study shows that IvIE improves code comprehension while being perceived as a useful, low-distraction complement to programming assistants.
**Key Concepts:**
- Human-centered computing → Interactive systems and tools.
**Keywords:**
Programming assistants, instructive copilots, anchored explanations, comprehension support, variable levels of detail, brevity, easy invocation, easy dismissal, label overlays.
**System:**
IvIE is designed to provide anchored, lightweight, and easily invocable explanations. It integrates with modern editors, leveraging LLMs for code segmentation and explanation. Explanations are rendered as overlays, appearing immediately and automatically dismissing when no longer needed. Block-level and expression-level explanations are provided, enhancing understanding of both long and short code suggestions.
**Study Design:**
A usability study compared IvIE to a baseline chatbot-based help system. Participants were asked to perform tasks using both tools, with assessments focusing on code comprehension, attention, and task load. Results showed that IvIE significantly improved comprehension and reduced task load, while not significantly affecting attention.
**Results:**
- **Comprehension:** IvIE improved accuracy and speed in answering comprehension questions (p < 0.001) and reduced response time (p = 0.011).
- **Attention:** IvIE did not significantly reduce time spent on generated code (p = 0.14), but some participants reported increased attention to code.
- **Task Load:** IvIE was perceived as imposing less mental demand, hurry, performance, effort, and frustration (p < 0.001).
**Conclusion:**
IvIE effectively enhances code comprehension and is a valuable, low-distraction complement to programming assistants, particularly for understanding unfamiliar APIs and idioms.**IvIE: Lightweight Anchored Explanations of Just-Generated Code**
**Abstract:**
Programming assistants have transformed the coding experience, shifting focus from writing to critical examination of generated code. This paper introduces IvIE, an extension to programming assistants that provides instant, anchored explanations of generated code. IvIE annotates suggested code with brief, informative labels, appearing at the level of blocks and expressions. The design emphasizes low-cost invocation and dismissal, with explanations tailored to help programmers understand complex or unfamiliar code. An implementation in VS Code demonstrates the concept, and a usability study shows that IvIE improves code comprehension while being perceived as a useful, low-distraction complement to programming assistants.
**Key Concepts:**
- Human-centered computing → Interactive systems and tools.
**Keywords:**
Programming assistants, instructive copilots, anchored explanations, comprehension support, variable levels of detail, brevity, easy invocation, easy dismissal, label overlays.
**System:**
IvIE is designed to provide anchored, lightweight, and easily invocable explanations. It integrates with modern editors, leveraging LLMs for code segmentation and explanation. Explanations are rendered as overlays, appearing immediately and automatically dismissing when no longer needed. Block-level and expression-level explanations are provided, enhancing understanding of both long and short code suggestions.
**Study Design:**
A usability study compared IvIE to a baseline chatbot-based help system. Participants were asked to perform tasks using both tools, with assessments focusing on code comprehension, attention, and task load. Results showed that IvIE significantly improved comprehension and reduced task load, while not significantly affecting attention.
**Results:**
- **Comprehension:** IvIE improved accuracy and speed in answering comprehension questions (p < 0.001) and reduced response time (p = 0.011).
- **Attention:** IvIE did not significantly reduce time spent on generated code (p = 0.14), but some participants reported increased attention to code.
- **Task Load:** IvIE was perceived as imposing less mental demand, hurry, performance, effort, and frustration (p < 0.001).
**Conclusion:**
IvIE effectively enhances code comprehension and is a valuable, low-distraction complement to programming assistants, particularly for understanding unfamiliar APIs and idioms.