三个美德(2)

三个美德在Programming Perl第2版里有比较详细的定义,抄袭如下:

Laziness

The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don’t have to answer so many questions about it. Hence, the first great virtue of a programmer, Also hence, this book. See also impatience and hubris. (p.609)

Impatience

The anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to. Hence, the second great virtue of a programmer. See also laziness and hubris. (p.608)

Hubris

Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won’t want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience. (p.607)

关于Laziness,也请参考Eli Robillard的 More Lazy Programming

懒惰,是指致力于减少总的能量消费的一种品质,该品质使你写些非常有用的节省劳力的程序,并且使你写下清晰细致的文档以避免将来要回答很多问题。(从比较广义的角度讲,它使你采用一致性的风格编程,考虑怎么更好地抽象化对象,模块化功能,怎么清晰有效地组织你的程序,怎么重构你的程序,尽量采用现成的工具/组件等等,以减少重复的劳动以及返工)

没有耐心,是计算机在偷懒时,你所感到的一种愤怒。这使你写的程序,不光是仅对你的需求作出(被动的)反应,而且(积极地)预计到你的需求,(即使不能完全做到),也起码要假装能这么做,(也就是说,你在写程序时确实考虑到了性能/scalability方面的因素)

骄傲,是一种品质,它使你写出/维护别人说不了坏话的程序