By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,734 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

Is Python appropriate for web applications?

P: n/a
I am a Python programmer and I'm thinking about learning PHP, which is
similar to C++ (quite
different from Python). I want to start writing web applications. Do you
think if I learn
PHP I'll develop faster? Does PHP have more features? How about the speed
of execution? What
are the pros and cons? Our server can run both Python, Perl and PHP, so I
have the choice.
Thanks for your opinion,

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 19 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Unknown User schrieb:
I am a Python programmer and I'm thinking about learning PHP, which is
similar to C++
wrong
(quite different from Python).
true
I want to start writing web applications. Do you think if I learn
PHP I'll develop faster?
Nobody but you can anawer this question. You'll have to try.

Does PHP have more features?

PHP has a rich library which probably outperforms any Python alternative
in terms of features. But this doesn't necessarily mean that you will
develop faster in PHP. The problem with Python is that you have to make
a choice among many solutions (roughly ordered by inreasing complexity):

- plain cgi
- Quixote
- modpython
- CherryPy
- Spice
- Webware
- Twisted
- ZOPE
....

Have a look at http://www.python.org/topics/web/
How about the speed of execution?
There is no simple answer. Both languages use C functions which are
executed at CPU speed. But with interpreted code Python seems to be
approximately 3-4 times faster than PHP (http://dada.perl.it/shootout/).
What are the pros and cons?


http://www.allsites.com/Top.Computer...nd_Review.html

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
Jul 19 '05 #2

P: n/a
Unknown User wrote:
I have the choice.
Thanks for your opinion,


If you have a look at CherryPy (www.cherrypy.org) you will not want to
go back to PHP again! ;-)

Lorenzo
Jul 19 '05 #3

P: n/a
Unknown User wrote:
I am a Python programmer and I'm thinking about learning PHP, which is
similar to C++ (quite
different from Python). I want to start writing web applications. Do
you think if I learn
PHP I'll develop faster? Does PHP have more features? How about the
speed of execution? What
are the pros and cons? Our server can run both Python, Perl and PHP, so
I have the choice.
Thanks for your opinion,


<rant topic="php">
I loosed 2 hours this morning debugging PHP code. There were 2 problems.

The first one was a typo in the name of a variable ($actegories instead
of $categories). Instead of raising an exception, this b**d "programming
language" (err...) just created a new variable with a NULL value. Doh :-(

The second one was about array concatenation/union. I had used the "+"
operator instead of the array_merge() function.

Read the PHP doc about the "+" operators for arrays and the
array_merge() function (don't forget that PHP uses the same construct
for arrays and mappings - doh). Then imagine yourself programming PHP,
and ask yourself if you'll really develop faster with such a braindead
quick&dirty hack for language.
</rant>

PHP-is-VB-for-the-web-ly'yrs
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jul 19 '05 #4

P: n/a
for more information on web application frameworks check out

http://pyre.third-bit.com/pyweb/

It is a project aimed at helping web app developers to figure out which
frameworks to use, etc.

good luck!

Jul 19 '05 #5

P: n/a

The first one was a typo in the name of a variable ($actegories instead
of $categories). Instead of raising an exception, this b**d "programming
language" (err...) just created a new variable with a NULL value. Doh :-(
Set error reporting to all.
Marvel at how it reports this simple typo in a clear and easy to
understand way.
Then notice it also gives you a million warnings for a lot of valid stuff
in your code.
Cry.
The second one was about array concatenation/union. I had used the "+"
operator instead of the array_merge() function.
My favourite is array_key_exists(). Without looking at the docs, can you
tell me the order of the parameters ?

Read the PHP doc about the "+" operators for arrays and the
array_merge() function (don't forget that PHP uses the same construct
for arrays and mappings - doh). Then imagine yourself programming PHP,
and ask yourself if you'll really develop faster with such a braindead
quick&dirty hack for language.
</rant>

PHP-is-VB-for-the-web-ly'yrs


Jul 19 '05 #6

P: n/a
> > How about the speed of execution?

There is no simple answer. Both languages use C functions which are
executed at CPU speed. But with interpreted code Python seems to be
approximately 3-4 times faster than PHP

(http://dada.perl.it/shootout/).

The Win32 Computer Language Shootout hasn't been updated for 22 months.

The Great Computer Language Shootout Benchmarks were updated 2 days ago
http://shootout.alioth.debian.org/great/

For those original Doug Bagley tests click on "The Doug Bagley"

Jul 19 '05 #7

P: n/a
Thank you very much.
On Fri, 15 Apr 2005 06:47:14 -0300, Peter Maas <pe***@somewhere.com> wrote:
Unknown User schrieb:
I am a Python programmer and I'm thinking about learning PHP, which is
similar to C++


wrong
(quite different from Python).


true
I want to start writing web applications. Do you think if I learn
> PHP I'll develop faster?


Nobody but you can anawer this question. You'll have to try.

Does PHP have more features?

PHP has a rich library which probably outperforms any Python alternative
in terms of features. But this doesn't necessarily mean that you will
develop faster in PHP. The problem with Python is that you have to make
a choice among many solutions (roughly ordered by inreasing complexity):

- plain cgi
- Quixote
- modpython
- CherryPy
- Spice
- Webware
- Twisted
- ZOPE
...

Have a look at http://www.python.org/topics/web/
How about the speed of execution?


There is no simple answer. Both languages use C functions which are
executed at CPU speed. But with interpreted code Python seems to be
approximately 3-4 times faster than PHP (http://dada.perl.it/shootout/).
What are the pros and cons?


http://www.allsites.com/Top.Computer...nd_Review.html


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.