Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
I use Python and Django extensively, and think they're both great. That said, also great is the very funny keynote by former flickr engineer Cal Henderson at DjangoCon 2008, titled Why I Hate Django, which is on YouTube: http://www.youtube.com/watch?v=i6Fr65PFqfk When he showed the slide I had to admit that the statement -.join(array) is kind of a goofy way to do that, though maybe not unforgivable. Whenever I use join() now I chuckle a little in my mind. It's good to step back and re-evaluate your favorite tools from time-to-time. If nothing else, the ability to analyze a platform for its suitability to a need is key. Will On Oct 28, 2010, at 9:38 AM, Thomas Bennett wrote: Having used Zope (python based) as our WEB server of choice since 1998 I am urged to express my opinion that if you do choose to use python in your projects then use a service designed for python use such as Zope, Django, et al. Zope is normally run in front of Apache as a virtual host. If you are going to use python then Zope is an excellent choice for interacting with databases and using python to massage/manipulate results if you need complex results from the database data. I like that you can write sql queries just like you might use on the command line and save it as an individual object for use by any number of other objects. What may be a simple example to some is a tutorial quiz I wrote for the WEB. There are categories and each category has any number of questions along with the answers in the database. In the management portion, the administrator can choose which categories are active and how many questions out of the total available to pull from each category individually. When the quiz page is generated the correct number of questions are pulled randomly from the total active questions for each category, some questions can be set as inactive. There are database connectors for PostgreSQL, MySQL, Oracle, odbc, and others so you can choose any popular db or write your own connector. And there are python libraries written for these databases which prove very useful. The main thing I like about python is that the syntax pretty much forces your code to be readable by others because indention is part of the syntax rather than semicolons, parens, etc. I don't know PHP in detail but am learning more quickly because the University is forcing all departments to move to Drupal and we will be running our site on Drupal within a year probably although some administrative tasks will still be running on our Zope server. Thomas ps: remember my point is that IF you choose to use python this supports its use with databases and scripting. On Wednesday 27 October 2010 20:49:06 you wrote: Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting-language, programming language, real-time, half-time, bytecoded, virtual, etc.). Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. I was referring to the ray-tracing part. It is also the most important scripting language in large scale CGI settings Yes, Python is widely used for scripting up interfaces into other more complex systems. But rarely is the core of the thing written entirely in Python. Maybe your Google-foo is weak. :) Or maybe he's just realizing that outside of server side web scripting, PHP is just not so widely used. Absolutely, and fair enough. Having used both languages, I discovered that Python is easier for most tasks, and one reason is that the libraries that come with Python are extremely robust, well tested and consistent. Hmm. PHP is extremely robust and well-tested, but yes, it's not all that consistent, especially not before version 5.2+. However, things have moved on, and with release 6 around the corner things will be tighter still. Just like the first versions of Python were interesting, so was PHP's, but where the biggest problem with the evolution of PHP was the very fact that it was the most popular language for rapid web development by far. PHP is very practical for server-side web scripting, but it's libraries are unfortunately full of gotchas, traps and unexpected behaviour. There's gotchas in every language, even Python. A key reason for that is the fact that Python has always had an exception-handling mechanism while PHP has grown something like that only a few
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
I think the significant attributes of most programming languages are adequately summarized here: http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html From: Code for Libraries [code4...@listserv.nd.edu] on behalf of William Sexton [will.sex...@duke.edu] Sent: Friday, October 29, 2010 7:24 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] PHP vs. Python [was: Re: Django] I use Python and Django extensively, and think they're both great. That said, also great is the very funny keynote by former flickr engineer Cal Henderson at DjangoCon 2008, titled Why I Hate Django, which is on YouTube: http://www.youtube.com/watch?v=i6Fr65PFqfk When he showed the slide I had to admit that the statement -.join(array) is kind of a goofy way to do that, though maybe not unforgivable. Whenever I use join() now I chuckle a little in my mind. It's good to step back and re-evaluate your favorite tools from time-to-time. If nothing else, the ability to analyze a platform for its suitability to a need is key. Will On Oct 28, 2010, at 9:38 AM, Thomas Bennett wrote: Having used Zope (python based) as our WEB server of choice since 1998 I am urged to express my opinion that if you do choose to use python in your projects then use a service designed for python use such as Zope, Django, et al. Zope is normally run in front of Apache as a virtual host. If you are going to use python then Zope is an excellent choice for interacting with databases and using python to massage/manipulate results if you need complex results from the database data. I like that you can write sql queries just like you might use on the command line and save it as an individual object for use by any number of other objects. What may be a simple example to some is a tutorial quiz I wrote for the WEB. There are categories and each category has any number of questions along with the answers in the database. In the management portion, the administrator can choose which categories are active and how many questions out of the total available to pull from each category individually. When the quiz page is generated the correct number of questions are pulled randomly from the total active questions for each category, some questions can be set as inactive. There are database connectors for PostgreSQL, MySQL, Oracle, odbc, and others so you can choose any popular db or write your own connector. And there are python libraries written for these databases which prove very useful. The main thing I like about python is that the syntax pretty much forces your code to be readable by others because indention is part of the syntax rather than semicolons, parens, etc. I don't know PHP in detail but am learning more quickly because the University is forcing all departments to move to Drupal and we will be running our site on Drupal within a year probably although some administrative tasks will still be running on our Zope server. Thomas ps: remember my point is that IF you choose to use python this supports its use with databases and scripting. On Wednesday 27 October 2010 20:49:06 you wrote: Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting-language, programming language, real-time, half-time, bytecoded, virtual, etc.). Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. I was referring to the ray-tracing part. It is also the most important scripting language in large scale CGI settings Yes, Python is widely used for scripting up interfaces into other more complex systems. But rarely is the core of the thing written entirely in Python. Maybe your Google-foo is weak. :) Or maybe he's just realizing that outside of server side web scripting, PHP is just not so widely used. Absolutely, and fair enough. Having used both languages, I discovered that Python is easier for most tasks, and one reason is that the libraries that come with Python are extremely robust, well tested and consistent. Hmm. PHP is extremely robust and well-tested, but yes, it's not all that consistent, especially not before version 5.2+. However, things have moved on, and with release 6 around the corner things will be tighter still. Just like the first versions of Python were interesting, so was PHP's, but where the biggest problem with the evolution of PHP was the very fact that it was the most popular
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
Have people found Django fairly usable without using its ORM features? I'm not a big ORM fan, and it seems that so many Python frameworks sort of fall over if you try to get around the ORM. It's a bit of a shame, because I like Python. I wish Bottle and Flask were a little easier to work with. It feels a little weird having to configure WSGI for each application. I love their minimalist approach to templating, though. Mark On Oct 29, 2010, at 4:14 PM, Genny Engel wrote: I think the significant attributes of most programming languages are adequately summarized here: http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html From: Code for Libraries [code4...@listserv.nd.edu] on behalf of William Sexton [will.sex...@duke.edu] Sent: Friday, October 29, 2010 7:24 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] PHP vs. Python [was: Re: Django] I use Python and Django extensively, and think they're both great. That said, also great is the very funny keynote by former flickr engineer Cal Henderson at DjangoCon 2008, titled Why I Hate Django, which is on YouTube: http://www.youtube.com/watch?v=i6Fr65PFqfk When he showed the slide I had to admit that the statement -.join(array) is kind of a goofy way to do that, though maybe not unforgivable. Whenever I use join() now I chuckle a little in my mind. It's good to step back and re-evaluate your favorite tools from time- to-time. If nothing else, the ability to analyze a platform for its suitability to a need is key. Will On Oct 28, 2010, at 9:38 AM, Thomas Bennett wrote: Having used Zope (python based) as our WEB server of choice since 1998 I am urged to express my opinion that if you do choose to use python in your projects then use a service designed for python use such as Zope, Django, et al. Zope is normally run in front of Apache as a virtual host. If you are going to use python then Zope is an excellent choice for interacting with databases and using python to massage/manipulate results if you need complex results from the database data. I like that you can write sql queries just like you might use on the command line and save it as an individual object for use by any number of other objects. What may be a simple example to some is a tutorial quiz I wrote for the WEB. There are categories and each category has any number of questions along with the answers in the database. In the management portion, the administrator can choose which categories are active and how many questions out of the total available to pull from each category individually. When the quiz page is generated the correct number of questions are pulled randomly from the total active questions for each category, some questions can be set as inactive. There are database connectors for PostgreSQL, MySQL, Oracle, odbc, and others so you can choose any popular db or write your own connector. And there are python libraries written for these databases which prove very useful. The main thing I like about python is that the syntax pretty much forces your code to be readable by others because indention is part of the syntax rather than semicolons, parens, etc. I don't know PHP in detail but am learning more quickly because the University is forcing all departments to move to Drupal and we will be running our site on Drupal within a year probably although some administrative tasks will still be running on our Zope server. Thomas ps: remember my point is that IF you choose to use python this supports its use with databases and scripting. On Wednesday 27 October 2010 20:49:06 you wrote: Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting-language, programming language, real-time, half-time, bytecoded, virtual, etc.). Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. I was referring to the ray-tracing part. It is also the most important scripting language in large scale CGI settings Yes, Python is widely used for scripting up interfaces into other more complex systems. But rarely is the core of the thing written entirely in Python. Maybe your Google-foo is weak. :) Or maybe he's just realizing that outside of server side web scripting, PHP is just not so widely used. Absolutely, and fair enough. Having used both languages, I discovered that Python
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
Mark- I would highly recommend looking at Tornado (http://www.tornadoweb.org) as an alternative to using Django without the ORM. It provides URL dispatch and templating capabilities without commitment to a particular storage model, and is fast in standalone use, without requiring extra scaffolding like WSGI. It has been an extremely productive framework for me. - BPA Bradley P. Allen http://bradleypallen.org On Fri, Oct 29, 2010 at 1:30 PM, Mark Tomko mark.to...@simmons.edu wrote: Have people found Django fairly usable without using its ORM features? I'm not a big ORM fan, and it seems that so many Python frameworks sort of fall over if you try to get around the ORM. It's a bit of a shame, because I like Python. I wish Bottle and Flask were a little easier to work with. It feels a little weird having to configure WSGI for each application. I love their minimalist approach to templating, though. Mark On Oct 29, 2010, at 4:14 PM, Genny Engel wrote: I think the significant attributes of most programming languages are adequately summarized here: http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html From: Code for Libraries [code4...@listserv.nd.edu] on behalf of William Sexton [will.sex...@duke.edu] Sent: Friday, October 29, 2010 7:24 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] PHP vs. Python [was: Re: Django] I use Python and Django extensively, and think they're both great. That said, also great is the very funny keynote by former flickr engineer Cal Henderson at DjangoCon 2008, titled Why I Hate Django, which is on YouTube: http://www.youtube.com/watch?v=i6Fr65PFqfk When he showed the slide I had to admit that the statement -.join(array) is kind of a goofy way to do that, though maybe not unforgivable. Whenever I use join() now I chuckle a little in my mind. It's good to step back and re-evaluate your favorite tools from time-to-time. If nothing else, the ability to analyze a platform for its suitability to a need is key. Will On Oct 28, 2010, at 9:38 AM, Thomas Bennett wrote: Having used Zope (python based) as our WEB server of choice since 1998 I am urged to express my opinion that if you do choose to use python in your projects then use a service designed for python use such as Zope, Django, et al. Zope is normally run in front of Apache as a virtual host. If you are going to use python then Zope is an excellent choice for interacting with databases and using python to massage/manipulate results if you need complex results from the database data. I like that you can write sql queries just like you might use on the command line and save it as an individual object for use by any number of other objects. What may be a simple example to some is a tutorial quiz I wrote for the WEB. There are categories and each category has any number of questions along with the answers in the database. In the management portion, the administrator can choose which categories are active and how many questions out of the total available to pull from each category individually. When the quiz page is generated the correct number of questions are pulled randomly from the total active questions for each category, some questions can be set as inactive. There are database connectors for PostgreSQL, MySQL, Oracle, odbc, and others so you can choose any popular db or write your own connector. And there are python libraries written for these databases which prove very useful. The main thing I like about python is that the syntax pretty much forces your code to be readable by others because indention is part of the syntax rather than semicolons, parens, etc. I don't know PHP in detail but am learning more quickly because the University is forcing all departments to move to Drupal and we will be running our site on Drupal within a year probably although some administrative tasks will still be running on our Zope server. Thomas ps: remember my point is that IF you choose to use python this supports its use with databases and scripting. On Wednesday 27 October 2010 20:49:06 you wrote: Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting-language, programming language, real-time, half-time, bytecoded, virtual, etc.). Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. I was referring
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
On Sat, Oct 30, 2010 at 7:49 AM, Bradley Allen bradley.p.al...@gmail.com wrote: Mark- I would highly recommend looking at Tornado (http://www.tornadoweb.org) as an alternative to using Django without the ORM. I'd second that one. Has used it for a couple of projects, and it seriously cut down on prerequisite clutter and is super fast. Alex -- Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps --- http://shelter.nu/blog/ -- -- http://www.google.com/profiles/alexander.johannesen ---
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
Thanks to you both - that looks promising! Mark On Oct 29, 2010, at 4:57 PM, Alexander Johannesen wrote: On Sat, Oct 30, 2010 at 7:49 AM, Bradley Allen bradley.p.al...@gmail.com wrote: Mark- I would highly recommend looking at Tornado (http://www.tornadoweb.org) as an alternative to using Django without the ORM. I'd second that one. Has used it for a couple of projects, and it seriously cut down on prerequisite clutter and is super fast. Alex -- Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps --- http://shelter.nu/blog/ -- -- http://www.google.com/profiles/ alexander.johannesen ---
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
What's wrong with the library world developing its own domain language? From scratch. I mean not something like MARC that is just a static container for stuff, but a language that actually does something such as manipulating semantic maps or some such? It's not like things like PHP or Python or Django were handed down to us chiseled in stone tablets. All languages are arbitrary things anyway, and it doesn't matter how they are implemented. The point is to keep the layers of abstraction well defined. But otherwise, break down those walls. Peter Schlumpf www.avantilibrarysystems.com -Original Message- From: Mark Tomko mark.to...@simmons.edu Sent: Oct 29, 2010 3:30 PM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] PHP vs. Python [was: Re: Django] Have people found Django fairly usable without using its ORM features? I'm not a big ORM fan, and it seems that so many Python frameworks sort of fall over if you try to get around the ORM. It's a bit of a shame, because I like Python. I wish Bottle and Flask were a little easier to work with. It feels a little weird having to configure WSGI for each application. I love their minimalist approach to templating, though. Mark On Oct 29, 2010, at 4:14 PM, Genny Engel wrote: I think the significant attributes of most programming languages are adequately summarized here: http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html From: Code for Libraries [code4...@listserv.nd.edu] on behalf of William Sexton [will.sex...@duke.edu] Sent: Friday, October 29, 2010 7:24 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] PHP vs. Python [was: Re: Django] I use Python and Django extensively, and think they're both great. That said, also great is the very funny keynote by former flickr engineer Cal Henderson at DjangoCon 2008, titled Why I Hate Django, which is on YouTube: http://www.youtube.com/watch?v=i6Fr65PFqfk When he showed the slide I had to admit that the statement -.join(array) is kind of a goofy way to do that, though maybe not unforgivable. Whenever I use join() now I chuckle a little in my mind. It's good to step back and re-evaluate your favorite tools from time- to-time. If nothing else, the ability to analyze a platform for its suitability to a need is key. Will On Oct 28, 2010, at 9:38 AM, Thomas Bennett wrote: Having used Zope (python based) as our WEB server of choice since 1998 I am urged to express my opinion that if you do choose to use python in your projects then use a service designed for python use such as Zope, Django, et al. Zope is normally run in front of Apache as a virtual host. If you are going to use python then Zope is an excellent choice for interacting with databases and using python to massage/manipulate results if you need complex results from the database data. I like that you can write sql queries just like you might use on the command line and save it as an individual object for use by any number of other objects. What may be a simple example to some is a tutorial quiz I wrote for the WEB. There are categories and each category has any number of questions along with the answers in the database. In the management portion, the administrator can choose which categories are active and how many questions out of the total available to pull from each category individually. When the quiz page is generated the correct number of questions are pulled randomly from the total active questions for each category, some questions can be set as inactive. There are database connectors for PostgreSQL, MySQL, Oracle, odbc, and others so you can choose any popular db or write your own connector. And there are python libraries written for these databases which prove very useful. The main thing I like about python is that the syntax pretty much forces your code to be readable by others because indention is part of the syntax rather than semicolons, parens, etc. I don't know PHP in detail but am learning more quickly because the University is forcing all departments to move to Drupal and we will be running our site on Drupal within a year probably although some administrative tasks will still be running on our Zope server. Thomas ps: remember my point is that IF you choose to use python this supports its use with databases and scripting. On Wednesday 27 October 2010 20:49:06 you wrote: Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
On Fri, Oct 29, 2010 at 6:28 PM, Peter Schlumpf pschlu...@earthlink.netwrote: What's wrong with the library world developing its own domain language? EVERYTHING!!! We're already in a world of pain because we have our own data formats and ways of dealing with them, all of which have basically stood idle while 30 years of advances computer science and information architecture have whizzed by us with a giant WHOOSHing sound. Having a bunch of non-experts design and implement a language that's destined from the outset to be stuck in a tiny little ghetto of the programming world is a guaranteed way to live with half- or un-supported code, no decent libraries, and yet another legacy of pain we'd have to support. I'm not picking on programming in particular. It's a dumb-ass move EVERY time a library is presented with a problem for which there are experts and decades of research literature, and it choses to ignore all of that and decide to throw a committee of librarians (or whomever else happens to be in the building at the time) at it based on the vague idea that librarians are just that much smarter (or cheaper) than everyone else (I'm looking at you, usability...) -Bill- -- Bill Dueber Library Systems Programmer University of Michigan Library
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
Having used Zope (python based) as our WEB server of choice since 1998 I am urged to express my opinion that if you do choose to use python in your projects then use a service designed for python use such as Zope, Django, et al. Zope is normally run in front of Apache as a virtual host. If you are going to use python then Zope is an excellent choice for interacting with databases and using python to massage/manipulate results if you need complex results from the database data. I like that you can write sql queries just like you might use on the command line and save it as an individual object for use by any number of other objects. What may be a simple example to some is a tutorial quiz I wrote for the WEB. There are categories and each category has any number of questions along with the answers in the database. In the management portion, the administrator can choose which categories are active and how many questions out of the total available to pull from each category individually. When the quiz page is generated the correct number of questions are pulled randomly from the total active questions for each category, some questions can be set as inactive. There are database connectors for PostgreSQL, MySQL, Oracle, odbc, and others so you can choose any popular db or write your own connector. And there are python libraries written for these databases which prove very useful. The main thing I like about python is that the syntax pretty much forces your code to be readable by others because indention is part of the syntax rather than semicolons, parens, etc. I don't know PHP in detail but am learning more quickly because the University is forcing all departments to move to Drupal and we will be running our site on Drupal within a year probably although some administrative tasks will still be running on our Zope server. Thomas ps: remember my point is that IF you choose to use python this supports its use with databases and scripting. On Wednesday 27 October 2010 20:49:06 you wrote: Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting-language, programming language, real-time, half-time, bytecoded, virtual, etc.). Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. I was referring to the ray-tracing part. It is also the most important scripting language in large scale CGI settings Yes, Python is widely used for scripting up interfaces into other more complex systems. But rarely is the core of the thing written entirely in Python. Maybe your Google-foo is weak. :) Or maybe he's just realizing that outside of server side web scripting, PHP is just not so widely used. Absolutely, and fair enough. Having used both languages, I discovered that Python is easier for most tasks, and one reason is that the libraries that come with Python are extremely robust, well tested and consistent. Hmm. PHP is extremely robust and well-tested, but yes, it's not all that consistent, especially not before version 5.2+. However, things have moved on, and with release 6 around the corner things will be tighter still. Just like the first versions of Python were interesting, so was PHP's, but where the biggest problem with the evolution of PHP was the very fact that it was the most popular language for rapid web development by far. PHP is very practical for server-side web scripting, but it's libraries are unfortunately full of gotchas, traps and unexpected behaviour. There's gotchas in every language, even Python. A key reason for that is the fact that Python has always had an exception-handling mechanism while PHP has grown something like that only a few years ago True enough. But earlier versions of any language are less desirable than the latest versions, so I'm not sure this is a prevailing argument for the horribleness of PHP or any language. These things evolve. PHP 5.3+ and soon 6 are looking very good, indeed, but yes, we will just have to live with a poor reputation brought on by the big number of users and the pre 5.2+ era. So, I my opinion, PHP is great at what it does best: enabling quick server-side Web scripting on almost any hosting service on Earth. I'm fairly sure you can say that because you haven't done much other kind of PHP work. :) For everything else, it is very worthwhile to learn and use a general purpose dynamic language
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
On Wed, Oct 27, 2010 at 9:28 PM, Alexander Johannesen alexander.johanne...@gmail.com wrote: From my experience, it seemed php was a server side scripting language. Strictly speaking, so is Python. Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. It is also the most important scripting language in large scale CGI settings, used in companies such as Indusrial Light Magic, Weta Digital and so on. Python has become so important for CGI in recent years that Autodesk had to embed Python in its Maya application even though Maya has always had its own embedded scripting language, called MEL. Nuke, a red hot 3D compositor that was massively used in the production of Avatar, is completely scriptable in Python. In fact, its entire UI Is made with Python. http://www.thefoundry.co.uk/products/nuke/ You can bind PHP and Python the same, it's just a matter of doing and whether it makes sense to do so. It's *not* a question of /if/ you can do it, but if you /should/ do it. Your milage *will* vary. For the sophisticated hacker, most languages can be tweaked to solve almost any problem. I am sure that is true. Though, I feel many for many tasks php would require quite a bit more tweaking than python, with much less community support behind it (I mean, google comes up with fewer helpful links to the problems I sited above). Maybe your Google-foo is weak. :) Or maybe he's just realizing that outside of server side web scripting, PHP is just not so widely used. Anyway, I wasn't meaning to promote PHP over Python, just pointing out that PHP is a lot more (and more often still, a lot better) than what most people think it is. Having used both languages, I discovered that Python is easier for most tasks, and one reason is that the libraries that come with Python are extremely robust, well tested and consistent. PHP is very practical for server-side web scripting, but it's libraries are unfortunately full of gotchas, traps and unexpected behaviour. A key reason for that is the fact that Python has always had an exception-handling mechanism while PHP has grown something like that only a few years ago, and many libraries don't use it, so whenever you call a function you never know whether the result will be a real value or some error code. This is very error-prone and testing for errors on many calls makes the program logic harder to follow. So, I my opinion, PHP is great at what it does best: enabling quick server-side Web scripting on almost any hosting service on Earth. For everything else, it is very worthwhile to learn and use a general purpose dynamic language such as Python, Ruby or Perl. Sorry for the rant. I must confess I am a founder of the Brazilian Python Association and was its first president, so you can call me a Python advocate. -- Luciano Ramalho programador repentista || stand-up programmer Twitter: @luciano
Re: [CODE4LIB] PHP vs. Python [was: Re: Django]
Olá, como vai? Luciano Ramalho luci...@ramalho.org wrote: Actually, Python is a general purpose programming language. It was not created specifically for server side scripting like PHP was. But it is very suitable to that task. I'm not sure talking about what something used to be is as interesting as talking about what it is. Both Pyhton and PHP can share whatever moniker we choose (scripting-language, programming language, real-time, half-time, bytecoded, virtual, etc.). Not seen any scientific packages, but I've seen a few ray-tracers, although they're all demo apps and fun toys (although I think that applies to Python, too). No, that does not apply to Python. Python is widely used for hardcore scientific computing. I was referring to the ray-tracing part. It is also the most important scripting language in large scale CGI settings Yes, Python is widely used for scripting up interfaces into other more complex systems. But rarely is the core of the thing written entirely in Python. Maybe your Google-foo is weak. :) Or maybe he's just realizing that outside of server side web scripting, PHP is just not so widely used. Absolutely, and fair enough. Having used both languages, I discovered that Python is easier for most tasks, and one reason is that the libraries that come with Python are extremely robust, well tested and consistent. Hmm. PHP is extremely robust and well-tested, but yes, it's not all that consistent, especially not before version 5.2+. However, things have moved on, and with release 6 around the corner things will be tighter still. Just like the first versions of Python were interesting, so was PHP's, but where the biggest problem with the evolution of PHP was the very fact that it was the most popular language for rapid web development by far. PHP is very practical for server-side web scripting, but it's libraries are unfortunately full of gotchas, traps and unexpected behaviour. There's gotchas in every language, even Python. A key reason for that is the fact that Python has always had an exception-handling mechanism while PHP has grown something like that only a few years ago True enough. But earlier versions of any language are less desirable than the latest versions, so I'm not sure this is a prevailing argument for the horribleness of PHP or any language. These things evolve. PHP 5.3+ and soon 6 are looking very good, indeed, but yes, we will just have to live with a poor reputation brought on by the big number of users and the pre 5.2+ era. So, I my opinion, PHP is great at what it does best: enabling quick server-side Web scripting on almost any hosting service on Earth. I'm fairly sure you can say that because you haven't done much other kind of PHP work. :) For everything else, it is very worthwhile to learn and use a general purpose dynamic language such as Python, Ruby or Perl. Of course. Developers should learn many of languages, and choose wisely the language best suited to the problem at hand. Sorry for the rant. I must confess I am a founder of the Brazilian Python Association and was its first president, so you can call me a Python advocate. No bias at all, really. :) Kind regards, Alex -- Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps --- http://shelter.nu/blog/ -- -- http://www.google.com/profiles/alexander.johannesen ---