V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
AndyAO
V2EX  ›  随想

雅俗共赏的 Python

  •  
  •   AndyAO · 2021-12-10 10:57:36 +08:00 · 1457 次点击
    这是一个创建于 839 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有些语言大公司用得比较多,比较适合规模较大的团队协同作战;有的语言小公司和极客用得比较多。

    很多时候这两群人还互相鄙视,码农们认为极客的玩具语言在大项目上派不上用场;极客们认为码农都是些二流程序员,为了混口饭吃不得不用那么蹩脚的东西,之所以团队那么大,就是因为用的工具太烂,效率太低,只能抱团取暖。[^1][^2]

    在 Quora 提出过这样的观点,没有什么人反对,大家都认为确实有这种现象的存在。

    当时自己认为 Python 是码农语言而不是极客语言,这个倒是遭到了很多反对。

    最近突然想起这个事情了,感觉 Python 或许是有些特别吧,它在语法的灵活性还是偏向于团队语言的,没有什么语法糖,对编程风格有明确的要求,这都利于协作;但它又是多范式的动态语言,代码写起来比较容易,不怎么啰嗦。

    这可能就是这家伙这么受欢迎的原因吧,算是雅俗共赏的。

    这类话题实际上没啥太多的营养,很多事情其实自己也不太清楚,只是模模糊糊的有些印象,不过没事的时候想想挺有趣的。

    [^1]:Guido: I’ve heard of research as well as anecdotal evidence indicating that the error rate per number of lines of code is pretty consistent, regardless of the programming language used. So a language like Python where a typical application is just much smaller than, say, the same amount of functionality written in C++ or Java, would make that application much more maintainable. Of course, this is likely going to mean that a single programmer is responsible for more functionality. That’s a separate issue, but it still comes out in favor of Python: more productivity per programmer probably means fewer programmers on a team, which means less communication overhead, which according to The Mythical Man-Month Guido:我听说有研究和轶事证据表明,无论使用何种编程语言,每行代码的错误率都是相当一致的。因此,像 Python 这样的语言,其中一个典型的应用程序比在 C++或 java 中编写的相同数量的函数要小得多,这将使应用程序更易于维护。当然,这可能意味着单个程序员负责更多的功能。这是一个单独的问题,但它仍然支持 Python:每个程序员的生产率越高,可能意味着团队中的程序员越少,这意味着通信开销越少,这是根据神话般的人月理论得出的结论

    [^2]:Guido: Enterprise-friendly is usually when the really smart people lose interest and the people of more mediocre skills have to somehow fend for themselves. I don’t know if Python is harder to use for mediocre people. In a sense you would think that there is quite a bit of damage you cannot do in Python because it’s all interpreted. On the other hand, if you write something really huge and you don’t use enough unit testing, you may have no idea what it actually does. Guido:对企业友好通常是指真正聪明的人失去兴趣,而技能更平庸的人不得不以某种方式照顾自己。我不知道 Python 对于平庸的人来说是否更难使用。从某种意义上讲,您可能会认为 Python 中有相当多的破坏是无法做到的,因为它都是经过解释的。另一方面,如果你写了一些非常庞大的东西,而你没有使用足够的单元测试,你可能不知道它实际上做了什么。

    AndyAO
        1
    AndyAO  
    OP
       2021-12-10 10:59:54 +08:00
    Guido 是 CPython 项目负责人,它的话出自《 Masterminds of Programming: Conversations with the Creators of Major Programming Languages 》,后面的中文是谷歌机翻的。
    whileFalse
        2
    whileFalse  
       2021-12-10 17:28:46 +08:00 via iPhone
    所以什么是典型的极客语言?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1062 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 22:43 · PVG 06:43 · LAX 15:43 · JFK 18:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.