arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

Drafter:用于CS1全栈Web开发的Python库

Drafter: A Python Library for Full-Stack Web Development in CS1

Austin Cory Bart, Nazim Karaca

arXiv 2609.28481首次发表:更新:

发表机构

University of Delaware(特拉华大学)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

本文介绍Drafter,一个面向CS1课程的开源Python库,通过纯函数和极简代码实现全栈Web开发,支持单元测试与调试,旨在提升学生参与度并强化学习目标。

AI 中文摘要

Web应用日益成为创建用户界面的主要方式,并且通常是初学者最常遇到的软件类型。然而,Web开发依赖于HTML、CSS、JavaScript和后端技术等概念,这些挑战超出了入门课程的范围。此外,现代Web框架的许多特性与CS1原则相冲突,例如避免全局可变状态和提倡测试驱动开发。因此,尽管Web开发具有激励潜力,却很少被整合到CS1课程中。本文介绍了Drafter,一个面向CS1的新型开源Python库,使学生能够使用纯函数和极简样板代码开发全栈Web应用。Drafter提供简单的函数来生成HTML,无需学习HTML或模板语言。其数据模型随学生对类型掌握的深入而扩展,从原始类型到嵌套列表、Dataclass和字典。Drafter支持对整个Web应用进行单元测试,并强化了分解和可重用性等CS1概念。使用Drafter创建的网站可通过GitHub Pages部署,并支持绘图和图像处理。学生可获得丰富的调试信息,包括单元测试脚手架、程序状态可视化以及增强的错误消息和测试。本文讨论了Drafter背后的教学特性和设计决策,以及教师对其使用的反思。我们相信Drafter能显著提升CS1课程中学生的参与度,并强化关键学习目标。

英文摘要

Web applications are increasingly the main way to create user interfaces, and they are often the most common software beginners have encountered. However, web development relies on concepts like HTML, CSS, JavaScript, and backend technologies, which are challenges beyond the scope of an introductory course. Additionally, many features of modern web frameworks conflict with CS1 principles, such as avoiding global mutable state and promoting test-driven development. Consequently, web development is rarely integrated into CS1 courses, despite its motivational potential. This paper introduces Drafter, a new open-source Python library for CS1, enabling students to develop full-stack web applications using pure functions with minimal boilerplate. Drafter has simple functions to generate HTML, eliminating the need to learn HTML or templating languages. The data model scales with students' mastery of types, from primitives to nested lists, Dataclasses, and dictionaries. Drafter supports unit testing of entire web applications and reinforces CS1 concepts like decomposition and reusability. Websites created with Drafter can be deployed through GitHub Pages, with plotting and image manipulation. Students receive extensive debug information, including unit test scaffolding, program state visualization, and enhanced error messages and tests. This paper discusses the pedagogical features and design decisions behind Drafter, along with instructor reflections on its use. We believe Drafter can significantly enhance student engagement in CS1 courses and reinforce key learning objectives.

DOI:10.1145/3641554.3701874

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑