免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2766 | 回复: 0

The Cathedral and the Bazaar (2)——The Mail Must Get Through 邮件必须接通 [复制链接]

论坛徽章:
0
发表于 2011-07-02 01:37 |显示全部楼层
http://blog.sina.com.cn/s/blog_746638070100tf47.html


Since 1993 I'd been running the technical side of a small free-access Internet service provider called Chester County InterLink (CCIL) in West Chester, Pennsylvania. I co-founded CCIL and wrote our unique multiuser bulletin-board software— you can check it out by telnetting to locke.ccil.org. Today it supports almost three thousand users on thirty lines. The job allowed me 24-hour-a-day access to the net through CCIL's 56K line—in fact, the job practically demanded it!



从1993年以来我一直负责位于 West Chester, Pennsylvania的一家名叫CCIL(Chester County InterLink)的一家免费网络服务供应商的技术工作。我吸住建立了CCIL并且写了我们自己的多用户电子留言版软件——你可以通过telnet连接到locke.ccil.org尝试一下。今天这个软件服务于大约30条线路上的3000个用户。这项工作允许我通过CCIL的56K的网线24小时接入网络——事实上,这项工作需要这样。

I had gotten quite used to instant Internet email. I found having to periodically telnet over to locke to check my mail annoying. What I wanted was for my mail to be delivered on snark (my home system) so that I would be notified when it arrived and could handle it using all my local tools.

我已经很习惯于远程的网络电子邮件。我发觉定期的通过telnet连接到locke来查收电子邮件是很讨厌的事情。我想要的是邮件发送到snark(我的本地系统),这样就可以在有新邮件的时候提醒我,并且我可以使用本地的软件来处理他们了。

The Internet's native mail forwarding protocol, SMTP (Simple Mail Transfer Protocol), wouldn't suit, because it works best when machines are connected full-time, while my personal machine isn't always on the Internet, and doesn't have a static IP address. What I needed was a program that would reach out over my intermittent dialup connection and pull across my mail to be delivered locally. I knew such things existed, and that most of them used a simple application protocol called POP (Post Office
Protocol). POP is now widely supported by most common mail clients, but at the time, it wasn't built in to the mail reader I was using.

因特网本身的电子邮件传输协议SMPT(Simple Mail Transfer Protocol)并不适合,因为它最适合于机器一直连接的情况,而我的跟人计算机并不总是在线,并且没有一个静态的IP。我所需要的是一个程序能够通过我断断续续的比好连接来拉取我的邮件到本地。我知道有这类东西,大多数这样的软件使用一种叫做POP的简单的应用程序协议。现在POP(Post Office Protocal)被大多数的邮件客户端广泛支持。但是那个时候,我使用的邮件阅读工具并没有支持。

I needed a POP3 client. So I went out on the Internet and found one. Actually, I found three or four. I used one of them for a while, but it was missing what seemed an obvious feature, the ability to hack the addresses on fetched mail so replies would work properly.

我需要一个POP3的客户端。于是我在网上搜索找到了一个。确切的说是我找到了三四个。我使用了其中一个一段时间,但是发现它似乎地缺少了一个很明显的功能——截取取回的邮件的地址以便于回信。



The problem was this: suppose someone named `joe' on locke sent me mail. If I fetched the mail to snark and then tried to reply to it, my mailer would cheerfully try to ship it to a nonexistent `joe' on snark. Hand-editing reply addresses to tack on “ <@ccil.org> quickly got to be a serious pain.

问题就在这里:假设locke上一个叫joe的人给我发了一封邮件。如果我取回邮件到snark 并且试着回复。我的邮件软件将会很高兴的把回复发送到snark上一个不存在的joe上。而手动的附加<@ccil.org>将很快让你觉得那是件很痛苦的事情。

This was clearly something the computer ought to be doing for me. But none of the existing POP clients knew how! And this brings us to the first lesson:

这很显然是电脑应该帮我做的事情。但是现在没有一个POP的客户端知道如何去做。这带给我们第一条启示。

1.Every good work of software starts by scratching a developer's personal itch. Perhaps this should have been obvious (it's long been proverbial that ``Necessity is the mother of invention'') but too often software developers spend their days grinding away for pay at programs they neither need nor love. But not in the Linux world —which may explain why the average quality of software originated in the Linux community is so high.

每一个好的软件的诞生都是因为挠到了开发者的痒处。或许这是个一直以来都很明显的道理(一直有这样的谚语:需求是发明之母),但是太多的软件开发者花费大量的时间去钻研是为了报酬,而他们并不喜欢或者需要。但在linux的世界里面不是这个样子的——这在一定程度上或许能解释为什么从linux社区里起源的软件的质量往往很高。

So, did I immediately launch into a furious whirl of coding up a brand-new POP3 client to compete with the existing ones? Not on your life! I looked carefully at the POP utilities I had in hand, asking myself ``Which one is closest to what I want?'' Because:


于是,我应不应该立刻开始 疯狂地尝试编写一个新版本的POP3客户端来跟已经有的竞争?开玩笑!我仔细的看了看我手里的POP软件,寻找哪一个是最接近我的需求的,因为:

2.Good programmers know what to write. Great ones know what to rewrite (and reuse).

好的程序员知道去编写什么。伟大的程序员知道如复用些什么。

While I don't claim to be a great programmer, I try to imitate one. An important trait of the great ones is constructive laziness. They know that you get an A not for effort but for results, and that it's almost always easier to start from a good partial solution than from nothing at all.

当然我不是在说自己是个伟大的程序员,只是在尝试模仿。伟大程序员一个很重要的特征就是构建的懒惰性。他们明白得到一个A不是为了努力而是为了结果,并且从一个很好的部分性解决方案开始总是比从头开始容易的多。

Linus Torvalds, for example, didn't actually try to write Linux from scratch. Instead, he started by reusing code and ideas from Minix, a tiny Unix-like operating system for PC clones. Eventually all the Minix code went away or was completely rewritten—but while it was there, it provided scaffolding for the infant that would eventually become Linux.


Linus Torvalds就是个很好的例子,他世界上没有从最开始编写Linux。而是从复用Minix的代码和思想开始,Minix是一个小的用于PC的类Unix操作系统。最终所有的Minix代码被去掉和重写——但是还存在的时候,它为后来成为幼儿期的Linux提供了一个脚手架。


In the same spirit, I went looking for an existing POP utility that was reasonably well coded, to use as a development base. The source-sharing tradition of the Unix world has always been friendly to code reuse (this is why the GNU project chose Unix as a base OS, in spite of serious reservations about the OS itself). The Linux world has taken this tradition nearly to its technological limit; it has terabytes of open sources generally available. So spending time looking for some else's almost-good- enough is more likely to give you good results in the Linux world than anywhere else.

运用同样的想法,我开始寻找一个已经存在的相当不错的POP软件,作为开发的基础。Unix世界代码分享的传统一直以来都是很有利于代码复用的(这就是为什么GNU计划选择Unix作为基础系统,虽然对于系统本身存在一些严肃的保留意见)。Linux世界已经把这项传统发挥到了技术的极限;这里有数以万计字节的开源资源可以获得。因此在Linux世界里花些时间去寻找别人“很不错的软件”比在别的地方更有可能让你有好的收获。

And it did for me. With those I'd found earlier, my second search made up a total of nine candidates—fetchpop, PopTart, get- mail, gwpop, pimp, pop-perl, popc, popmail and upop. The one I first settled on was `fetchpop' by Seung-Hong Oh. I put my header-rewrite feature in it, and made various other improvements which the author accepted into his 1.9 release.

对我来说那是很有效的。加上先前找到的那些,我的第二次搜索一共找到了9个候选对象——fetchpop,PopTart,get-mail,gwpop,pimp,pop-perl,pope,popc,popmail和upop。我第一个选中的是Seung-Hong编写的fetchpop。我把我的头部重写特性加到里面,并且做了一些其他的改进,作者接受并且把这些加进了1.9版。

A few weeks later, though, I stumbled across the code for popclient by Carl Harris, and found I had a problem. Though fetchpop had some good original ideas in it (such as its background-daemon mode), it could only handle POP3 and was rather amateurishly coded (Seung-Hong was at that time a bright but inexperienced programmer, and both traits showed). Carl's code was better, quite professional and solid, but his program lacked several important and rather tricky-to-implement fetchpop features (including those I'd coded myself).

然而,几周之后,我无意间发现了Carl Harris编写的 popclient 代码,并且我县我面临一个问题。虽然fetchpop有很多很好的原始创意(例如他的后台守护模式),但是它只能处理POP3协议,并且代码编写比较业余(当时Seung-Hong是一个很聪明但是缺少经验的程序员,并且两种特点都呈现了出来)。Cail的代码要好的多,相当的专业和稳定,但是他的程序缺少几个重要并且难以实现的fetchpop的功能(包括我、编写的那些)。

Stay or switch? If I switched, I'd be throwing away the coding I'd already done in exchange for a better development base.


坚持还是改变?如果我改变,我将会抛弃掉我已经编写的代码,来换取一个好一些的开发基础。

A practical motive to switch was the presence of multiple- protocol support. POP3 is the most commonly used of the post- office server protocols, but not the only one. Fetchpop and the other competition didn't do POP2, RPOP, or APOP, and I was already having vague thoughts of perhaps adding IMAP (Internet Message Access Protocol, the most recently designed and most powerful post-office protocol) just for fun.



选择改变的一个很实际的动机是对多协议的支持。POP3是运用最广泛的POP服务器协议,但并不是唯一的。fetchpop和其他的几个软件都不支持POP2,RPOP或者APOP,而我已经有一个模糊的想法:也许可以为了好玩增加IMAP协议(Internet Message Access Protocol 最近开发设计的并且很有发展潜力的POP协议)。


But I had a more theoretical reason to think switching might be as good an idea as well, something I learned long before Linux.

但是,有一个更理论的原因让我觉得改变也许是个好主意。这是我在linux之前很久发现的。

3.``Plan to throw one away; you will, anyhow.'' (Fred Brooks, The Mythical Man-Month, Chapter 11)

“计划扔掉一个,无论如何你要扔掉一个”(Fred Brooks 《人月神话》11章)

Or, to put it another way, you often don't really understand the problem until after the first time you implement a solution. The second time, maybe you know enough to do it right. So if you
want to get it right, be ready to start over at least once [JB].

换句话说,直到你真正第一次实施了一个解决方案之前你往往不能真正明白一个问题。第二次,也许你能足够明晰如何如正确的做。因此如果你想要把事情做对的话,准备好至少重来一次。

Well (I told myself) the changes to fetchpop had been my first try. So I switched.

好吧(对我自己来说)对于fetchpop的改变是我的第一次尝试,所以我选择了改变。

After I sent my first set of popclient patches to Carl Harris on 25 June 1996, I found out that he had basically lost interest in popclient some time before. The code was a bit dusty, with minor bugs hanging out. I had many changes to make, and we quickly agreed that the logical thing for me to do was take over the program.


当我在1996年6月25日发给Cail Harris第一个补丁的时候,发现他在很久之前就基本上对popclient失去了兴趣。这些代码有点陈旧,有些小的bug。有许多改进要我去做,我们很快达成了一致,接受这个项目成为理所当然的事情。

Without my actually noticing, the project had escalated. No longer was I just contemplating minor patches to an existing POP client. I took on maintaining an entire one, and there were ideas bubbling in my head that I knew would probably lead to major changes.

我没有什么觉察,这个计划已经升级了。我不再仅仅给POP客户端做一些小补丁。我负责起了整个程序的维护,同时有些想法在我脑子里面出现了,我认为这些想法也许能够实现一些大的变动。

In a software culture that encourages code-sharing, this is a natural way for a project to evolve. I was acting out this principle:

在一个倡导分享的软件文化里面,这是一个项目进化的最自然的方式。我正在实践这条法则:

4.If you have the right attitude, interesting problems will find you.

如果你有正确的态度,有趣的问题就会找上门来。

But Carl Harris's attitude was even more important. He understood that 。

但是Cail Harris的态度甚至更为重要,他明白:

5.When you lose interest in a program, your last duty to it is to hand it off to a competent successor.


当你对一个程序失去兴趣的时候,你最后的责任就是把它交给一个能够胜任的继承者。

Without ever having to discuss it, Carl and I knew we had a common goal of having the best solution out there. The only question for either of us was whether I could establish that I was a safe pair of hands. Once I did that, he acted with grace and dispatch. I hope I will do as well when it comes my turn.

甚至不用什么讨论,Carl和我都明白我们有一个共同的目标:找到最好的解决方式。对于我们两个人来说,唯一的问题就是我是否能够证明我的可靠性。一旦我做到了,他就会优雅快速的那样去做。我希望当有一天轮到我的时候,我也能那样去做。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP