The Codeless Code: Case 12-13 Effect(成效)、Evolution(进化)

The Codeless Code: Case 12 Effect(成效)

Three young monks—one from the Spider Clan, one from Laughing Monkey, and one from Elephant's Footprint—had been arguing about which was the more important: webtier code, business tier, or persistence. Finally they agreed to pose the question to the Java master.

三个僧侣(分别来自蜘蛛城、笑猴城、象印城)正在一块儿讨论网络编程、职场职级和检查三个因素之中那个更重要一些,最后,他们一致决定把问题拿到Java大师那里,让他给出答案。

The master called in one of the burly gardeners who maintained the temple grounds, and instructed him thus: “Beat and kick these three monks soundly for one minute. Afterward, you may continue to beat and kick them for as long as you desire.”

大师召来了一个负责守卫修道院的身材魁梧的护卫,并对他说:“在一分钟之内,把这三个僧侣先给打一顿,超过一分钟之后,你愿意打多久就打多久。”

The gardener thrashed the monks for a full seven minutes, then bowed and left.

于是,护卫狠狠的把这三个僧侣棒揍了7分钟,之后便鞠躬离开了。

“Now,” said the master. “Who bears the greatest blame for your bruises today? Myself, for summoning the gardener; the gardener, for the six minutes left to his discretion; or the gardener’s hands and feet? Consider your answer, or I shall call him in again.”

“现在呢”,大师说到,“谁最应该为你们今天满身的淤青承担责任受到责备呢?是应该我来承担吗?因为是我叫来了护卫;是应该护卫来承担吗?因为后6分钟是遵循他的意愿打的;还是应该责备护卫的手和脚?因为是它们让你们身上落下淤青。想好了再回答哈,否则我可以把护卫再给召回来。”

At length, the monk of the Spider Clan said, “The carpenter who raised the first beam of this temple bears a greater blame.”

最终,一个来自蜘蛛城的僧侣说:“修建这座修道院的第一架横梁的木匠应该受到更大的责备”(读者注:职场中,专业素质、职级高下和多年如一日的坚持,那个都是维持职场兴旺不可缺少的因素,如果真的需要选一个那个最重要,那就应该把提出这个问题的人给打一顿吧!)

The master was satisfied.

大师非常满意。

The Codeless Code: Case 13 Evolution(进化)

A novice studied the Java master’s* code and adopted the master’s style to an exacting degree: the design patterns employed, the naming conventions for variables, the number of spaces used to indent each nested block. Even the comments were written in an impressive imitation of the master’s own voice.

一个新手研读着Java大师的代码并力图适应大师严苛的代码风格,比如,大师的设计模式、对变量的命名惯例、许多空余空间缩进的次数。甚至,甚至连所写的命令都力求和大师所写的命令的语气保持一致。

During his next code review, the novice was surprised to find the Java master tremendously displeased.

当这个新手第二次再来研读大师的代码的时候,他忽然惊讶的发现大师变的怒不可遏。

“But, master,” protested the student. “I have followed your example down to the final semicolon. See, here is a utility class you wrote only last month: is it not as like to my own code as two eggs from the same clutch?”

“但是,大师”,这个新手还有点不服气的说,“我模仿您所写的所有代码,大到一个示例,小到一个分号我都不放过。 你看,这是你上周刚写的实用类代码,这和我现在写的代码相比,不就跟放在一个窝的俩鸡蛋一样——一模一样吗?”

“And therein lies the problem,” scowled the master. “Yesterday I was a fool, the week before an idiot, and last month an imbecile. Don’t show me code I might have written yesterday. Show me code as I will write it tomorrow.”

“但这样存在一个问题”,大师愤怒的说道,“我在昨天的时候还是一个傻子,在上周的时候是个笨蛋,在上个月的时候是个低能儿。不要给我看我可能在昨天之前写出的所有代码,而要给我看我明天之后可能写出的代码!”(读者注:编程是一个讲究创造性的营生,亦步亦趋的模仿是搬砖,不是编程,新手尤其须注意不要被老手的经验所绑缚,而应该在前任的经验之上,大胆开创更好的才行!)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值