注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

蜻蜓点水 举重若轻

君子终日乾乾

 
 
 

日志

 
 

Python 悖论 (The Python Paradox)

2006-10-31 12:25:15|  分类: Python |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
我并没有 "Java 程序员何其盲目" 的意思, 我只想说 Python 程序员是很聪明的。学一种新的编程语言要花点工夫。而人们不会因为 Python 会给他们带来一份工作而去学它; 他们学 Python 只是因为他们率真地喜欢编程, 而目前以知的编程语言都不能使他们满足。

Google 了一下

Google 了一下 Python。掏到一篇老文章, 徐永久老大在很久以前就推荐过, E 文的。

这是一篇挺不错的文章, 但是好像没有翻译的版本。时隔多年, 这是一个比较闲的下午, 顺便就译下来。译完之后发现韵味全失, 这才发现为什么当年没有人来翻译这篇文章了(当然也不是特别闲, 译得很匆忙, 如果还在大学里做学问, 相信我肯定能译得漂亮, 呵呵)。

所 以还是推荐大家来读原文。对于一个铁杆 Python 玩家来说, 这是一篇令人热血沸腾的文章。对于骨灰级玩家来说, 看到 "A friend of mine who ..." 这段文字, 肯定会联想起四五年前那段激情岁月, Python 在国内甚者国外都无人问津、Java/C++/VB/PHP 大行其道的年头, 毅然选择了 Python 其中原因仅仅是 " likes the way source code looks" 这样近似开玩笑的理由, 我相信很多人会会心一笑, 酸甜苦辣, 一切尽在不言中……


Python 悖论

2004 年 8 月 (沈崴翻译于 2006 年 3 月 23 日)

日前, 我提到以 Python 工作的程序员要比使用 Java 工作的程序员聪明。大家也许会有点疑惑吧。

我 并没有 "Java 程序员何其盲目" 的意思, 我只想说 Python 程序员是很聪明的。学一种新的编程语言要花点工夫。而人们不会因为 Python 会给他们带来一份工作而去学它; 他们学 Python 只是因为他们率真地喜欢编程, 而目前以知的编程语言都不能使他们满足。

这 使得这种程序员成为软件公司心目中最理想的雇员。介于此, 目前还没有一个更好的词, 我姑且叫它 Python 悖论: 如果公司选择使用十分巧妙的语言来编写他的软件, 他能雇到良好的程序员, 因为他们对那些对学习这门(设计巧妙)语言有兴趣的人总有足够吸引力。然后正如这个悖论所提到的那类程序员: 学习一种编程语言, 如果你是指望用来混到一个工作, 这种语言仅仅是得到这们工作的敲门砖而已。

只有不多的公司能够明智地认识到这点。当然这里还有另一种可能使之得到相同的效果, 就是公司里的程序员都非常热爱他们的编程工作而使他们一拍即合。Google, 举个例子。当他们刊登招聘 Java 程序员的广告时, 同样要求有 Python 的编程经历。

我 有一个懂得几乎所有编程语言的朋友, 他用 Python 来做几乎所有的项目。他说主要原因在于他喜欢 Python 源代码看上去的样子。对于选择一种语言而不是另一种, 这是一个看似轻佻的理由。但它没有它听上去那么卤莽: 当你编程时, 比起书写代码你得花更多的时间去阅读它们。你如同雕塑家一样将泥放到的艺术品上, 你的代码被一行一行地加上去。因此代码不那么好看的编程语言会让严谨的程序员抓狂, 如同雕塑家看到一个充满瑕疵的作品一样。

既然提到了 丑陋的源代码, 许多人理所当然地会认为这是 Perl。但是 Perl 代码所谓的丑陋只是浮于表面的现象, 并不是我所说的那种丑类的类型。真正的丑陋不是肤浅地从语法上来评判, 而是你被迫基于一种错误的观念来架构你的程序。Perl 也许看上去象一堆由卡通字符串组成的咒语, 但是这里有许多案例来证明他有比 Python 更先进的理念。

迄今为止, 不管怎么说。这两种语言尽管设计的目标不同, 但是它们, 包括 Ruby (以及 Icon, Joy, J, Lisp, 和 Smalltalk) 都是为那些真正关心程序的人创建并给他们使用的。这是事实。这种程序员总会试图去做得更好。



The Python Paradox

August 2004 (原文地址: http://www.paulgraham.com/pypar.html)

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.

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.

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.

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.

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.

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.
  评论这张
 
阅读(1917)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017