V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
anyforever
V2EX  ›  Python

还没用过python,想请教下livid,为何从PHP转向这个了?

  •  
  •   anyforever · 2011-05-05 22:50:26 +08:00 · 7052 次点击
    这是一个创建于 4733 天前的主题,其中的信息可能已经有所发展或是发生改变。
    这两个有什么区别,python有什么更好的优势么?
    18 条回复    1970-01-01 08:00:00 +08:00
    chone
        1
    chone  
       2011-05-05 22:57:31 +08:00
    @livid 转用python貌似是因为gae不支持php
    kongruxi
        2
    kongruxi  
       2011-05-05 22:58:57 +08:00
    据网络上一些人的言论
    PHP: dirty but quick
    python: 优雅

    两个我都没有学习,所以给不了意见
    dementrock
        3
    dementrock  
       2011-05-05 23:02:03 +08:00
    两个都简单接触过
    PHP语法真的太奇葩了
    相比之下python用起来真的很爽
    anyforever
        4
    anyforever  
    OP
       2011-05-05 23:14:07 +08:00
    @chone sae支持
    另两位兄弟说python优雅、还爽,看来有必要去探索一下哈~
    fanzeyi
        5
    fanzeyi  
       2011-05-05 23:35:20 +08:00
    @anyforever SAE敢信嘛
    Paranoid
        6
    Paranoid  
       2011-05-05 23:41:46 +08:00
    应该先搜索下论坛。

    优雅不如上ROR。

    PHP好一点的框框也不则呢么dirty。

    python的缩进无法忍的人飘过。
    chone
        7
    chone  
       2011-05-06 08:05:41 +08:00
    @anyforever 据某分调查python是最受欢迎的周末语言,也就是程序员最喜欢在业余使用的语言。
    istef
        8
    istef  
       2011-05-06 08:42:50 +08:00
    我想对于 @livid 来说 GAE 不支持 PHP 应该是他倒向 Python 的一个原因,至少是诸多原因的一个。当然 Python 学习起来也不困难,虽然括号变缩进了最开始要稍微适应一下。。。。
    至于代码优雅程度,其实 PHP 弄个好点儿的框架写出来的代码也很易读很容易维护,强烈推荐 CodeIgniter
    fengluo
        9
    fengluo  
       2011-05-06 09:25:29 +08:00
    @istef 我在用CI做项目,不过还是无法忍受PHP的语法⋯⋯更喜欢Python的优雅。那种简练的语法让人享受啊。
    iiduce
        10
    iiduce  
       2011-05-06 09:25:52 +08:00
    我在完全未接触python之前,是因为看到了两段话:
    1. The Zen of Python

    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than complicated.
    Flat is better than nested.
    Sparse is better than dense.
    Readability counts.
    Special cases aren't special enough to break the rules.
    Although practicality beats purity.
    Errors should never pass silently.
    Unless explicitly silenced.
    In the face of ambiguity, refuse the temptation to guess.
    There should be one-- and preferably only one --obvious way to do it.
    Although that way may not be obvious at first unless you're Dutch.
    Now is better than never.
    Although never is often better than *right* now.
    If the implementation is hard to explain, it's a bad idea.
    If the implementation is easy to explain, it may be a good idea.
    Namespaces are one honking great idea -- let's do more of those!


    2. 人生苦短,我用python

    然后后来的学习中,一直在体验这些话,感觉并不是瞎掰。也可能我先入为主了。
    istef
        11
    istef  
       2011-05-06 12:36:58 +08:00
    @fengluo 这个我同意,其实我感觉 PHP 不是语法不够简练,是很多函数都不统一,即使做了很久 PHP 开发还是离不开手册
    seerhut
        12
    seerhut  
       2011-05-06 12:59:23 +08:00
    python实在太全能了,可以做脚本,可以做server的app,可以做科学计算,可以做系统管理,自然语言处理。。。和php处理的问题域不是一个数量级的。
    fim8
        13
    fim8  
       2011-05-06 13:54:24 +08:00
    但是现在靠PYTHON开发养活自己的又有多少呢?
    qichangxing
        14
    qichangxing  
       2011-05-07 04:42:39 +08:00
    最主要的因为 GAE,无须为运维而烦恼。
    ayanamist
        15
    ayanamist  
       2011-05-07 09:38:36 +08:00
    @fim8 很多的,只是国内不是很流行,主要是部署上没有PHP方便,不过选择余地也比PHP大,除了FastCGI,还有WSGI,HTTP,mod_python等等
    alsotang
        16
    alsotang  
       2011-09-10 23:08:28 +08:00
    @iiduce 之前学python看了这个zen,不过感触不深。后来对比了c++或者php之类的语言,发现python确实真的遵循了这些原则。优雅得无可比拟。
    kojp
        17
    kojp  
       2011-11-17 23:22:27 +08:00
    @kongruxi

    我感觉php一点都不quick呀~~~~

    python 效率,我还真是感觉很爽的。。。
    Ricepig
        18
    Ricepig  
       2011-11-17 23:55:32 +08:00
    Python除了I18n不优雅,其他语言层面上的优雅性还是要高出php一筹的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   906 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 21:07 · PVG 05:07 · LAX 14:07 · JFK 17:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.