Scrap Your Boilerplate

Scrap Your Boilerplate
复制标题

废弃你的样板文件

DOI:
--
复制
发表时间:
2003
期刊:
Asian Symposium on Programming Languages and Systems
影响因子:
--
通讯作者:
R. Lämmel
R. Lämmel
中科院分区:
--
文献类型:
--
作者:
S. Jones;R. Lämmel

文献摘要

被引文献

相似文献

许多程序遍历由丰富的相互递归数据类型构建的数据结构。这样的程序通常有大量的简单遍历结构的“样板”代码,隐藏了少量构成遍历原因的“真实”代码。泛型编程”是一个总称,用来描述针对这个问题的各种编程技术。所有这些技术的目的都是为“样板”部分提供机械支持,让程序员可以自由地专注于算法的重要部分。这样的泛型程序对于数据结构的演变更加健壮,因为它们包含的特定类型代码行要少得多。
Many programs traverse data structures built from rich mutually-recursive data types. Such programs often have a great deal of “boilerplate” code that simply walks the structure, hiding a small amount of “real” code that constitutes the reason for the traversal. ”Generic programming” is the umbrella term to describe a wide variety of programming technology directed at this problem. All these techniques aim to provide mechanical support for the “boilerplate” part, leaving the programmer free to concentrate on the important part of the algorithm. Such generic programs are much more robust to data structure evolution because they contain many fewer lines of type-specific code.