一位同事从未听说过这个词,我也无法给出一个确切的定义。对我来说,这一直是一个“我看到什么就知道什么”的例子。

附带问题,这个词是谁发明的?


当前回答

样板文件是一种写作单元,可以不作任何更改地反复使用。通过扩展,这种思想有时应用于可重用编程,如“样板代码”

其他回答

样板文件是优秀程序员所避免的:重复。

来自whatis.techtarget.com:

In information technology, a boilerplate is a unit of writing that can be reused over and over without change. By extension, the idea is sometimes applied to reusable programming as in "boilerplate code." The term derives from steel manufacturing, where boilerplate is steel rolled into large plates for use in steam boilers. The implication is either that boilerplate writing has been time-tested and strong as "steel," or possibly that it has been rolled out into something strong enough for repeated reuse.

编程之外:

样板可以与特定类型的模板进行比较 被认为是一个填空样板。一些典型的 样板文件通常包括:任务陈述、安全警告 使用的安装程序、版权声明和责任 免责声明。

以我作为程序员的经验来看,合适的样板代码通常是一堆你开始的代码,这些代码不太大,也不太复杂,不能称为框架。

HTML5 Boilerplate就是一个典型的例子。

样板文件是一种写作单元,可以不作任何更改地反复使用。通过扩展,这种思想有时应用于可重用编程,如“样板代码”

您可以将其称为“片段”,或者更准确地称为“片段的集合”。 我认为这个术语是由新闻界和印刷业创造出来的,在那里他们使用实际的“板块”,然后再次将它们用作大块。 在现代互联网上,这是一个正在进行的(恕我冒犯)趋势的一部分,使用花哨的术语来描述简单的东西,以便看起来更时尚和复杂。参见响应性=适应性/流动性。

在词源上,术语boilerplate: from http://www.takeourword.com/Issue009.html…

Interestingly, the term arose from the newspaper business. Columns and other pieces that were syndicated were sent out to subscribing newspapers in the form of a mat (i.e. a matrix). Once received, boiling lead was poured into this mat to create the plate used to print the piece, hence the name boilerplate. As the article printed on a boilerplate could not be altered, the term came to be used by attorneys to refer to the portions of a contract which did not change through repeated uses in different applications, and finally to language in general which did not change in any document that was used repeatedly for different occasions.

编程中的样板文件由什么组成?正如其他人可能已经指出的那样,它 只是一大块代码,一遍又一遍地复制,很少或 在这个过程中没有对它做任何改变。