Should I learn Python?

Discussion in 'Python' started by Sam, Nov 2, 2004.

  1. Sam

    Sam Guest

    Hi,
    I have been developing sites and cms's for the past few years using
    PHP and mysql. I've been interested in learning a new language and was
    considering Python. I have a pretty decent grasp of OOP concepts (i
    know, you're skeptical since I mentioned PHP). I don't have a formal
    programming background, just learning as I go.

    So, with that being said, here are some dumb questions.

    1. What can I do with Python that I can't do with php?

    2. Do you use both PHP and Python in conjunction with each other?

    3. In what way could I utilize Python to compliment existing sites or
    apps built with PHP?

    Thanks for any help.
     
    Sam, Nov 2, 2004
    #1
    1. Advertising

  2. Sam a écrit :
    > Hi,
    > I have been developing sites and cms's for the past few years using
    > PHP and mysql. I've been interested in learning a new language and was
    > considering Python. I have a pretty decent grasp of OOP concepts (i
    > know, you're skeptical since I mentioned PHP). I don't have a formal
    > programming background, just learning as I go.
    >
    > So, with that being said, here are some dumb questions.
    >
    > 1. What can I do with Python that I can't do with php?

    <troll>
    1/ Write clean, well structured, readable code,
    2/ Have Fun
    </troll>
    3/ Use Zope
    4/ Use Twisted
    5/ etc...

    > 2. Do you use both PHP and Python in conjunction with each other?

    No. I use PHP for legacy apps and really dumb scripting.

    > 3. In what way could I utilize Python to compliment existing sites or
    > apps built with PHP?

    a cgi is a cgi, whatever the language (php, perl, python, bash, C,
    COBOL, assembly....).

    > Thanks for any help.

    HTH
     
    bruno modulix, Nov 2, 2004
    #2
    1. Advertising

  3. Sam

    Roy Smith Guest

    bruno modulix <> wrote:
    > > 3. In what way could I utilize Python to compliment existing sites or
    > > apps built with PHP?

    > a cgi is a cgi, whatever the language (php, perl, python, bash, C,
    > COBOL, assembly....).


    But there's a lot more to web applications than CGI.
     
    Roy Smith, Nov 3, 2004
    #3
  4. Sam

    M. Bitner Guest

    On 2 Nov 2004 13:28:22 -0800, Sam <> wrote:
    > Hi,
    > I have been developing sites and cms's for the past few years using
    > PHP and mysql. I've been interested in learning a new language and was
    > considering Python. I have a pretty decent grasp of OOP concepts (i
    > know, you're skeptical since I mentioned PHP). I don't have a formal
    > programming background, just learning as I go.
    >
    > So, with that being said, here are some dumb questions.
    >
    > 1. What can I do with Python that I can't do with php?
    >
    > 2. Do you use both PHP and Python in conjunction with each other?
    >
    > 3. In what way could I utilize Python to compliment existing sites or
    > apps built with PHP?
    >
    > Thanks for any help.
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >


    Learning Python would be an excellent next step in your development.
    Most programming textbooks recommend you learn at least one new
    language a year. Python is a clean, well designed language and should
    be straightforward (and fun) for you to learn.

    But to answer your questions:
    1. PHP is a web scripting language and Python is a general purpose
    scripting language. You can use PHP outside of a web environment but
    that really isn't its strong point. You can use Python pretty much
    anywhere.

    2. No. Where I work we have one internal app written in PHP but are
    moving towards developing exclusively in Python. We have thought about
    potentially using PHP for the presentation layer and Python for the
    business logic but haven't gotten that far yet.

    3. Where do you need it? If PHP works for your site then Python may
    not be a necessary addition.

    HTH,
    Melissa
     
    M. Bitner, Nov 3, 2004
    #4
  5. > 1. What can I do with Python that I can't do with php?

    Python is a much cleaner. Its design was well thought-out, with very
    good support of OOP (something which has been problematic in PHP 4).
    Also, several features in Python make sure you write clean code with it,
    something that is very much lacking in PHP. Finally, the library in
    Python is cleanly separated and easily extensible.

    > 2. Do you use both PHP and Python in conjunction with each other?


    I've used PHP a lot, but I'm currently moving all development effort to
    Python. For some projects, I think combined use could be useful (e.g. to
    setup a web service of which one side is easier to do in Python, while
    the other side would be easier to do in PHP).

    > 3. In what way could I utilize Python to compliment existing sites or
    > apps built with PHP?


    This depends on the way your applications are written. My PHP
    applications are always embedded in a framework I wrote myself, and this
    would make it hard to effectively extend the application in Python.

    Regards,

    Dirkjan
     
    Dirkjan Ochtman, Nov 3, 2004
    #5
  6. Am Tue, 02 Nov 2004 13:28:22 -0800 schrieb Sam:

    > Hi,
    > I have been developing sites and cms's for the past few years using
    > PHP and mysql. I've been interested in learning a new language and was
    > considering Python. I have a pretty decent grasp of OOP concepts (i
    > know, you're skeptical since I mentioned PHP). I don't have a formal
    > programming background, just learning as I go.
    >
    > So, with that being said, here are some dumb questions.
    >
    > 1. What can I do with Python that I can't do with php?


    AFAIK there is no object database like ZODB (or Durus) for php.

    > 2. Do you use both PHP and Python in conjunction with each other?


    No. Only python, a little shell (bash) and calling external programms with
    os.system or popen.

    Thomas
     
    Thomas Guettler, Nov 3, 2004
    #6
  7. Sam

    Sam Guest

    So you're saying, in order to write smart, clean, well structured,
    readable code, and have fun doing so, I'm going to have to drop PHP
    and use Python?

    I'm not really interested in finding a replacement for PHP, it works
    just fine for me.

    I apologize for not phrasing my questions clearly, I wasn't looking
    for critisisms of PHP or why I shouldn't use it. What i'm really
    after, is given that I use PHP to develop sites currently, what types
    of situations would/could i use Python in web development? Is there a
    point when learning Python, that I'll say to myself "why use php?".
    Thanks
     
    Sam, Nov 3, 2004
    #7
  8. Sam wrote:

    > Should I learn Python?


    I think learning a new langauge every once in while can be
    extremely beneficial even if one does not actually
    switch to it

    > 1. What can I do with Python that I can't do with php?


    You cannot write Python code in php.

    > 2. Do you use both PHP and Python in conjunction with each other?


    No and probably very few do.

    > 3. In what way could I utilize Python to compliment existing sites or
    > apps built with PHP?


    Implementing more complex algorithms is a lot easier with python.
    You still need a way to interface between the two though.

    Istvan.
     
    Istvan Albert, Nov 3, 2004
    #8
  9. Sam wrote:

    > So you're saying, in order to write smart, clean, well structured,
    > readable code, and have fun doing so, I'm going to have to drop PHP
    > and use Python?


    well yeah,

    but of course it all depends on the complexity of the problem that
    you have to solve.

    A simple functionality, can be made into a clean, well structured readable code even
    in say C shell, (I recently had to use bash, I totally forgot how frustrating and
    rigid language it is ...)

    Istvan.
     
    Istvan Albert, Nov 3, 2004
    #9
  10. In article <>,
    Sam <> wrote:
    >So you're saying, in order to write smart, clean, well structured,
    >readable code, and have fun doing so, I'm going to have to drop PHP
    >and use Python?
    >
    >I'm not really interested in finding a replacement for PHP, it works
    >just fine for me.
    >
    >I apologize for not phrasing my questions clearly, I wasn't looking
    >for critisisms of PHP or why I shouldn't use it. What i'm really
    >after, is given that I use PHP to develop sites currently, what types
    >of situations would/could i use Python in web development? Is there a
    >point when learning Python, that I'll say to myself "why use php?".
    >Thanks


    If you're happy with PHP, you'll likely stay with PHP, until you
    run into an off-beat capability (Expect? scientific/numeric
    programming? Does PHP build-in LDAPv3 awareness? UDP? SNMP?)
    that you both need and that PHP makes painful.
     
    Cameron Laird, Nov 3, 2004
    #10
  11. Sam

    Larry Bates Guest

    I also learned PHP first, but have been very happy that I
    moved to Python. The OOP capabilities are no comparison
    (e.g. Python is better IMHO). It is the richness of the
    standard library and add-ons that make Python a good choice.
    Things like ReportLab, Python Imaging Library, SMTP, FTP,
    URLlib, etc.

    One of my recent sites used PHP for front-end UI and Python
    for backend database processing. The combination worked well
    for that client. I still think that if I did it today, I would
    do it all in Python, but the combination worked well. The UI
    was not complex so I did it in PHP very quickly.

    One very big difference is that I can do more DIFFERENT things
    in Python than PHP. I can write standalone programs with Python
    using wxWindows, etc. I've written COM objects, Windows Services,
    plain scripts, programs that manipulate the Windows Registry,
    programs that modify the NT user database, you name it. These
    types of programs just don't make sense in PHP. I find that I
    am able to learn one language very well instead of VB for GUI
    apps, C/C++ for services/COM objects, PHP for web applications, ...

    Python just addresses a wider landscape over more different
    platforms for me.

    Larry Bates
    Syscon, Inc.


    Sam wrote:
    > Hi,
    > I have been developing sites and cms's for the past few years using
    > PHP and mysql. I've been interested in learning a new language and was
    > considering Python. I have a pretty decent grasp of OOP concepts (i
    > know, you're skeptical since I mentioned PHP). I don't have a formal
    > programming background, just learning as I go.
    >
    > So, with that being said, here are some dumb questions.
    >
    > 1. What can I do with Python that I can't do with php?
    >
    > 2. Do you use both PHP and Python in conjunction with each other?
    >
    > 3. In what way could I utilize Python to compliment existing sites or
    > apps built with PHP?
    >
    > Thanks for any help.
     
    Larry Bates, Nov 3, 2004
    #11
  12. Sam

    Terry Reedy Guest

    If you have not, I suggest that you spend about 2 hours reading through the
    Python tutorial. The should be enough to experience whether Python grabs
    you, the way it has some of us, or repels you, as it has others.

    tjr
     
    Terry Reedy, Nov 3, 2004
    #12
  13. Sam wrote:
    > So you're saying, in order to write smart, clean, well structured,
    > readable code, and have fun doing so, I'm going to have to drop PHP
    > and use Python?


    Err... You might not have notice, but this was enclosed in a <troll> tag !-)

    You can of course write smart, clean, well structured, readable code in
    PHP - it's just that's it's easier and more fun (IMVHO) to do so in Python.

    > I'm not really interested in finding a replacement for PHP, it works
    > just fine for me.
    >
    > I apologize for not phrasing my questions clearly, I wasn't looking
    > for critisisms of PHP or why I shouldn't use it.


    I apologize for being a troll.

    > What i'm really
    > after, is given that I use PHP to develop sites currently, what types
    > of situations would/could i use Python in web development?


    Well, there's no exact answer to this question. It's not a matter of raw
    functionnalities, PHP has it all (or almost, but well...). What Python
    has to offer is :
    - the language itself, which is IMHO cleaner, smarter and more fun
    - frameworks or application servers like Zope, Twisted, Nevow etc

    Zope is somewhat not easy to 'get into', but it's worth the effort, and
    you can experience productivity gain even on the first project (well...
    I did at least).


    > Is there a
    > point when learning Python, that I'll say to myself "why use php?".


    Depends on you. I personnally still use PHP for quick&dumb stuffs like
    includes, simple forms etc., cause Python itself would not buy me
    anything for such things and using Zope would be overkill.


    > Thanks

    You're welcome (and please forgive my trollness)
    Bruno
     
    Bruno Desthuilliers, Nov 4, 2004
    #13
  14. Sam

    Sam Guest

    Thanks Bruno,
    No need to apologize, just thought maybe I wasn't being clear, thanks
    for your insight
     
    Sam, Nov 4, 2004
    #14
  15. Sam

    Y2KYZFR1 Guest

    (Sam) wrote in message news:<>...
    > So you're saying, in order to write smart, clean, well structured,
    > readable code, and have fun doing so, I'm going to have to drop PHP
    > and use Python?
    >
    > I'm not really interested in finding a replacement for PHP, it works
    > just fine for me.
    >
    > I apologize for not phrasing my questions clearly, I wasn't looking
    > for critisisms of PHP or why I shouldn't use it. What i'm really
    > after, is given that I use PHP to develop sites currently, what types
    > of situations would/could i use Python in web development? Is there a
    > point when learning Python, that I'll say to myself "why use php?".
    > Thanks


    learn python and you will answer your own question, php is just about
    1 rung above perl in maintainability
     
    Y2KYZFR1, Nov 16, 2004
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Porky Pig Jr
    Replies:
    3
    Views:
    1,065
    Fuzzyman
    May 12, 2004
  2. fyleow

    Should I learn Python instead?

    fyleow, Apr 14, 2006, in forum: Python
    Replies:
    7
    Views:
    420
    Lawrence Oluyede
    Apr 17, 2006
  3. CoreyWhite
    Replies:
    1
    Views:
    665
    JohnQ
    Mar 31, 2007
  4. windandwaves

    why should I learn python

    windandwaves, Sep 6, 2007, in forum: Python
    Replies:
    34
    Views:
    766
    HowiPepper
    Sep 11, 2007
  5. Alexander
    Replies:
    20
    Views:
    1,060
    BGB / cr88192
    Sep 11, 2010
Loading...

Share This Page