Python悖论:小众语言吸引顶尖程序员
Paul Graham 在 2004 年提出一个观点:公司如果用 Python 这种相对小众的语言开发软件,反而能招到更优秀的程序员。因为学习 Python 的人并非为了找工作,而是真正热爱编程。这种自选择效应使得 Python 社区聚集了更聪明、更投入的开发者。文章还讨论了语言美感对编写高质量代码的重要性。对技术管理者和编程语言设计者有启发。

August 2004 In a recent talk I said something that upset a lot of people: that you could get smarter programmers to work on a Python project than you could to work on a Java project.

2004年8月 在最近一次演讲中,我说了一件让很多人不快的事:你为Python项目招到的程序员,比Java项目招到的更聪明。
I didn't mean by this that Java programmers are dumb. I meant that Python programmers are smart. It's a lot of work to learn a new programming language. And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know.
我并不是说Java程序员笨。我的意思是Python程序员聪明。学习一门新编程语言需要大量精力。而人们学Python不是因为能靠它找到工作;他们学是因为真正热爱编程,并对已知语言不满意。
Which makes them exactly the kind of programmers companies should want to hire. Hence what, for lack of a better name, I'll call the Python paradox: if a company chooses to write its software in a comparatively esoteric language, they'll be able to hire better programmers, because they'll attract only those who cared enough to learn it. And for programmers the paradox is even more pronounced: the language to learn, if you want to get a good job, is a language that people don't learn merely to get a job.
这恰好是公司应该想要雇用的那类程序员。因此,我暂且称之为Python悖论:如果公司选择用相对小众的语言编写软件,它们就能招到更好的程序员,因为只会吸引那些足够在意而去学习它的人。而对程序员而言,这个悖论更明显:若想找份好工作,你应该学那些人们不仅仅为找工作才学的语言。
Only a few companies have been smart enough to realize this so far. But there is a kind of selection going on here too: they're exactly the companies programmers would most like to work for. Google, for example. When they advertise Java programming jobs, they also want Python experience.
到目前为止,只有少数公司足够聪明意识到了这一点。但这里也存在一种筛选:这些公司正是程序员最想为之工作的那种。例如谷歌,他们在招聘Java编程岗位时,也要求有Python经验。
A friend of mine who knows nearly all the widely used languages uses Python for most of his projects. He says the main reason is that he likes the way source code looks. That may seem a frivolous reason to choose one language over another. But it is not so frivolous as it sounds: when you program, you spend more time reading code than writing it. You push blobs of source code around the way a sculptor does blobs of clay. So a language that makes source code ugly is maddening to an exacting programmer, as clay full of lumps would be to a sculptor.
我有个朋友几乎精通所有主流语言,但他大部分项目都用Python。他说主要原因是喜欢源代码的样子。这听起来像是随意理由,但其实不然:编程时,你读代码的时间比写代码更多。你像雕塑家摆弄黏土一样挪动代码块。因此,让源代码丑陋的语言对严谨的程序员来说令人抓狂,就像满是疙瘩的黏土对雕塑家一样。
At the mention of ugly source code, people will of course think of Perl. But the superficial ugliness of Perl is not the sort I mean. Real ugliness is not harsh-looking syntax, but having to build programs out of the wrong concepts. Perl may look like a cartoon character swearing, but there are cases where it surpasses Python conceptually.
So far, anyway. Both languages are of course moving targets. But they share, along with Ruby (and Icon, and Joy, and J, and Lisp, and Smalltalk) the fact that they're created by, and used by, people who really care about programming. And those tend to be the ones who do it well.
一提到丑陋的源代码,人们自然会想到Perl。但Perl表面的丑陋并非我所指。真正的丑陋不是语法刺眼,而是不得不使用错误的概念来构建程序。Perl可能看起来像个骂人的卡通角色,但在某些概念上它超越了Python。
至少目前如此。当然这两种语言都在演变。但它们与Ruby(以及Icon、Joy、J、Lisp、Smalltalk)共享一个事实:它们由真正在乎编程的人创造和使用,而这些人往往也是编程高手。