佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1212|回复: 3

[转载]《编程之道》(小赵译版)

[复制链接]
发表于 30-6-2005 11:25 PM | 显示全部楼层 |阅读模式
回复

使用道具 举报


ADVERTISEMENT

GnuG@j 该用户已被删除
发表于 1-7-2005 01:29 AM | 显示全部楼层
道非道,非常道。此道非彼道.....揸到...揸到
回复

使用道具 举报

发表于 2-7-2005 05:49 PM | 显示全部楼层
我非常欣赏这几个编程的 "道", 它说得非常好

"Though a program be but three lines long, someday it will have to be maintained."
“既使一个程序只有三行长,也总有一天需要去维护它”

A program should follow the Law of Least Astonishment. What is this law? It is simply that the program should always respond to the user in the way that astonishes him least.
一个程序应该遵循``最小惊讶原则'',什么是``最小惊讶原则''?就是说一个程序应该最小程度地引起用户的惊讶。

A program, no matter how complex, should act as a single unit. The program should be directed by the logic within rather than by outward appearances.
无论一个程序无论有多么复杂都应该是一个单一的整体。程序是被它的内部逻辑所指引而不是它的外观表现。

If the program fails in these requirements, it will be in a state of disorder and confusion. The only way to correct this is to rewrite the program.
如果一个程序不能满足所要的需求,它就会处于混乱无序的状态中。唯一的出路就是重写这个程序。

"When program is being tested, it is too late to make design changes."

“程序被测试时再去改变它的设计已经太晚了。”

Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming.
寂静的虚空里诞生了神秘的东西,这种东西恒久存在永不消失,它是所有程序的根源所在,我不知道怎么形容它,姑且称它为编程之道。
If the Tao is great, then the operating system is great. If the operating system is great, then the compiler is great. If the compiler is greater, then the applications is great. The user is pleased and there is harmony in the world.
如果道是完美的,那么操作系统就是完美的,如果操作系统是完美的,那么编译嚣就是完美的,如果编译嚣是完美的,那么应用程序就是完美的,所以用户心满意足,整个世界因此和谐。

The Tao of Programming flows far away and returns on the wind of morning.
编程之道去如黄鹤来如晨风。

1.2
The Tao gave birth to machine language. Machine language gave birth to the assembler.
道生机器语言,机器语言生汇编嚣。
The assembler gave birth to the compiler. Now there are ten thousand languages.
汇编器生编译器,最后产生上万种高级语言。

Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
不论多么的微不足道,每种语言都有它自己的目的,每种语言都表达了软件的阴阳两极。每种语言都各得其道。

But do not program in COBOL if you can avoid it.
但是尽量不要用COBOL语言。
回复

使用道具 举报

 楼主| 发表于 4-7-2005 12:39 AM | 显示全部楼层
喜欢以下几段:

曾经有一个人参加计算机展览,每天他进门时都对门卫说:
“先警告你,我是偷盗高手,我入室偷盗的本领闻名遐迩。这次展览会也再劫难逃。”
警卫因此大动干戈,因为里面有价值百万的计算机设备,所以他牢牢盯紧了这个人,但是这个人只是从一个摊位逛到另一个摊位,一边平静地喃喃自语。
当这个人离开时,警卫搜了他的身,但是什么也没有发现。
展览会的第二天,这个人又对警卫说:“昨天我满载而归,但是今天我会收获更大。”所以警卫更加小心地盯紧他,但是这样做完全于事无补。
展览会的最后一天,警卫再也不能忍住他的好奇心了。“小偷先生,”他说,“ 你说我惊慌不安,请告诉我,你到底偷了什么?”。
这个人笑笑说:“我在偷想法。”


一个程序应该是轻灵自由的,它的子过程就象串在一根线上的珍珠。自始至终,目标明确。增之一字节则太长,减之一字节则太短。既没有不必要的循环也没有没有被引用的变量,既不缺少结构化也不至于僵硬呆板。


一个好的农民不会不管他的庄稼。
一个好的老师不会不管哪怕是最差的学生。
一个好的父亲不会让他的任何一个孩子挨饿。
一个好的程序员不应拒绝维护他的程序。



风不动则草不动,
没有软件,硬件只是一堆发热的电子器件
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 9-6-2024 07:06 PM , Processed in 0.060571 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表