Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Python or PHP?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 68 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lad  
View profile  
 More options Apr 23 2005, 7:14 am
Newsgroups: comp.lang.python
From: "Lad" <pyt...@hope.cz>
Date: 23 Apr 2005 04:14:54 -0700
Local: Sat, Apr 23 2005 7:14 am
Subject: Python or PHP?
Is anyone capable of providing Python advantages over PHP if there are
any?
Cheers,
L.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif B. Kristensen  
View profile  
 More options Apr 23 2005, 7:37 am
Newsgroups: comp.lang.python
From: "Leif B. Kristensen" <ab...@solumslekt.org>
Date: Sat, 23 Apr 2005 13:37:06 +0200
Local: Sat, Apr 23 2005 7:37 am
Subject: Re: Python or PHP?
Lad skrev:

> Is anyone capable of providing Python advantages over PHP if there are
> any?

Much more compact and yet much more readable code, making it easier to
maintain and extend your programs.
--
Leif Biberg Kristensen
http://solumslekt.org/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif K-Brooks  
View profile  
 More options Apr 23 2005, 7:59 am
Newsgroups: comp.lang.python
From: Leif K-Brooks <eurl...@ecritters.biz>
Date: Sat, 23 Apr 2005 11:59:48 GMT
Local: Sat, Apr 23 2005 7:59 am
Subject: Re: Python or PHP?

Lad wrote:
> Is anyone capable of providing Python advantages over PHP if there are
> any?

Python is a programming language in more ways than simple Turing
completeness. PHP isn't.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mage  
View profile  
 More options Apr 23 2005, 9:53 am
Newsgroups: comp.lang.python
From: Mage <m...@mage.hu>
Date: Sat, 23 Apr 2005 15:53:17 +0200
Local: Sat, Apr 23 2005 9:53 am
Subject: Re: Python or PHP?

Lad wrote:
>Is anyone capable of providing Python advantages over PHP if there are
>any?

I am also new to python but I use php for 4 years. I can tell:

- python is more *pythonic* than php
- python has its own perfume
http://www.1976.com.tw/image/trussardi_python_uomo.jpg  and it's nice.
php doesn't have any smell
- writing python programs you feel much better

check this: http://wiki.w4py.org/pythonvsphp.html

       Mage


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ville Vainio  
View profile  
 More options Apr 23 2005, 11:07 am
Newsgroups: comp.lang.python
From: Ville Vainio <vi...@spammers.com>
Date: 23 Apr 2005 18:07:04 +0300
Local: Sat, Apr 23 2005 11:07 am
Subject: Re: Python or PHP?

>>>>> "Leif" == Leif K-Brooks <eurl...@ecritters.biz> writes:

    Leif> Lad wrote:
    >> Is anyone capable of providing Python advantages over PHP if there are
    >> any?

    Leif> Python is a programming language in more ways than simple Turing
    Leif> completeness. PHP isn't.

+1 QOTW.

--
Ville Vainio   http://tinyurl.com/2prnb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile  
 More options Apr 23 2005, 11:47 am
Newsgroups: comp.lang.python
From: "Diez B. Roggisch" <deetsNOS...@web.de>
Date: Sat, 23 Apr 2005 17:47:16 +0200
Local: Sat, Apr 23 2005 11:47 am
Subject: Re: Python or PHP?

> php doesn't have any smell

au contraire! I've seen many code smells in PHP.

http://c2.com/cgi/wiki?CodeSmell

--  
Regards,

Diez B. Roggisch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Tyler  
View profile  
 More options Apr 23 2005, 11:52 am
Newsgroups: comp.lang.python
From: Tim Tyler <t...@tt1lock.org>
Date: Sat, 23 Apr 2005 15:52:01 GMT
Local: Sat, Apr 23 2005 11:52 am
Subject: Re: Python or PHP?
Mage <m...@mage.hu> wrote or quoted:

Good - but it hardly mentions the issue of security - which seems
like a bit of a problem for PHP at the moment.
--
__________
 |im |yler  http://timtyler.org/  t...@tt1lock.org  Remove lock to reply.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mage  
View profile  
 More options Apr 23 2005, 12:24 pm
Newsgroups: comp.lang.python
From: Mage <m...@mage.hu>
Date: Sat, 23 Apr 2005 18:24:05 +0200
Local: Sat, Apr 23 2005 12:24 pm
Subject: Re: Python or PHP?

Tim Tyler wrote:
>Mage <m...@mage.hu> wrote or quoted:

>>check this: http://wiki.w4py.org/pythonvsphp.html

>Good - but it hardly mentions the issue of security - which seems
>like a bit of a problem for PHP at the moment.

I don't think so. Bad programmers are able to write bad programs in any
language. Maybe there are more bad php programmers than python
programmers and the 70% of the dynamic world wide web is copied from
user comments in the php.net/manual. However one of the worst cases is
the sql injection attack. And sql injections must be handled neither by
php nor by python but by the programmer.

I think a website or even a large portal is a well constructed database
with triggers and stored procedures and some "echo", "if", "foreach" and
"while" in the php code.

To me the advantage of python seems to come out when you deal with xml,
file handling or when you have to write a native server application for
your website. But I am so new here, others may say other things.

       Mage


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kirk Job Sluder  
View profile  
 More options Apr 23 2005, 12:28 pm
Newsgroups: comp.lang.python
From: Kirk Job Sluder <k...@jobsluder.net>
Date: Sat, 23 Apr 2005 16:28:18 GMT
Local: Sat, Apr 23 2005 12:28 pm
Subject: Re: Python or PHP?

"Lad" <pyt...@hope.cz> writes:
> Is anyone capable of providing Python advantages over PHP if there are
> any?
> Cheers,
> L.

PHP is strongly wedded to providing web-based content, while Python can
be used to build a large number of different types of applications.  

--
Kirk Job-Sluder
"The square-jawed homunculi of Tommy Hilfinger ads make every day an
existential holocaust."  --Scary Go Round


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon John  
View profile  
 More options Apr 23 2005, 12:43 pm
Newsgroups: comp.lang.python
From: "Simon John" <simoninusa2...@yahoo.co.uk>
Date: 23 Apr 2005 09:43:52 -0700
Local: Sat, Apr 23 2005 12:43 pm
Subject: Re: Python or PHP?
I've been a PHP and Perl programmer (amongst others) for 10 years or
more now, and a Python coder for 3 or so.

I have come to hate PHP now, it's pseudo-OOP is awful, it's dog slow at
handling XML, it's so easy to use that most of the programmers I've had
contact with are very sloppy and do things like extract($_GET); or put
database usernames and passwords in index.php. I also have to agree
that php.net/manual seems to be the main reference that coders use -
which is not good if the comments are wrong!

Python seems to force you to write better code, maybe because of the
indentation, exception handling, proper OOP etc. Plus it's not so tied
into web stuff, in fact most of my Python programming is for the
desktop.

I still love Perl, it's a bit of an art form, as "there's more than one
way to do it", whereas Python usually only allows one way to do it,
which may or may not be a better mantra....

I've come to allocate PHP the same standing as ASP, VB or Java - the
language is OK, but the programmers are usually crap.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fredrik Lundh  
View profile  
 More options Apr 23 2005, 1:11 pm
Newsgroups: comp.lang.python
From: "Fredrik Lundh" <fred...@pythonware.com>
Date: Sat, 23 Apr 2005 19:11:19 +0200
Local: Sat, Apr 23 2005 1:11 pm
Subject: Re: Python or PHP?

"Mage" wrote:
> I don't think so. Bad programmers are able to write bad programs in any
> language.

in PHP, good programmers are able to write bad programs without
even noticing.

(every successful server attack I've seen closely the last few years
have been through PHP.  it's totally without competition in this area)

> However one of the worst cases is the sql injection attack. And sql
> injections must be handled neither by php nor by python but by the
> programmer.

sql injection?  what's your excuse for not using data binding?

</F>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mage  
View profile  
 More options Apr 23 2005, 2:13 pm
Newsgroups: comp.lang.python
From: Mage <m...@mage.hu>
Date: Sat, 23 Apr 2005 20:13:24 +0200
Local: Sat, Apr 23 2005 2:13 pm
Subject: Re: Python or PHP?

Fredrik Lundh wrote:

>sql injection?  what's your excuse for not using data binding?

I am not sure I truly understand your question.
So far my own servers didn't get successful sql injection attack. I just
saw some on other sites and did one for demonstration.

Avoid them is easy with set_type($value,"integer") for integer values
and correct escaping for strings.

However, php programmers usually don't initialize their variables
because they don't have to do. They even turn off warnings and errors.
Our php errorlog at my full time working company is so huge I could cry.
We have php-copypasters.
I don't know anyone IRL who uses python. So I started to learn it.

       Mage


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Bowers  
View profile  
 More options Apr 23 2005, 2:33 pm
Newsgroups: comp.lang.python
From: Jeremy Bowers <j...@jerf.org>
Date: Sat, 23 Apr 2005 14:33:40 -0400
Local: Sat, Apr 23 2005 2:33 pm
Subject: Re: Python or PHP?

On Sat, 23 Apr 2005 20:13:24 +0200, Mage wrote:
> Avoid them is easy with set_type($value,"integer") for integer values and
> correct escaping for strings.

"Avoiding buffer overflows in C is easy, as long as you check the buffers
each time."

The *existence* of a technique to avoid problems is not in question. The
problem is when the language makes it easier to *not* do the checks than
to do the checks. Any look at the real world shows that that pattern
causes trouble, and that clearly, the mere *existence* of a way to not get
in trouble is not sufficient in the general case.

Despite the fact that all you have to do to avoid cutting your finger off
with a saw is not stick your finger in the saw, most people, even
carpentry professionals, are going to want to use finger-guards and other
safety equipment. A programmer turning down such security protection
(without another good reason, which does happen), is being like the guy
too macho to use the finger guard; stupidity induced by arrogance, not
some one no longer using training wheels. Using PHP and futzing with SQL
directly is probably not a good enough reason, as surely PHP has safer
libraries available. (If not, my opinion of PHP goes down another notch.)

Data binding with something like SQLObject makes it *easier* to be secure
than insecure; barring an out-and-out bug in SQLObject (given the nature
of the requisite bug, it is extremely unlikely to have survived this
long), a programmer must go *way* out of their way to introduce the SQL
injection attacks that so plague PHP projects.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roman Neuhauser  
View profile  
 More options Apr 23 2005, 3:01 pm
Newsgroups: comp.lang.python
From: Roman Neuhauser <neuhauser+python-list#python....@sigpipe.cz>
Date: Sat, 23 Apr 2005 21:01:42 +0200
Local: Sat, Apr 23 2005 3:01 pm
Subject: Re: Python or PHP?
# m...@mage.hu / 2005-04-23 15:53:17 +0200:

> Lad wrote:

> >Is anyone capable of providing Python advantages over PHP if there are
> >any?

> I am also new to python but I use php for 4 years. I can tell:

> - python is more *pythonic* than php
> - python has its own perfume
> http://www.1976.com.tw/image/trussardi_python_uomo.jpg  and it's nice.
> php doesn't have any smell
> - writing python programs you feel much better

    No, *you* feel better. :)

    The comparison found there is biased, the author is a Python
    partisan.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
F. Petitjean  
View profile  
 More options Apr 23 2005, 4:15 pm
Newsgroups: comp.lang.python
From: "F. Petitjean" <littlejohn...@news.free.fr>
Date: 23 Apr 2005 20:15:03 GMT
Local: Sat, Apr 23 2005 4:15 pm
Subject: Re: Python or PHP?
Le Sat, 23 Apr 2005 19:11:19 +0200, Fredrik Lundh a écrit :

> in PHP, good programmers are able to write bad programs without
> even noticing.

+1 QOTW

---
The use of COBOL cripples the mind; its teaching should, therefore, be
regarded as a criminal offense.
Dr. E.W. Dijkstra


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif K-Brooks  
View profile  
 More options Apr 23 2005, 5:40 pm
Newsgroups: comp.lang.python
From: Leif K-Brooks <eurl...@ecritters.biz>
Date: Sat, 23 Apr 2005 21:40:47 GMT
Local: Sat, Apr 23 2005 5:40 pm
Subject: Re: Python or PHP?

Mage wrote:
> However one of the worst cases is the sql injection attack. And sql
> injections must be handled neither by php nor by python but by the
> programmer.

But Python's DB-API (the standard way to connect to an SQL database from
Python) makes escaping SQL strings automatic. You can do this:

cursor.execute('UPDATE foo SET bar=%s WHERE id=%s', ["foo'bar", 123])

And "foo'bar" will be implicitly escaped to whatever is appropriate for
your database. How's that for Python handling SQL injection automatically?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Bokma  
View profile  
 More options Apr 23 2005, 6:04 pm
Newsgroups: comp.lang.python
From: John Bokma <postmas...@castleamber.com>
Date: 23 Apr 2005 22:04:48 GMT
Local: Sat, Apr 23 2005 6:04 pm
Subject: Re: Python or PHP?

Leif K-Brooks wrote:
> Mage wrote:
>> However one of the worst cases is the sql injection attack. And sql
>> injections must be handled neither by php nor by python but by the
>> programmer.

> But Python's DB-API (the standard way to connect to an SQL database
> from Python) makes escaping SQL strings automatic. You can do this:

> cursor.execute('UPDATE foo SET bar=%s WHERE id=%s', ["foo'bar", 123])

> And "foo'bar" will be implicitly escaped to whatever is appropriate
> for your database. How's that for Python handling SQL injection
> automatically?

Not. Perl and Java use similar methods where one can specify place holders,
and pass on the data unescaped. But still injection is possible. Moreover,
a programmer still has to check if the values are acceptable or not.

AFAIK PHP is not able to do this, but goes at great length to "protect"
newbie programmers at great length, and hence give them a false feeling of
security. Defensive programming or a defensive programming language is
wrong.

--
John                               MexIT: http://johnbokma.com/mexit/
                           personal page:       http://johnbokma.com/
        Experienced programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Meyer  
View profile  
 More options Apr 23 2005, 6:15 pm
Newsgroups: comp.lang.python
From: Mike Meyer <m...@mired.org>
Date: Sat, 23 Apr 2005 17:15:47 -0500
Local: Sat, Apr 23 2005 6:15 pm
Subject: Re: Python or PHP?

"Simon John" <simoninusa2...@yahoo.co.uk> writes:
> I still love Perl, it's a bit of an art form, as "there's more than one
> way to do it", whereas Python usually only allows one way to do it,
> which may or may not be a better mantra....

The Python mantra leads to 1) less programmer overhead, and 2) faster
improvements in the language.

To be a Perl expert, you have to know which of the many ways to do
various things is the fasted under what conditions. Python programmers
seldom have to worry about that - there's usually only one [obvious]
way to do things, so you just do it that way.

Having only one obvious way to do things means developers only have to
worry about impact on that way when making improvements, which will
speed them up.

The problem these days is that there are now multiple ways to do a
variety of things, because we have the "new, pythonic" way and the
"old, backwards-compatible way". So it's no longer clear which is the
fastest - and in the case of generators versus list comprehensions,
it's not clear which you should be using. To bad.

     <mike
--
Mike Meyer <m...@mired.org>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Bokma  
View profile  
 More options Apr 23 2005, 6:37 pm
Newsgroups: comp.lang.python
From: John Bokma <postmas...@castleamber.com>
Date: 23 Apr 2005 22:37:06 GMT
Local: Sat, Apr 23 2005 6:37 pm
Subject: Re: Python or PHP?

Mike Meyer wrote:
> "Simon John" <simoninusa2...@yahoo.co.uk> writes:

>> I still love Perl, it's a bit of an art form, as "there's more than
>> one way to do it", whereas Python usually only allows one way to do
>> it, which may or may not be a better mantra....

> The Python mantra leads to 1) less programmer overhead, and 2) faster
> improvements in the language.

> To be a Perl expert, you have to know which of the many ways to do
> various things is the fasted under what conditions.

Why?

> Python programmers
> seldom have to worry about that - there's usually only one [obvious]
> way to do things, so you just do it that way.

I doubt that :-D. I have never seen a programming language that forced
me in such a way :-D.

> Having only one obvious way

I doubt that too ;-)

> to do things means developers only have to
> worry about impact on that way when making improvements, which will
> speed them up.

Yeah, Perl programmers are extremely slow ;-)

> The problem these days is that there are now multiple ways to do a
> variety of things, because we have the "new, pythonic" way and the
> "old, backwards-compatible way". So it's no longer clear which is the
> fastest -

In most cases, why worry? If speed is an issue you should probably have
picked a different programming language in the first place (for that
part of the code).

> and in the case of generators versus list comprehensions,
> it's not clear which you should be using. To bad.

Use the one that is the easiest to read and understand by yourself.
That's how I program Perl, and that's how I am going to program Python.

An overloaded toolbox doesn't mean that if you have to hang a painting
on the wall that you have to think for 6 hours which tool you should
use. You just take the one that does the job in a way you feel
comfortable with. I know that the Perl mantra is often misunderstood,
but in my experience only by people who have very little experience with
the language.

--
John                               MexIT: http://johnbokma.com/mexit/
                           personal page:       http://johnbokma.com/
        Experienced programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif K-Brooks  
View profile  
 More options Apr 23 2005, 6:40 pm
Newsgroups: comp.lang.python
From: Leif K-Brooks <eurl...@ecritters.biz>
Date: Sat, 23 Apr 2005 22:40:09 GMT
Local: Sat, Apr 23 2005 6:40 pm
Subject: Re: Python or PHP?

John Bokma wrote:
> Not. Perl and Java use similar methods where one can specify place holders,
> and pass on the data unescaped. But still injection is possible.

How?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Bokma  
View profile  
 More options Apr 23 2005, 6:55 pm
Newsgroups: comp.lang.python
From: John Bokma <postmas...@castleamber.com>
Date: 23 Apr 2005 22:55:50 GMT
Local: Sat, Apr 23 2005 6:55 pm
Subject: Re: Python or PHP?

Leif K-Brooks wrote:
> John Bokma wrote:
>> Not. Perl and Java use similar methods where one can specify place
>> holders, and pass on the data unescaped. But still injection is
>> possible.

> How?

my $sort = $cgi->param( "sort" );
my $query = "SELECT * FROM table WHERE id=? ORDER BY $sort";

--
John                               MexIT: http://johnbokma.com/mexit/
                           personal page:       http://johnbokma.com/
        Experienced programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif K-Brooks  
View profile  
 More options Apr 23 2005, 7:13 pm
Newsgroups: comp.lang.python
From: Leif K-Brooks <eurl...@ecritters.biz>
Date: Sat, 23 Apr 2005 23:13:20 GMT
Local: Sat, Apr 23 2005 7:13 pm
Subject: Re: Python or PHP?

John Bokma wrote:
> my $sort = $cgi->param( "sort" );
> my $query = "SELECT * FROM table WHERE id=? ORDER BY $sort";

And the equivalent Python code:

cursor.execute('SELECT * FROM table WHERE id=%%s ORDER BY %s' % sort,
[some_id])

You're right, of course, about being *able* to write code with SQL
injection vulnerabilities in Python. But it's not even close to being as
easy as in PHP.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif Biberg Kristensen  
View profile  
 More options Apr 23 2005, 7:35 pm
Newsgroups: comp.lang.python
From: Leif Biberg Kristensen <ab...@solumslekt.org>
Date: Sun, 24 Apr 2005 01:35:31 +0200
Local: Sat, Apr 23 2005 7:35 pm
Subject: Re: Python or PHP?
Leif K-Brooks skrev:

> But Python's DB-API (the standard way to connect to an SQL database
> from Python) makes escaping SQL strings automatic. You can do this:

> cursor.execute('UPDATE foo SET bar=%s WHERE id=%s', ["foo'bar", 123])

So. I've been writing SQL queries in Python like this, using PostgreSQL
and psycopg:

cursor.execute("select * from foo where bar=%s" % baz)

Is that wrong, and how should I have been supposed to know that this is
bad syntax? No doc I have seen actually has told me so.
--
Leif Biberg Kristensen
http://solumslekt.org/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Ammon  
View profile  
 More options Apr 23 2005, 9:08 pm
Newsgroups: comp.lang.python
From: Peter Ammon <gersh...@splintermac.com>
Date: Sat, 23 Apr 2005 18:08:04 -0700
Local: Sat, Apr 23 2005 9:08 pm
Subject: Re: Python or PHP?

I'm bewildered why you haven't mentioned magic quotes.  A one line
change to the configuration file can render your PHP site almost
entirely immune to SQL injection attacks.

-Peter

--
Pull out a splinter to reply.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Meyer  
View profile  
 More options Apr 23 2005, 9:22 pm
Newsgroups: comp.lang.python
From: Mike Meyer <m...@mired.org>
Date: Sat, 23 Apr 2005 20:22:03 -0500
Local: Sat, Apr 23 2005 9:22 pm
Subject: Re: Python or PHP?

One of the stated conditions for more than one Perl position I've
looked at.

>> Python programmers
>> seldom have to worry about that - there's usually only one [obvious]
>> way to do things, so you just do it that way.

> I doubt that :-D. I have never seen a programming language that forced
> me in such a way :-D.

I'd say you haven't seen a lot of languages - including Python. COBOL,
Eiffel, Rexx, Scheme, APL and a few others come to mind as "there's
usually only one way to do things". Python is one of them.

As a programmer, I find this very *freeing*. I can quite worrying
about implementation minutia - just do things the obvious way - and
worry instead about the "big picture"

>> Having only one obvious way
> I doubt that too ;-)

Try programming in older Python for a while. You'll quit doubting it.

>> to do things means developers only have to
>> worry about impact on that way when making improvements, which will
>> speed them up.
> Yeah, Perl programmers are extremely slow ;-)

Nah, they aren't slow. They just have to worry about more things than
the Python developers.

>> The problem these days is that there are now multiple ways to do a
>> variety of things, because we have the "new, pythonic" way and the
>> "old, backwards-compatible way". So it's no longer clear which is the
>> fastest -
> In most cases, why worry? If speed is an issue you should probably have
> picked a different programming language in the first place (for that
> part of the code).

You apparently haven't been programming in Python very long. If speed
is an issue, you should probably pick a different
algorithm. Well-written Python programs use the C-coded parts of
Python for the time-critical part of the code.

>> and in the case of generators versus list comprehensions,
>> it's not clear which you should be using. To bad.
> Use the one that is the easiest to read and understand by yourself.
> That's how I program Perl, and that's how I am going to program Python.

The thing is, in Python there usually is one obvious way to do
things. That's changed in recent years as improvements have been added
without dropping the features they replaced so as not to break old
programs.

> An overloaded toolbox doesn't mean that if you have to hang a painting
> on the wall that you have to think for 6 hours which tool you should
> use. You just take the one that does the job in a way you feel
> comfortable with. I know that the Perl mantra is often misunderstood,
> but in my experience only by people who have very little experience with
> the language.

The problem with using "the way you feel comfortable with" is that it
may not be comfortable for the maintainer - even if that's you six
months from now. My Perl evolved from very shell script like (lots of
backticks and passing around the full text of files) to one more
C-like as I used the language. That change was largely driven by
performance concerns as my understanding of the language grew.

            <mike
--
Mike Meyer <m...@mired.org>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 68   Newer >
« Back to Discussions « Newer topic     Older topic »