Python v PHP: fair comparison?

B

Bruno Desthuilliers

Michael Torrie a écrit :
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...
 
B

Bruno Desthuilliers

walterbyrd a écrit :
Michael Torrie wrote:




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.

Perl is a scripting language. By 'design'. It's meant to be a better
sh+sed+awk. Python is a general purpose programming language meant to
fill the gap between shell scripts and C programs. So Perl is obviously
a better scripting language than Python. The problem is that Q&D
sys-admin scripts tend to become full-blown apps - and then, Perl starts
to suck.
 
B

Bruno Desthuilliers

walterbyrd a écrit :
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.

Yes. Neither Apache 2.0 nor mod_python 3.x nor Python 2.4 are really
bleeding edge, you know.
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 mean there are web hosting companies that are still using Apache
1.3.x ?

C'mon, let's be serious. I just ordered a dedibox - a small dedicated
web server - for my personal use. It's only 30 euros a month, you know...
 
G

Gabriel Genellina

Michael Torrie a écrit :

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.

Someone here (= at work) needed to write some PDF
reports, to be run from a bunch of ini-like
files. Without much research nor analysis nor
thinking nor approval, he said "let's use this
php library!". Surely the reports came in a few days. But:
- another dependency was added to the project
- the .ini format -which was suposed to be an
internal implementation detail- is now part of
the public interfase to the report generator
- a lot of PHP code duplicates the original class hierarchy (in delphi)
- php sucks :)

Of course there are a lot of unrelated issues
here, but I think that it's such a braindead
language which turns people into braindead programmers :)


--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
 
G

Gabriel Genellina

interesting ongoing thread...

i've seen a number of these over the years.. my language is better than your
language!!

i'm sure this question on the php list would have findings/results that are
essentially opposite of what is being discussed here!

Sure. But after you realize that a language is just a tool to
complete a task, most of the discussions are meaningless. The
original post didn't say "python is better than php", and I think the
comparison is rather fair.


--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
 
W

walterbyrd

Bruno said:
walterbyrd a écrit :
You mean there are web hosting companies that are still using Apache
1.3.x ?

Practically all web-hosters still use Apache 1.3.x. Certainly all of
the lower priced hosters.
C'mon, let's be serious. I just ordered a dedibox - a small dedicated
web server - for my personal use. It's only 30 euros a month, you know...

What if I only need 25mb of space? I can that with a PHP hoster for $10
a year. That is about 1/36th the price that you posting about.

Maybe you don't mind paying 30 euros a month, but a lot others do.
 
W

walterbyrd

Gabriel said:
- php sucks :)
I think that it's such a braindead
language which turns people into braindead programmers :)

In fairness, a lot of very serious work is done in PHP. I think yahoo
and other major web-sites use php.

I have issues with PHP as well. They will break backward compatibility
on a whim, and it is an ugly language - especially when mixed with
html. But, PHP does have it's streaths, and Python is not without it's
weaknesses.
 
C

Cameron Laird

.
.
.
Then look no further. Learn python and go kick php developers asses in
the market place.
There are thousands of php developers out there. Do you want to be just
one more?
I'd rather learn something newer, and much more powerful.
.
[more Python
cheerleading]
.
.
Perhaps it's timely to clarify the "newer" above: Guido
made Python public in '89-90, and Rasmus showed PHP to
others in '94-95.
 
J

James Cunningham

Practically all web-hosters still use Apache 1.3.x. Certainly all of
the lower priced hosters.

Not true. Dreamhost, at least, uses Apache 2.
What if I only need 25mb of space? I can that with a PHP hoster for $10
a year. That is about 1/36th the price that you posting about.

Maybe you don't mind paying 30 euros a month, but a lot others do.

Of course, you can't get $10 a year plans on Dreamhost. But with deals
you can get it down to about that low, at least for the first year. I
suppose I'm lucky enough not to miss $8 a month otherwise.

Best,
James
 
S

Steve Holden

bruce said:
ummm bruno...

you don't 'need' apache to run php.

in fact, although i'm from the old hard c/c++ world.... way before web apps,
i haven't really found much for most general apps (not ui/not threaded
stuff) that php can't do..

You simply haven't been looking hard enough.

regards
Steve
 
S

Steve Holden

James said:
Not true. Dreamhost, at least, uses Apache 2.

So you thin a single counter-example disproves an assertion that begins
with "practically all"?
Of course, you can't get $10 a year plans on Dreamhost. But with deals
you can get it down to about that low, at least for the first year. I
suppose I'm lucky enough not to miss $8 a month otherwise.
regards
Steve
 
J

James Cunningham

So you thin a single counter-example disproves an assertion that begins
with "practically all"?

Nope. It disproves your assertion that "certainly all of the lower
priced hosters" use Apache 1.3.

"Certainly all".

"Certainly" "all".

Best,
James
 
?

=?iso-8859-1?q?Luis_M._Gonz=E1lez?=

Cameron Laird ha escrito:
.
.
.
Then look no further. Learn python and go kick php developers asses in
the market place.
There are thousands of php developers out there. Do you want to be just
one more?
I'd rather learn something newer, and much more powerful.
.
[more Python
cheerleading]
.
.
Perhaps it's timely to clarify the "newer" above: Guido
made Python public in '89-90, and Rasmus showed PHP to
others in '94-95.

OK. But since when has python been considered a viable alternative for
web development?
As a generalp purpose language, it's older.
But as a web development language, it's olnly when people started to
look for the "rails killer" and many python alternatives started to
come up (although Django has been in development for a long time before
all this hype).
I remember well, just a few months ago, there were many alternatives
(remember "subway"?).
 
F

Fredrik Lundh

Luis said:
But as a web development language, it's olnly when people started to
look for the "rails killer" and many python alternatives started to
come up (although Django has been in development for a long time before
all this hype).

nah, people have built web stuff on Python for as long as we've had a web.

</F>
 
P

Paul Boddie

Luis said:
OK. But since when has python been considered a viable alternative for
web development?

Since the Bobo era (ca. 1997), but quite possibly before. Sure, you had
to build your own mega-framework back then, but that's what a lot of
people were doing anyway.
As a generalp purpose language, it's older.
But as a web development language, it's olnly when people started to
look for the "rails killer" and many python alternatives started to
come up (although Django has been in development for a long time before
all this hype).

I remember maintaining a long list of Web frameworks a few *years* ago.
It's true that most of them didn't resemble the slick marketed package
that you see with something like TurboGears, but you might be surprised
how much you got with Webware back in 2001:

http://www.webwareforpython.org/Docs/RelNotes-0.5.html
I remember well, just a few months ago, there were many alternatives
(remember "subway"?).

Some people would like you to believe that they pioneered the
mega-framework, amongst other things. Freely available documentation
undermines such claims if you know where to look (and actually choose
to do so).

Paul
 
S

Steve Holden

James said:
Nope. It disproves your assertion that "certainly all of the lower
priced hosters" use Apache 1.3.

"Certainly all".

"Certainly" "all".
Certainly. But not my assertion.

regards
Steve
 
C

Cameron Laird

OK. But since when has python been considered a viable alternative for
web development?
As a generalp purpose language, it's older.
But as a web development language, it's olnly when people started to
look for the "rails killer" and many python alternatives started to
come up (although Django has been in development for a long time before
all this hype).
I remember well, just a few months ago, there were many alternatives
(remember "subway"?).

I appreciate your clarification. I can report back that we
certainly move in different circles; I, for example, knew of
people with multi-million-dollar budgets deciding on Python-
based Web technology for *serious* applications in '96. Ruby
1.0, perhaps you'll recall, was a Christmas gift for 1996.
For this and allied reasons, it didn't occur to me to regard
Ruby as the senior "Web development language" among the two.
 
B

Bruno Desthuilliers

(replying to bruce - the post doesn't show up here)
Yes, true, you can also install the cli version. Which has lots of
restrictions BTW.

Web apps are not where I learned programming...

I haven't really found much for most general apps that assembler can't
do - it's just too painful... !-)
 
?

=?iso-8859-1?q?Luis_M._Gonz=E1lez?=

Fredrik Lundh ha escrito:
nah, people have built web stuff on Python for as long as we've had a web.

</F>


I know, but would you consider a python cgi application a good
competence against php?
 

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,780
Messages
2,569,608
Members
45,246
Latest member
softprodigy

Latest Threads

Top