你对编程的“道”和“术”的理解( 三 )


曰:“不当使汝往之。其程序员者,游离于天地。嘲戏生命,视之偶遇。去来随性,无所挂牵。其命在于程序,汝何以世之准绳责之?”
“其命在于道。”
2.4A novice asked the Master: "Here is a programmer that never designs, documents, or tests his programs. Yet all who know him consider him one of the best programmers in the world. Why is this?"The Master replies: "That programmer has mastered the Tao. He has gone beyond the need for design; he does not become angry when the system crashes, but accepts the universe without concern. 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."或问曰:“有程序员未尝设计、文档、测试其程序,然天下皆谓其程序美于天下,何也?”
曰:“得道。其无设计,遇崩溃,不怒,顺乎天常;其无文档,或视其程序,不念;其无测试,程序极美,优哉雅哉,不言自明。信夫!入道也!”
第三章 设计Thus spake the master programmer:"When program is being tested, it is too late to make design changes."师曰:“及其测试时改之,晚矣!”
3.1There once was a man who went to a computer trade show. Each day as he entered, the man told the guard at the door:"I am a great thief, renowned for my feats of shoplifting. Be forewarned, for this trade show shall not escape unplundered."This speech disturbed the guard greatly, because there were millions of dollars of computer equipment inside, so he watched the man carefully. But the man merely wandered from booth to booth, humming quietly to himself.When the man left, the guard took him aside and searched his clothes, but nothing was to be found.On the next day of the trade show, the man returned and chided the guard saying: "I escaped with a vast booty yesterday, but today will be even better." So the guard watched him ever more closely, but to no avail.On the final day of the trade show, the guard could restrain his curiosity no longer. "Sir Thief," he said, "I am so perplexed, I cannot live in peace. Please enlighten me. What is it that you are stealing?"The man smiled. "I am stealing ideas," he said.尝有人与机展,每进,语于卫曰:
“我,贼也,工于行窃。汝将警之,此展在劫难逃。”
卫大窘,防范甚严。然其人悠然自得,往来于展位间,喃喃然若自语。
待其离展,卫搜其身,终不能得一物。
次日,其人返之,斥卫曰:“昨日,吾所获甚丰,今日更甚。”卫监之愈甚,仍不能得。
及展终,卫问曰:“余之惑甚矣。何物乃先生所窃?”
笑曰:“思想也。”
3.2There once was a master programmer who wrote unstructured programs. A novice programmer, seeking to imitate him, also began to write unstructured programs. When the novice asked the master to evaluate his progress, the master criticized him for writing unstructured programs, saying: "What is appropriate for the master is not appropriate for the novice. You must understand the Tao before transcending structure."尝有高手专为非结构化程序者。低手仿之,求教之。斥曰:“世事适于高手者,未尝适于低手。汝欲为之,必先得道。”


推荐阅读