程序代码里的幽默精神
译者 zen禅
程序代码里的幽默精神
《科学美国人》(Scientific American) 2011.11.1
作者:大卫·伯格 (David Pogue)
译者:zen禅
In Google Maps, the distance-measuring tool offers a choice of three unit systems: Metric, English or “I’m Feeling Geeky.” If you click the third one, you’re offered a long list of, ahem, somewhat uncommon measurement units, including parsecs, Persian cubits, and Olympic swimming pools.
在使用谷歌地图的测距工具时,你有三种选择:公制,英制,或者“我想极客一把”(I'm feeling geeky)。如果你选择了第三个选项,将会出现一系列测距单位供你选择,其中一些很少用到,比如:秒差距( parsecs 一种天文距离单位), 波斯腕尺(Persian cubits), 还有水立方游池(Olympic swimming pools)。
Mac OS X’s text-to-speech feature, meanwhile, lets you endow your Mac with any of dozens of different human voices. Each speaks a funny sample sentence. The Fred voice says, “I sure like being inside this fancy computer.” The quaking, semihysterical Deranged voice says, “I need to go on a really long vacation.” The alien-sounding Trinoids voice says, “We cannot communicate with these carbon units.”
苹果OS X系统的文本到语音(text-to-speech)功能,有几十种不同的声音可供你选择。每一种声音都配有一句风趣的范例对话。如果你选择弗莱德的声音(The Fred voice),听到的会是:“这台电脑这么棒,我当然愿意呆在里面了。”而精神病人的声音(The Deranged voice)听上去则是颤抖的歇斯底里:“我要好好放个假。”连外星人(The Trinoids voice)也来凑热闹:“我们无法和这些碳基生命交流。”
On YouTube, if you pause a video and hold down the up and left arrow keys, you trigger a secret game of Snake. Try to guide the increasingly long snake’s body around the screen with your arrow keys without tripping over yourself.
在YouTube看视频的时候,如果你按暂停键,然后按住键盘左方向键,就会发现视频中央的缓冲圆圈变成了一条贪吃蛇。用方向键操控贪吃蛇追逐光点越吃越大吧,小心不要碰到自己的身体。
In each of these cases, some programmer deep inside these megalithic corporations exhibited a sense of humor—a display that somehow made it past committee, through the lawyers and out into the world.
在上面这些例子里,大公司的程序员们向我们展现了他们幽默的一面。
In the olden days—10 or 20 years ago—this sort of playfulness in software was more common. Software engineers took pride in embedding into their code all manner of jokes, whimsy and Easter eggs (hidden surprises triggered by unlikely sequences of keystrokes).
在过去——10年或20年前——像这样在软件中加入玩笑元素的例子要更普遍。软件工程师在代码中插入各种笑料,怪想或复活节彩蛋(Easter eggs 藏在程序中的小惊喜,需要特定的场景或操作才能触发),并引以为傲。
Some of it was simple pride. Easter eggs often took the form of programming credits; after all, programmers usually don’t get any public recognition, not even in the user guide.
这样做的部分原因,仅仅是出于自豪之情。要知道,程序员们常常是不为公众所知的,即使在软件的用户指南里也找不到他们的名字。所以,他们常会在复活节彩蛋中写下程序开发组的人员名单。
Often the buried humor in software consisted of elaborate inside jokes. In the original system software for the Palm Pilot, for example, programmer Ron Marianetti created an animated taxicab, resembling a fat Volkswagen Beetle, programmed to race across the screen at random times—a tribute to the Pilot’s original proposed name, the Taxi.
有些彩蛋的由来,还有一段有趣的历史。比如,在奔迈飞行员(Palm Pilot,一款早期掌上电脑)的原系统中,程序员罗恩(Ron Marianetti )就创建了一辆类似大众甲壳虫的黄色出租车,会随机的在屏幕上驶过——这是为了纪念这款掌上电脑原本计划的名字,奔迈计程车(Palm Taxi)。
Across the hall, fellow engineer Chris Raff embedded an Easter egg of his own. If you held down your stylus in the lower right corner of the handwriting-practice game screen and then pressed a scroll button, a photo of himself with a buddy, tuxedoed at Palm’s annual Christmas party, would inexplicably appear.
他的同事克里斯(Chirs Raff)则在程序中藏匿了一个关于自己的彩蛋。用触控笔戳手写区屏幕右下角,并按下拉按钮,他和朋友身着燕尾服,参加公司圣诞派对的照片就会神奇的跳出来。
In time, though, Silicon Valley’s corporate bosses began to frown on the practice of burying jokes in software. Part of the reason was quality control: by definition, an Easter egg is an untested feature. It’s a loose cannon that could, in theory, interfere with other, more important parts of the program. It made the overlords nervous.
但好景不长,一段时间后,硅谷的公司老板们开始禁止程序设计师这样做。原因有三,第一个原因,是出于质量控制考虑:严格说来,彩蛋是一段未经测试的程序,理论上来讲,它可能会对整个程序中其他重要的功能代码产生影响。彩蛋是程序中的不安定因素,这让老板们心存担忧。
Another problem was employee retention. When programmers buried their own names into their work, they were, in essence, advertising their own skills. Their names were clearly displayed for inspection by headhunters at rival software companies.
另一个原因,则是为了留住雇员。程序员在彩蛋里留下自己的名字,实际上是在给自己的代码能力做广告,竞争对手的猎头很容易就能得到程序员的个人信息。
Finally, there’s the simple matter of corporate image. An Apple or a Microsoft or a Palm may spend millions to create a certain public image of professionalism. The last thing its image meisters want is some rogue animation of a taxi driving across the screen during an important public demo. (Which actually happened to Palm. The taxi Easter egg was removed shortly thereafter.)
最后一个原因,是出于公司整体形象的考量。不管是苹果,微软或是奔迈,为了创造一个专业的公众形象,都可能要花费数百万美元。 在一场重要的产品发布会上,一辆不知所谓的出租车从屏幕上晃晃悠悠穿过,这可不是公司愿意看到的。(这事还真让奔迈公司给碰上了。在那之后不久,出租车彩蛋就被删除了。)
These days, the spirit of in-jokes and whimsy lives on, but it has moved to new addresses: video games and movies—especially movies on DVD. Software jokes still live on in mainstream apps, but they’re less ambitious, and most of them seem to come from Apple and, especially, Google.
现如今,玩笑和搞怪精神犹在,但我们更多的是在电子游戏和电影DVD中见到这些彩蛋。在一些主流应用程序中,我们还能发现隐藏的小惊喜,但相比之前,已经收敛了许多。而这些有幽默精神的软件,大部分出自苹果和谷歌。
Inside jokes lurk on the icon for Apple’s TextEdit, for example (view the icon at the largest possible size). Or turn on the Mac’s Speech Recognition feature and say to your computer, “Tell me a joke.”
把苹果的TextEdit图标放大,你看到了什么?(文本内容是苹果1997年的著名电视广告,Think Different)或者打开Mac的语音识别,对你的电脑说,“给我讲个笑话。”(Tell me a joke)
Or search Google for “recursion” and click the “Did you mean?” suggestion. Or call up the Sydney Opera House in Google Earth and then spin around to the waterfront side; a late, great TV celebrity waits for you there. Or ask Google Maps to give you the directions from Japan to China and marvel at Google’s suggestion for getting across the Pacific (step number 42).
你也可以在谷歌上搜索“递归”(recursion),然后点击搜索框下面的“你要搜索的是?”(谷歌会建议你搜索“递归”,点击建议链接后,你又会得到同样的结果,如此周而复始。)
或者在谷歌地球中找到悉尼歌剧院,调整视觉角度,来到滨水的一边,你会发现,一位已故的电视明星在那里等你呢(已故的野生动物专家和冒险家Steve Irwin正与鳄鱼搏斗)。
当然,你还可以向谷歌地图提问,让它告诉你怎么从日本去中国,看到它给出的如何横渡太平洋的建议,可不要过于吃惊。(Jet ski across the Pacific Ocean 摩托艇横渡太平洋)
Thank you, anonymous programmers; keep it up. You’ve made it clear that software can do more than make us productive—it can also make us happy.
谢谢你们,那些不知名的程序员,请继续保持幽默精神。你们已经证明了,软件不但能提高我们的工作效率——还能为我们带来欢乐。