Is Python appropriate for web applications?

U

Unknown User

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,
 
P

Peter Maas

Unknown said:
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.Computers.Programming.Languages.Comparison_and_Review.html
 
B

bruno modulix

Unknown said:
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
 
P

peufeu

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 ?
 
I

igouy

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"
 
U

Unknown User

Thank you very much.


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/


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/).


http://www.allsites.com/Top.Computers.Programming.Languages.Comparison_and_Review.html
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top