473,797 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python v PHP: fair comparison?

I don't know if this is a fair comparison or not. Any comments
appreciated.

- Python is more readable, and more general purpose
- PHP has awful backward compatibility
- PHP has a lower barrier to entry
- Most inexpensive web-hosters support PHP, but not Python
- PHP has far more pre-writen scripts available
- Newer versions of mod_python require Apache 2.0, which few hosters
have
- There is more demand for PHP developers, than Python developers

Nov 14 '06
50 2664

Bjoern Schliessmann wrote:
walterbyrd wrote:
- PHP has a lower barrier to entry

Which kind of barrier do you mean -- syntax, availability, ...?
Putting php into a web-site is as easy as throwing some php code into a
my html file, and maybe giving the file a php extension. I can get php
hosting for $10 a year easy.

This may not be what you want for a major developement project, but the
barrier to entry is very low.

Nov 15 '06 #11
walterbyrd wrote:
>
The problem is that the system requirements for django and turbogears
are sky-high. I think Django requires Apache 2.0 (and maybe mod_python
3.x), and CherryPy (part of turbogears) requires Python 2.4. If you are
developing for a hosted environment, this can be a big problem. Few
enough hosters provide python to begin with, then add to that such
requirements as apache 2.0 - and you left with almost nothing.
I guessed that this was what you meant by "PHP has a lower barrier to
entry", even though others chose to interpret that in the context of
how easy or consistent the technology would seem to be in comparison
with Python. While it's true that PHP seems to be widely available, and
the newcomer can probably get immediate results by just publishing a
few files, the availability of relatively inexpensive virtual server
hosting seems to undermine claims that no-one supports Python together
with a modern selection of server programs.

I've been tempted to get some "dynamic" hosting at some point, and the
major difference between now and the last time I looked into this
(possibly about three or so years ago), is that back then you had to
spend a fair amount of money to get anything other than an
inconveniently accessible CGI directory requiring a version of
cgipython that could run on the inconveniently chosen version of
FreeBSD so beloved of certain hosting providers. Now, you can get a
virtual server populated with your own GNU/Linux distribution, or if
that sounds like too much work, there's a choice of hosting providers
that support Python plus certain servers "out of the box".

Things seem to have moved on, and very much for the better, too.

Paul

Nov 15 '06 #12

Michael Torrie wrote:
Absolutely false. Most of my standalone, command-line scripts for
manipulating my unix users in LDAP are written in PHP, although we're
rewriting them in python.
I would say that you are one of very few who use PHP for sys-admin
tasks - and even you have switched to Python. In general, it does not
seem to me that PHP has caught on as a sys-admin language.

However, as sys-admin scripting langanges go, I would also say that
Python is far less popular than butt-ugly Perl. Again - just based on
what I've seen.

Nov 15 '06 #13

walterbyrd wrote:
I don't know if this is a fair comparison or not.
Who cares? Anything involving PHP is a "billion flies can't be wrong"
type of statement.

I agree completely with your observation about PHP's lower cost of
access. This is ostensibly a good thing, but it also means that every
software-ignorant newbie dives straight into PHP and ten minutes later
they're a guru. The average quality of PHP developers is rock-bottom
and the average quality of PHP code is about the same. I don't like the
language either, but it's the use PHP is put to that spoils most of it,
more than language features itself.

Nov 15 '06 #14


On 2006-11-15 10:47:07 -0500, "Demel, Jeff"
<Je********@Jav elinDirect.coms aid:
[...]
That's true, but I was lucky enough to find webfaction.com for python
hosting, including Django. Good prices and they know Python. I think
they used to be python-hosting.com or something.

-Jeff
Dirt-cheap Dreamhost also offers Python with Django (as well as Ruby
with Rails), though I haven't used those capabilities so I can't judge
how good the environment is. I suspect it isn't that great. The people
at Dreamhost are great; the service itself is - at best! - unreliable.

Best,
James

Nov 15 '06 #15
I've wrestled with this for quite a while, and I think
that I've come up with a solution. Let the heavy lifting
of the application be done with a back end python process.
I was thinking that I might use cherrypy to sit there and
wait for requests.

Then, I would have PHP make calls to this back end process
to get the content that it needs. This could be on any level
from a simple datum from the database, or as complex as
the HTML for the entire web page. I'm still trying to settle
on a protocol (SOAP, CORBA?) but I think that it should be
at the object level rather than simple posts to cherrypy.

Anyway, even though not all web hosters have a reasonable
python web framework installed, they will almost certainly
allow you to run python programs. The PHP might eventually
boil down to simple function calls that get content from
the back end. Let python do all the work:

<?php

put_attendee_ma iling_info($id) ;
list_cart_items ($id);

?>
walterbyrd wrote:
I don't know if this is a fair comparison or not. Any comments
appreciated.

- Python is more readable, and more general purpose
- PHP has awful backward compatibility
- PHP has a lower barrier to entry
- Most inexpensive web-hosters support PHP, but not Python
- PHP has far more pre-writen scripts available
- Newer versions of mod_python require Apache 2.0, which few hosters
have
- There is more demand for PHP developers, than Python developers
--
Posted via a free Usenet account from http://www.teranews.com

Nov 15 '06 #16

walterbyrd ha escrito:
Luis M. González wrote:
the new crop of web frameworks (Django, Turbo Gears, etc...).
- Newer versions of mod_python require Apache 2.0, which few hosters
have
You can also get alder versions of mod_python. What's the problem?

The problem is that the system requirements for django and turbogears
are sky-high. I think Django requires Apache 2.0 (and maybe mod_python
3.x), and CherryPy (part of turbogears) requires Python 2.4. If you are
developing for a hosted environment, this can be a big problem. Few
enough hosters provide python to begin with, then add to that such
requirements as apache 2.0 - and you left with almost nothing.
You are right.
Although this is not a problem to me, because I just use bare-bones
mod_python, with no framework on top of it.
Not many people know that mod_python comes with its own built-in
handlers suitable for different programming styles, such as PSP
(similar to php) or publisher (M-V-C style).

Luis

Nov 15 '06 #17
walterbyrd a écrit :
Bjoern Schliessmann wrote:
>>walterbyrd wrote:

>>>- PHP has a lower barrier to entry

Which kind of barrier do you mean -- syntax, availability, ...?


Putting php into a web-site is as easy as throwing some php code into a
my html file, and maybe giving the file a php extension. I can get php
hosting for $10 a year easy.

This may not be what you want for a major developement project,
Not even for a minor one. While one can write not-trivial applications
in PHP, the kind of work this requires would greatly benefit from a real
programming language (vs a Q&D web scripting language).
but the
barrier to entry is very low.
Ok. This observation is very specific to web development. Python is a
general purpose programming language. And from this POV, it's IMHO much
easier to learn. And not only because you don't need Apache to use it.
Nov 15 '06 #18
walterbyrd a écrit :
Larry Bates wrote:

>>I'd be surprised if there was more demand for PHP developers
than Python developers.


Prepare to be surprised. From what I have seen demand for PHP
developers is off-the-scale higher than demand for Python developers.
Anyone that knows how to program and understand the http protocol is
already a PHP developer.
If you search the job boards, then -IMO- it is only fair to not include
jobs where the language is listed as an also-ran.
Then you'll find *very* few "Python developper" jobs.
For example a typical
sys-admin job will list about 24 skills, and python is often thrown
into the landry list. To my way of thinking, that is not really an ad
for a python developer.
No, it's an ad for a sys-admin job.

FWIW, I've been hired as a web developer - not as a PHP or Java or
whatever specific language programmer. Python wasn't even on the "landry
list". Then we had to hire another developer to help me on a Zope-based
project. We didn't hired a "Zope developer", nor even a "Python
developer" - we hired a young C/Perl hacker with almost no prior web
programming knowledge. Why ? Because he obviously was the best
*programmer* we could find. As a matter of fact, he managed to become a
productive Zope/Python programmer in less than two weeks.
Trying to be as fair as I can be, my research shows that demand for
developers where PHP is the primary is *far* higher than jobs where
Python is the primary skills.
There are companies that believe that there are such things as "PHP
programmer", "Java programmers", etc. And there are companies that know
the difference between a programmer and a code-monkey. The first one
will ask for 10+ years of experience on a techno that is less than 5
years old. The other will know a good coder when they meet one. Guess
where are most 'Python programmers' working ?
Of course, at best, that only shows the demand part of the equation.
Not even.
There is also the supply side to consider. From what I have seen for
salary offers for PHP developers, it may be fair to say that PHP
developers are a dime a dozen.
Anyone that knows how to program and understand the http protocol is
already a PHP developer.
Nov 15 '06 #19
Michael Torrie a écrit :
On Tue, 2006-11-14 at 18:55 -0800, Luis M. González wrote:
>>>- Python is more readable, and more general purpose

Yes, php is only for web.


Absolutely false.
From a purely technical POV, you're of course right. But PHP has been
hacked (nobody in it's own mind would pretend it has ever been
'designed') for web programming, and since the language by itself is
totally and definitively braindead, using it for anything else is either
masochism or lack of knowledge of better solutions. Heck, even Perl is
better for pure admin/scripting tasks.
Most of my standalone, command-line scripts for
manipulating my unix users in LDAP are written in PHP,
Yuck.
although we're
rewriting them in python.

Although I can't think of a single app written in php that's not web-
based (other than standalone scripts I have written), there are up-to-
date php bindings for GTK: http://gtk.php.net/
As a matter of fact, while PHP *can* be used for GUI and CLI apps,
you'll have hard time finding non-web PHP-based projects... OTOH, you'll
find Python everywhere, from sys-admin scripts to full-blown web
application servers to rich GUI clients. There must be a reason...
Nov 15 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
34266
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
59
4317
by: Hugh Macdonald | last post by:
I've recently been trying out various different GUI frameworks in Python and was wondering if I could get your input on the pros and cons of the different ones... wxPython: I love the programming side of wxPython, but I find it's just so slow to initialise in the first place. Tkinter: While it's fast to load up, the syntax has never really appealed to me
114
9890
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
10
1892
by: walterbyrd | last post by:
I don't know if this is a fair comparison or not. Any comments appreciated. - Python is more readable, and more general purpose - PHP has awful backward compatibility - PHP has a lower barrier to entry - Most inexpensive web-hosters support PHP, but not Python - PHP has far more pre-writen scripts available - mod_python is difficult to set up, and use, and is buggy and prone to crash
0
1591
by: Paul Boddie | last post by:
QOTW: "I think you've got the wrong intuition about the balance between the amount of bandwidth and the amount of computation a given numer of dollars would buy. You've hundreds of CPU cycles available per bit transmitted; space enough to stick in even Python." - Thomas Womack (on comp.lang.lisp, earlier this year, so it's not a true QOTW) http://groups.google.com/group/comp.lang.lisp/msg/453239d7b8e0ef72 "I'm a recent, belated convert...
71
3363
by: Jack | last post by:
I understand that the standard Python distribution is considered the C-Python. Howerver, the current C-Python is really a combination of C and Python implementation. There are about 2000 Python files included in the Windows version of Python distribution. I'm not sure how much of the C-Python is implemented in C but I think the more modules implemented in C, the better performance and lower memory footprint it will get. I wonder if it's...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7559
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
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 we have to send another system
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.