「经济学人」谈Python:它会是我们的未来吗?

上周「经济学人」发表了一篇文章谈论了编程语言 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

仅供参考,并非一一对应译文



©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,386评论 6 506
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,142评论 3 394
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,704评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,702评论 1 294
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,716评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,573评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,314评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,230评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,680评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,873评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,991评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,706评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,329评论 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,910评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,038评论 1 270
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,158评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,941评论 2 355

推荐阅读更多精彩内容