一句话:主张程序设计教学除输入数据结构外也应考虑输出数据结构,从而引导学生写出结构余递归程序。
程序结构跟随数据结构是入门编程的关键经验,Felleisen 等人的《How to Design Programs》也以此作为核心教学信息。但该教材主要利用输入数据的结构来指导设计,通常得到结构递归程序。本文提出,初学者还应学习考察输出数据的结构,并据此设计结构余递归(co-recursive)程序。作者通过教学论证与教材视角的比较,指出输出导向的设计配方能扩展程序设计的教学范围;摘要未报告具体实验或工具评估。
Abstract The observation that program structure follows data structure is a key lesson in introductory programming: good hints for possible program designs can be found by considering the structure of the data concerned. In particular, this lesson is a core message of the influential textbook “How to Design Programs” by Felleisen, Findler, Flatt, and Krishnamurthi. However, that book discusses using only the structure of input data for guiding program design, typically leading towards structurally recursive programs. We argue that novice programmers should also be taught to consider the structure of output data, leading them also towards structurally corecursive programs.