编程之道-程序员的哲学

《编程之道》,一个酷爱东方哲学和练太极拳的老外写的书。作者是一位资深的程序设计师,从他的爱好和著作中 可以看得出作者的文化底蕴。而他现在从事的工作,是如何把最好的管理技术和高科技企业联系起来,而这种最好的“管理技术”的理念是“应用文化动力学”。他 模仿《道德经》、禅宗公案和古代寓言的形式写出了三本很有意思的书:《编程之道》《编程之禅》《计算机寓言-信息时代的启示》(《The Tao of Programming》《The Zen of Programming》《Computer Parables-Enlightenment in the Informating Age》).

Thus spake the master programmer:"When you have learned to snatch the error code from the trap frame, it will be time for you to leave."
//编程大师说:"当你从我手中夺走水晶球时,就是你离开的时候了。"
   
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.
//寂静的虚空里诞生了一种神秘的东西,它独自守候着,毫无动静,它立刻静止了。然而却又处于永恒的运动之中。它是所有程序的根源所在,我不知道怎么形容它,姑且称它为编程之道。
   
The Tao of Programming flows far away and returns on the wind of morning.
//编程之道流逝远去,又乘着晨风而归。

Thus spake the master programmer:
"After three days without programming, life becomes meaningless."
 //编程大师如是说:三日不编程,食肉无味。

Aware, like a fox crossing the water. Alert, like a general on the battlefield. Kind, like a hostess greeting her guests. Simple, like uncarved blocks of wood. Opaque, like black pools in darkened caves.

他们是清醒的,如狐狸过水;他们是机警的,如战场上的将军;他们是和善的,如款待客人的女主人;他们是简单的,如同未经雕刻的木头;他们又是难以琢磨的,如深渊之水。

Grand Master Turing once dreamed that he was a machine. When he awoke he exclaimed:"I don't know whether I am Turing dreaming that I am a machine, or a machinedreaming that I am Turing!"
超级大师图灵曾梦见自己成为了一台机器,醒后他叹道:"我不知道是图灵梦见自己变成机器还是机器梦见自己变成图灵。"

 "What sort of programmers work for other companies? They behaved badly and were unconcerned with appearances. Their hair was long and unkempt and their clothes were wrinkled and old. They crashed out hospitality suites and they made rude noises during my presentation."
"Those programers live beyond the physical world. They consider life absurd,an accidental coincidence. They come and go without knowing limitations. Without a care, they live only for their programs. Why should they bother with social conventions?"
"They are alive within the Tao."

"那些别的公司的程序员都是些什么样的人呀?他们举止不雅,不修边幅,头发蓬乱,衣服破旧,他们闯进我们的会议组,还在我说话的时候乱嚷嚷。"

“这些程序员生活在现实世界之外。他们认为生活是荒唐的,一场意外的偶然而已。他们来去自由,无所牵挂,他们只为他们的程序生活。为什么要用社会习俗来约束他们呢?”
”他们生活在道中“。

 "That programmer has mastered the Tao. He has gone beyond the need for design; He has gone beyond the need for documentation; he no longer cares if anyone else sees his code.He has gone beyond the need for testing; each of his programs are perfect within themselves, serene and elegant, their purpose self-evident. Truly,he has entered the mystery of the Tao."

"那个程序员掌握了道。他不需要预先进行设计;他不需要写文档,他从不顾及有没有人看他写的代码。他也不需要进行测试;他写的每个程序都是一个那么完美,平静而优雅,它们的目的不言自明。的的确确,他已经进入了道的神秘境界。"


Price Wang's programmer was coding software. His fingers danced upon the keyboard. The program compiled without an error message, and the programran like a gentle wind.
编程大师编写软件时,手指在键盘上快速飞舞。程序编译时没有一条错误信息,程序运行起来就象一阵微风吹过。

Excellent!" the Price exclaimed, "Your technique is faultless!"
太精彩了!经理叹道,你的技巧已经无可挑剔了。

"Technique?" said the programmer, turning from his terminal, "What I follow is the Tao -- beyond all technique. When I first began to program I would see before me the whole program in one mass. After three years I no longer saw this mass. Instead, I used subroutines. But now I see nothing. My whole being exists in a formless void. My senses are idle.My spirit, free to work without a plan, follows its own instinct. In short,my program writes itself. True, sometimes there are difficult problems.I see them coming, I slow down, I watch silently. Then I change a single line of code and the difficulties vanish like puffs of idle smoke. I then compile the program. I sit still and let the joy of the work fill my being.I close my eyes for a moment and then log off."

" 技巧?",大师转过身说,"我所遵循的是道--它超乎所有的技巧。当我开始编程时我看到的是整个一大块的程序,三年后我看到的是子过程。现在我什么也看不 到了。我的整个存在是没有任何形式的虚无。我感觉很悠闲,总之,事实上是我的程序自己在写,有时我看到一些问题,我看到它们,就停下来静静地观察它们,然 后我改变了一行代码,难题就象一阵轻烟一样化为乌有。然后我编译程序。坐在那里享受工作的喜悦。闭了一会眼睛然后退出系统。"

Price Wang said, "Would that all of my programmers were as wise!"

"真希望我的程序员都这么聪明!"

A master programmer passed a novice programmer one day. The master noted the novice's preoccupation with a hand-held computer game. "Excuse me",he said, "may I examine it?"
有一天编程大师碰见了一个正玩掌上游戏机的编程新手,他说:"给我看一下?"

The novice bolted to attention and handed the device to the master. "I see that the device claims to have three levels of play: Easy, Medium,and Hard", said the master. "Yet every such device has another level of play, where the device seeks not to conquer the human, nor to be conquered by the human."

"Pray, great master," implored the novice, "how does one find this mysterious setting?"
The master dropped the device to the ground and crushed it under foot.And suddenly the novice was enlightened.

新手把游戏机递给大师,"我看到上面说明了三种难度的玩法:容易,中等,高难",大师说,"但是每个这样的游戏机都有另外一种玩法,此时游戏机即不是想着怎么赢你,也不是怎么被你赢。"
"那么请问大师",初学者说,"这种玩法到底是怎样玩的呢?"
大师把游戏机摔到地下然后用脚踩碎它,突然初学者明白了。

Thus spake the master programmer: 编程大师如是说:

"Time for you to leave."
"现在是你出师的时候了。"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值