上周「经济学人」发表了一篇文章谈论了编程语言 Python 及其社区,以及刚刚辞职的「终身仁慈独裁者」Python之父 Guido van Rossum。
Programming languages
Python has brought computer programming to a vast new audience
And its inventor has just stepped down
IN DECEMBER 1989 Guido van Rossum, a Dutch computer scientist, set himself a Christmas project. Irked[1] by shortcomings in other programming languages, he wanted to build his own. His principles were simple. First, it should be easy to read. Rather than sprawling over line-endings and being broken up by a tangle of curly braces[花括号], each chunk would be surrounded with indented white space[2].
1989年12月,荷兰的计算机科学家 Guido van Rossum 给自己创建了一个圣诞项目。不满于其它编程语言的缺点,他想要自己开发一种编程语言。他的原则很简单。首先,这个编程语言易读性要强。与其让程序语句末尾不断扩展,任由一团团花括号{}来区分代码块(搞得混乱不堪),最后他决定使用空格缩进来区分代码块。
[1]irk /ɜːk,ɝk/ (v.) If something irks you, it irritates or annoys you. 使···生气; 使···烦恼
The rehearsal process also irked him increasingly.
排练过程也更加让他厌烦。
[2]indented (印刷中)首行缩排的,(书写时的)首行缩格的。indented white space 缩进空白。
下文还出现了intended,注意区分 indent & intend:
○ indent作为动词表示:“〔书写时〕将〔行首〕缩格”to start a line of writing further towards the middle of the page than other lines;
○ intend则表示“打算,想要”If you intend to do something, you have decided or planned to do it.
注:易读性主要讲 Python 与其它编程语言的一个主要区别,在 Python 中模块和模块之间通常是用缩进来区分,而不像 C、Java 等其它语言,利用花括号{}等来区分,并且 C、Java 等必须以分号;作为语句的结束标识,Python中一般都不需要分号来标识。
- ◆ -
为了便于非专业童鞋理解,LR 从某本入门书上抠了一段 Python 代码如下:
大概就是长这样,最后四行,即所谓的「缩进」。
你可能很好奇,上面这几行代码能干嘛,满足你的好奇心,能画出下图这鬼东西来...
- ◆ -
Second, it should let users create their own packages of special-purpose coding modules, which could then be made available to others to form the basis of new programs. Third, he wanted a “short, unique and slightly mysterious” name. He therefore called it after Monty Python, a British comedy group. The package repository became known as the Cheese Shop.
第二,它应该让用户能够创建自己的专用编码模块包,并且这些模块可以被其他人用来形成新程序的基础。(即易于创建自己的模块包,且便于共享。)第三,他希望给这个语言起个简洁独特又略显神秘的名字。最终,他以英国喜剧团体 Monty Python 的名字将其命名为 Python 语言。程序模块仓库被人们称之为“奶酪店”。
Nearly 30 years after his Christmas invention, Mr Van Rossum resembles a technological version of the Monty Python character who accidentally became the Messiah in the film “Life of Brian”. “I certainly didn't set out to create a language that was intended for mass consumption,” he explains. But in the past 12 months Google users in America have searched for Python more often than for Kim Kardashian[金·卡戴珊], a reality-TV star. The rate of queries has trebled[3] since 2010, while inquiries after other programming languages have been flat or declining (see chart).
[3]treble /ˈtrɛbəl/ If something trebles or if you treble it, it becomes three times greater in number or amount than it was. 使增加两倍; 增加两倍
They will have to pay much more when rents treble in January.
房租1月份时将增加两倍,他们得付多得多的钱。
30 年后的今天,Van Rossum 发现自己无意中变成了电影《布莱恩的一生》中的弥赛亚。他说自己创造的语言肯定不是为大规模消费而设计的。但在过去一年中,美国用户在 Google 上搜索 Python 的频率比真人秀电视明星(reality-TV star)金·卡戴珊还要高。Python 语言的搜索率自 2010 以来增长了两倍,而其他编程语言的查询已趋于平缓或下降。
注:Life of Brian:《布莱恩的一生》也译为《万世魔星》,讲述在罗马统治下的巴勒斯坦,一个普通男人因为参与反罗马的地下组织而被误认为是弥赛亚(犹太人企盼的复国救主),并最终被施以十字架刑的滑稽故事。
The language's popularity has grown not merely among professional developers—nearly 40% of whom use it, with a further 25% wishing to do so, according to Stack Overflow, a programming forum—but also with ordinary folk. Codecademy, a website that has taught 45m novices[4] how to use various languages, says that by far the biggest increase in demand is from those wishing to learn Python. It is thus bringing coding to the fingertips of those once baffled[6] by the subject. Pythonistas[7], as aficionados[8] are known, have helped by adding more than 145,000 packages to the Cheese Shop*, covering everything from astronomy to game development.
[4]novice: A novice is someone who has been doing a job or other activity for only a short time and so is not experienced at it. 新手
I'm a novice at these things, Lieutenant. You're the professional.
在这些事情上我是一名新手,中尉。你是行家。
[6]baffle: If something baffles you, you cannot understand it or explain it. 使困惑
An apple tree producing square fruit is baffling experts.
一棵结方形果实的苹果树正令专家们感到困惑。
[7]Pythonistas:Someone who uses the Python programming language.指的就是使用Python的开发者。
[8]aficionado /ə,fisjə'nɑ:dəu/ ..迷,狂热爱好者
*注:the Cheese Shop指代的就是上文提到的the package repository.
(The package repository became known as the Cheese Shop.)
根据 Stack Overflow 的一项调查显示,Python 不仅在专业领域的使用率得到增长,在普通开发上的使用率也有所提升,有 40% 的受访者表示他们现在正在使用 Python,有 25% 的受访者表示希望学习 Python。Codecademy 是一个编程语言使用与教学网站,该网站表示,到目前为止,学习 Python 的需求增长最快。Python 开发者已经为这个世界贡献了 145,000 个安装包,涵盖从天文学到游戏开发的各大领域。
Mr Van Rossum, though delighted by this enthusiasm for his software, has come to find the rigours of supervising it, in his role as “benevolent dictator for life”, unbearable. He fears he has become something of an idol. “I'm uncomfortable with that fame,” he says, sounding uncannily[9] like Brian trying to drive away the crowds of disciples. “Sometimes I feel like everything I say or do is seen as a very powerful force.” On July 12th he resigned, leaving the Pythonistas to manage themselves.
[9]uncannily: 奇怪地;神秘地;难以(或无法)解释地
Van Rossum 虽然为此感到欣喜,但他发现作为终身仁慈独裁者的监督角色越来越难以忍受。他担心自己成为某种偶像,“我为名声所累”他说,听起来就像布莱恩试图赶走门徒一样。“有时候我觉得我所说的或做的每件事都被看作是一股强大的力量。” 7月12日,他辞职了,让 Python 社区的开发者们自我管理。
注:终身仁慈独裁者(Benevolent Dictator For Life,BDFL)是少数开源软件开发者所拥有的头衔。他们通常是某一项目的创始人,并在该项目社区出现争议时拥有最终的决定权。这一称号诞生于 1995 年,最初用来指 Python 语言的创始人吉多·范罗苏姆。——维基百科
7月12日,Python 之父 Guido van Rossum 表示,他将退出 Python 核心决策层。(I would like to remove myself entirely from the decision process.)
- ◆ -
此处略去N多段
- ◆ -
Not all Pythonistas are so ambitious, though. Zach Sims, Codecademy's boss, believes many visitors to his website are attempting to acquire skills that could help them in what are conventionally seen as “non-technical” jobs. Marketers, for instance, can use the language to build statistical models that measure the effectiveness of campaigns. College lecturers can check whether they are distributing grades properly. (Even journalists on The Economist, scraping the web for data, generally use programs written in Python to do so.)
并非所有的Python开发者都雄心勃勃,Codecademy的老板Zach Sims,认为很多网站访客都在试图掌握那些可以帮助他们在传统上被视为“非技术性”工作的技能。例如,营销人员可以使用 Python 建立统计模型来衡量活动的有效性。大学老师可以检查他们的成绩分布是否合理。即使是《经济学人》的记者,在网上爬取数据,通常也会使用 Python 编写的程序来实现这一目标。
- ◆ -
此处略去N多段
- ◆ -
How much longer Python's rise will continue is anybody's guess. There have been dominant computer languages in the past that, while not exactly “one with Nineveh and Tyre”, now skulk in the background. In the 1960s, Fortran bestrode[10] the world. As teaching languages for neophytes[11], both Basic and Pascal had their moments[12] in the sun. And Mr Partovi himself plumped for[12] JavaScript as the language for Code.org's core syllabus, since it remains the standard choice for animating web pages.
[10]bestride: To bestride something means to be the most powerful and important person or thing in it. 主宰
America's media companies bestride the globe.
美国的传媒公司主宰了全球。
[11]neophyte /'niəfaɪt/
someone who has just started to learn a particular skill, art, job etc 初学者;新手,对比上文出现的 novice 也是“新手”的意思。
[12]have your/its moments: to be sometimes very good or successful 也有成功的时候;也有得意的时候
This album may not be as good as their last one but it has its moments.
这张专辑可能不如他们上一张好,但也会火一阵。
[13]plump for (坚决地)选中;选定;挑选
At last we plumped for the new house near our school.
最终我们决定选学校附近的新房子。
Python 的崛起还将持续多久,所有人都在猜测。每个时期都会出现一门主导的语言,随之就会有另一门语言褪去主角光环。没有一门编程语言会成为人们的唯一追求。在 20 世纪 60 年代,Fortran 在世界范围内传播。作为新手的语言教学,Basic 和 Pascal 都有过其辉煌的时刻。Partovi 先生自己也选择 JavaScript 作为 Code.org 核心教学大纲的语言,因为它仍然是动画网页的标准选择。
注:Fortran, Basic, Pascal, JavaScript 都是不同的编程语言。
No computing language can ever be truly general purpose. Specialisation will necessarily remain important. It is nevertheless true that, in that long-past Yuletide[14], Mr Van Rossum started something memorable. He isn't the Messiah, but he was a very clever boy.
[14]Yuletide is the period of several days around and including Christmas Day. 圣诞节期间
任何计算语言都不可能仅仅是以通用为目的。专业化仍然很重要。然而,确实,在过去的圣诞潮中,Van Rossum先生的确创造了一些值得纪念的东西。他不是弥赛亚,但他是一个非常聪明的人。
This article appeared in the Science and technology section of the print edition under the headline "And now for something completely different" (Jul 19th 2018)
中文来源参考:开源中国 http://t.cn/ReLf5F1
ArthurGuo http://t.cn/Retqz0g
仅供参考,并非一一对应译文