473,466 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is Python appropriate for web applications?

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
7 1429
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
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
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
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

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
> > 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
15
by: Brandon J. Van Every | last post by:
Is anyone using Python for .NET? I mean Brian's version at Zope, which simply accesses .NET in a one-way fashion from Python. http://www.zope.org/Members/Brian/PythonNet Not the experimental...
114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
27
by: Josh | last post by:
We have a program written in VB6 (over 100,000 lines of code and 230 UI screens) that we want to get out of VB and into a better language. The program is over 10 years old and has already been...
158
by: Giovanni Bajo | last post by:
Hello, I just read this mail by Brett Cannon: http://mail.python.org/pipermail/python-dev/2006-October/069139.html where the "PSF infrastracture committee", after weeks of evaluation, recommends...
22
by: mattf | last post by:
I've discovered Python and have been trying it out lately as a possible replacement for computations that would ordinarily be done with a commercial package like Matlab or IDL. I'd like to mention...
3
by: Kevin Walzer | last post by:
Hello, I am seeking to update this wiki page, which lists Mac OS X applications using Python in a significant way: http://wiki.python.org/moin/MacPython/MacSoftwareUsingPython This query is...
7
by: Chris | last post by:
I have an database containing lots of numerical data. I want to write a browser based interface that will allow selection of various key parameters and yield tables, plots and/or printouts of the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.