But yak shaving is fun
But yak shaving is fun / 但“剃牦牛毛”其实很有趣
This blog doesn’t use a static site generator or framework like Jekyll, Hugo, or Gatsby. I tried a few of them at first, but they gave me too little freedom to customize, so I decided to build the blog myself. Early on I just wrote posts in HTML, but that was so inconvenient that I built a system for writing posts as JSON files. That too was awkward for longer pieces, so I developed a service that converts Markdown files into HTML files. Then I built a tool to compile and deploy the resulting files. In the end, I’d built a static site generator from scratch.
这个博客没有使用 Jekyll、Hugo 或 Gatsby 等静态网站生成器或框架。起初我尝试过几个,但它们给我的自定义自由度太低,所以我决定自己动手搭建。早期我只是用 HTML 写文章,但这太不方便了,于是我构建了一个将文章写成 JSON 文件的系统。对于长篇内容,这种方式也很笨拙,所以我又开发了一个将 Markdown 文件转换为 HTML 文件的服务。接着,我又写了一个工具来编译和部署生成的文件。最终,我从零开始构建了一个静态网站生成器。
This kind of thing is called yak shaving. The term was coined by Carlin Vieri, a PhD student at the MIT AI Lab, and it refers to doing a chain of related tasks for a single goal until you lose the original purpose entirely and end up on something completely unrelated. An example mentioned on LangDev IRC makes it clear why it’s called yak shaving.
这种行为被称为“剃牦牛毛”(yak shaving)。这个术语由麻省理工学院人工智能实验室的博士生 Carlin Vieri 创造,指的是为了实现一个目标而进行一系列相关任务,直到你完全忘记了最初的目的,最终陷入到一件完全不相关的事情中。LangDev IRC 上提到的一个例子很好地解释了为什么叫“剃牦牛毛”。
I get an axe to chop down a tree. The axe is too dull, so I go looking for a stone to sharpen it. But I hear that a certain village has a really good stone. I get a yak to travel to that village. The yak’s hair is too long, so I start shaving it.
我拿了一把斧头去砍树。斧头太钝了,所以我去找磨刀石。但我听说某个村庄有很好的磨刀石。我找了一头牦牛准备去那个村庄。结果牦牛的毛太长了,于是我开始给它剃毛。
There’s also an example from Seth Godin, the entrepreneur, marketer, and author. “I should wash the car today.” “Oh no, the hose is busted. I’d better buy a new one at Home Depot.” “But Home Depot is on the other side of the Tappan Zee Bridge. I have to go through the toll, so I need an E-ZPass.” “Wait! I think I could borrow my neighbor’s E-ZPass…” “But Bob won’t lend me his E-ZPass until my son returns the pillow he borrowed.” “The pillow has shed so much yak hair that I can’t just give it back. I’ll have to restuff it with yak hair.” And so, just to wash the car, I end up at the zoo shaving a yak.
企业家、营销专家兼作家 Seth Godin 也举过一个例子:“我今天应该洗车。”“糟糕,水管坏了。我最好去家得宝(Home Depot)买根新的。”“但家得宝在塔潘泽大桥(Tappan Zee Bridge)的另一边。我得过收费站,所以我需要一个 E-ZPass(电子收费卡)。”“等等!我想我可以借邻居的 E-ZPass……”“但鲍勃不肯把 E-ZPass 借给我,除非我儿子还回他借走的枕头。”“枕头掉了很多牦牛毛,我不能直接还回去。我得重新填充牦牛毛。”就这样,为了洗个车,我最终在动物园里给牦牛剃毛。
Both stories came after the term yak shaving was coined; the term itself was actually born somewhere else. Carlin Vieri, who had played hockey late into a Tuesday night, was eating dinner in the middle of the night and watching TV. On TV was the Yak Shaving Day episode of the cartoon The Ren & Stimpy Show. The plot goes like this: Yak Shaving Day is five days off. Ren and Stimpy decorate the house by hanging a dirty diaper on the wall and pouring coleslaw into their boots. Then they set shaving cream and a razor on the bathroom sink and pray that a shaved yak will fly in on a magic kayak and bring them gifts. That night, the yak emerges from the bathtub drain, shaves, and leaves a gift in the sink before going: the very scum of the cream it used to shave.
这两个故事都是在“剃牦牛毛”这个词被创造出来之后才出现的;这个词本身其实诞生于别处。Carlin Vieri 在一个周二深夜打完冰球后,半夜吃着晚餐看着电视。电视里播放的是动画片《莱恩和史丁比》(The Ren & Stimpy Show)中关于“剃牦牛日”的一集。剧情是这样的:距离“剃牦牛日”还有五天。莱恩和史丁比通过在墙上挂脏尿布、往靴子里倒凉拌卷心菜来装饰房子。然后,他们在浴室洗手池上放上剃须膏和剃须刀,祈祷一只剃了毛的牦牛能乘着魔法皮划艇飞进来给他们送礼物。那天晚上,牦牛从浴缸排水管里钻出来,剃了胡子,在离开前在洗手池里留下了一份礼物:它剃须时用过的泡沫残渣。
Carlin Vieri found this bizarre. A few days later, while pulling an all-nighter on paperwork (annoying chores like getting an administrator’s permission, setting up a DHL account, and finding a post office), he told a colleague he was yak shaving. He kept using the phrase with people in the lab over the next few months, and the term caught on. The cartoon is so strange, and has so little to do with software, that its origin doesn’t seem to be widely known.
Carlin Vieri 觉得这很离奇。几天后,当他熬夜处理文书工作(比如获取管理员许可、设置 DHL 账户、寻找邮局等烦人的琐事)时,他告诉同事他正在“剃牦牛毛”。在接下来的几个月里,他不断在实验室里使用这个短语,于是这个词就流行开了。这部动画片太奇怪了,而且与软件几乎毫无关系,以至于它的起源似乎并不广为人知。
One mistake engineers (or the managers running engineering teams) often make is “building from scratch.” An engineer might not quite like the off-the-shelf solutions, or might want to prove their own skill. A client or manager might have a mistaken idea of what existing solutions do, or might think those solutions don’t precisely meet the requirements.
工程师(或管理工程团队的经理)常犯的一个错误是“从零开始构建”。工程师可能不太喜欢现成的解决方案,或者想证明自己的技术。客户或经理可能对现有解决方案的功能有误解,或者认为这些方案无法精确满足需求。
Whether it’s production or a toy project, most projects have a limited budget and limited time. Build from scratch and you eventually start shaving a yak, and once you start shaving, there’s no telling where it ends. In the end you give up the original goal. In a case like that, the right move is to find an alternative that satisfies the core of the requirements and to cut the work down as much as possible.
无论是生产项目还是个人玩具项目,大多数项目都有预算和时间的限制。从零开始构建,你最终就会开始“剃牦牛毛”,一旦开始,就不知道何时才能结束。最后,你往往会放弃最初的目标。在这种情况下,正确的做法是寻找一个能满足核心需求的替代方案,并尽可能减少工作量。
But yak shaving is fun. Yak shaving can’t help but be fun. Making something that didn’t exist before, finding and solving problems, digging through a chain of knowledge to understand how something works: all of it pulls engineers in. The very idea of building the thing you want yourself is appealing even if you aren’t an engineer.
但“剃牦牛毛”确实很有趣。这种行为让人欲罢不能。创造出以前不存在的东西、发现并解决问题、挖掘知识链以理解事物运作的原理:这一切都深深吸引着工程师。即使你不是工程师,亲手构建自己想要的东西这个想法本身也极具吸引力。
In The Mythical Man-Month, Frederick P. Brooks Jr. gave these reasons why programming is fun: The sheer joy of making things. The joy of making something useful to other people. The fascination of fashioning a complex, puzzle-like object out of interlocking moving parts, and watching the rules you built into it play out in subtle cycles. The joy of constant learning. The joy of working with a flexible, easily handled medium of expression.
在《人月神话》一书中,Frederick P. Brooks Jr. 给出了编程之所以有趣的理由:创造事物的纯粹快乐;制造对他人有用的东西的快乐;将复杂的、类似拼图的对象通过相互关联的部件组合在一起,并观察你植入其中的规则在微妙的循环中运行的迷人之处;不断学习的快乐;使用一种灵活、易于操作的表达媒介进行工作的快乐。
TeX, too, was born from shaving a yak. TeX is a typesetting system created by Stanford professor Donald Knuth; the name covers the whole system that runs the program, including the typesetting language and the compiler that processes it. Because it makes formulas easy to enter, it’s widely used in the social sciences and in science and engineering. (LaTeX, a set of macros for using TeX more easily, is what most people use.)
TeX 也是诞生于“剃牦牛毛”的过程。TeX 是斯坦福大学教授 Donald Knuth 创建的排版系统;这个名字涵盖了运行该程序的整个系统,包括排版语言和处理它的编译器。因为它使公式输入变得简单,所以被广泛应用于社会科学、科学和工程领域。(大多数人使用的是 LaTeX,这是一套为了更轻松使用 TeX 而编写的宏包。)
In 1976, Donald Knuth was preparing the second edition of The Art of Computer Programming, Volume 2: Seminumerical Algorithms. He wanted to use hot type, the same typesetting used in the first edition, but hot type was no longer available. Unhappy with the alternatives, Knuth came across Patrick Winston’s new book, which had been digitally typeset around that time. Inspired by it, he resolved to build his own digital typesetting system and sketched out TeX’s basic features.
1976 年,Donald Knuth 正在准备《计算机程序设计艺术》第二卷《半数值算法》的第二版。他想使用第一版中使用的那种热排版(hot type),但当时热排版技术已经不再可用。对替代方案感到不满的 Knuth 偶然看到了 Patrick Winston 的新书,该书当时采用了数字排版。受此启发,他决定构建自己的数字排版系统,并勾勒出了 TeX 的基本功能。
Knuth built the first version of TeX in the SAIL language, then developed and finished it in WEB, a programming language he created himself. WEB source mixes documentation and code together, and the documentation and code in a WEB file can be extracted into a TeX file and a Pascal file by two programs called Weave and Tangle.
Knuth 用 SAIL 语言构建了第一个版本的 TeX,随后用他自己创造的编程语言 WEB 开发并完成了它。WEB 源码将文档和代码混合在一起,WEB 文件中的文档和代码可以通过名为 Weave 和 Tangle 的两个程序分别提取为 TeX 文件和 Pascal 文件。