Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python as replacement for PHP?

Reply
Thread Tools

Python as replacement for PHP?

 
 
David M. Cooke
Guest
Posts: n/a
 
      03-04-2004
At some point, Paul Rubin <http://> wrote:
> (Paul Boddie) writes:
>> Really? At the fundamental level, the DB-API is pretty well
>> standardised, and there's a collection of well-written modules that
>> mostly adhere to it.

>
> Nope. Look in the Python distribution, there's nothing like that
> there, and similarly in the Python reference manual. Yeah, there's
> some random third party modules and docs, but see above, those don't
> exist .


http://python.org/peps/pep-0249.html

PEP 249 is the DB-API. Ok, so it's not in the standard distribution --
as you said, there aren't any (SQL) database modules in the standard
distribution [1]. But this is the standard API for database interfacing
(and it's not a third-party API, either). Most third-party modules
conform to it (except for weird or old ones).

[1] maybe gadfly will get added at some point, though.

And hey, if you're choosing a database module, you've got to have
already chosen a database -- MySQL, PostgreSQL, SQLite, etc. This is a
bigger choice than "how do I talk to it." The Python DB-API makes it
relatively easy to write code where the difference in talking to
different databases is only in your SQL, and not how you call it.

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
 
Reply With Quote
 
 
 
 
Paul Rubin
Guest
Posts: n/a
 
      03-05-2004
cookedm+ (David M. Cooke) writes:
> http://python.org/peps/pep-0249.html
>
> PEP 249 is the DB-API.


That's an informational PEP, which implementations can follow or ignore
as they please.

> Ok, so it's not in the standard distribution -- as you said, there
> aren't any (SQL) database modules in the standard distribution
> [1]. But this is the standard API for database interfacing (and it's
> not a third-party API, either). Most third-party modules conform to
> it (except for weird or old ones).


Yes, but once you add such a module, you're no longer comparing PHP to
Python. You're comparing PHP to {Python plus some third party package
whose stability etc. you have to evaluate from scratch}. That's an
issue that people trying to deploy real-world production servers care
about regardless of how much academics and hobbyists tend to brush it
off.

> And hey, if you're choosing a database module, you've got to have
> already chosen a database -- MySQL, PostgreSQL, SQLite, etc. This is a
> bigger choice than "how do I talk to it." The Python DB-API makes it
> relatively easy to write code where the difference in talking to
> different databases is only in your SQL, and not how you call it.


No, the DB-API doesn't help you write code at all. It's the DB-API
plus it's implementation that lets you write code. The implementation
doesn't come with Python, so you have to look elsewhere for it.

Look, I'm not exactly singing the praises of PHP; there's lots of
things they could have done right and didn't, and it's nowhere near as
good a general purpose development language as Python. But it was
written for a specific task that it handles pretty well out of the
box, that Python doesn't handle at all unless you add complex
additional modules maintained by outsiders. Brushing that off and
saying "Spyce, CherryPy, etc. are all out there, just download them"
is only a matter of degrees better than responding to "Program XYZ is
full of bugs and crashes all the time and the developers ignore
everyone" with "that's no big deal, it's open source, you can fix the
bugs yourself and then it will be fine".
 
Reply With Quote
 
 
 
 
R. Rajesh Jeba Anbiah
Guest
Posts: n/a
 
      03-05-2004
Peter Maas <> wrote in message news:<c27lfc$5kq$>...
> R. Rajesh Jeba Anbiah schrieb:
> > If you do *programming* without knowing what to pass to a
> > function
> > or what a function returns, you're a complete idiot as a idiot can be.
> > Moreover, if you take it as an argument against PHP, you're yet
> > another ignorant and obviously you don't have any rights to speak
> > about PHP nor anything.

>
> Excuse me ... Does the life of your children depend on a friendly.
> reception of PHP?


Sorry, I couldn't understand what do you mean here (My first
language is Tamil)

> I'm just searching a reason for your aggressiveness.


No need to embarrass yourself by researching; I've already said the
reason. Did you read the thread actually?

> Never saw that in c.l.py.


Might be some problem with your news server. Perhaps you should
read the thread first
<http://groups.google.com/groups?threadm=403fa54b%40news.zianet.com>

> Mit freundlichen Gruessen,


நட்புடன்

HAND.

--
From comp.lang.php
"I don't believe in the God who doesn't give me food, but shows me
heaven!"--Swami Vivekanandha
If you live in USA, please support John Edwards.
Email: rrjanbiah-at-Y!com
 
Reply With Quote
 
R. Rajesh Jeba Anbiah
Guest
Posts: n/a
 
      03-05-2004
Ville Vainio <> wrote in message news:<>...
> >>>>> "R" == R Rajesh Jeba Anbiah <> writes:

>
> R> If you do *programming* without knowing what to pass to a
> R> function or what a function returns, you're a complete idiot as
> R> a idiot can be. Moreover, if you take it as an argument
>
> Occasionally, in absence of static typing, you might accidentally call
> a function using a return value of another function as an argument and
> they are not compatible. W/ python you notice it immediately; with PHP
> or Perl your program starts behaving weirdly (if you don't check
> return values that is) and you can't pinpoint exactly what went
> wrong. This is what makes people run to statically typed languages,
> believing that all dynamic typing is shoddy like this.
>
> R> against PHP, you're yet another ignorant and obviously you
> R> don't have any rights to speak about PHP nor anything.
>
> I wasn't really talking about PHP, but the approach you took to attack
> the arguments of OP (arguments which I agree w/ BTW, but that's
> another story).
>
> R> Yes, people with functioning brain may already conculded that
> R> when you posted your previous message itself.
>
> Previous message? The one you were replying to was the first I posted
> to this thread.


Obviously, you should know what you're doing
(<http://groups.google.com/groups?threadm=403fa54b%40news.zianet.com>)
And, please find some time to learn about the error reporting or error
handling mechanism of the languages before throwing your comments.
(Hint: Your comments clearly shows your ignorance in one or more
languages)

HTH. HAND.

--
From comp.lang.php
"I don't believe in the God who doesn't give me food, but shows me
heaven!"--Swami Vivekanandha
If you live in USA, please support John Edwards.
Email: rrjanbiah-at-Y!com
 
Reply With Quote
 
Paul Boddie
Guest
Posts: n/a
 
      03-05-2004
Paul Rubin <http://> wrote in message news:<>...
>
> Yes, but once you add such a module, you're no longer comparing PHP to
> Python. You're comparing PHP to {Python plus some third party package
> whose stability etc. you have to evaluate from scratch}. That's an
> issue that people trying to deploy real-world production servers care
> about regardless of how much academics and hobbyists tend to brush it
> off.


So how does it all work when you're deploying something in, say, C or
C++? Those languages don't give you anything above and beyond basic
input/output support and some nice data structures (if you're lucky).
Now, I know that the average Microsoft shop will then state that
they're really developing something with Visual Studio and the usual
Microsoft libraries, and that supposedly gives you the "comfort" of
having Microsoft responsible for everything, but even then you're
likely to run out of road at some point. What kind of pitch do you
make to management then, or has management already attained "buzzword
bingo" by that stage?

> cookedm+ (David M. Cooke) writes:
> >
> > And hey, if you're choosing a database module, you've got to have
> > already chosen a database -- MySQL, PostgreSQL, SQLite, etc. This is a
> > bigger choice than "how do I talk to it." The Python DB-API makes it
> > relatively easy to write code where the difference in talking to
> > different databases is only in your SQL, and not how you call it.

>
> No, the DB-API doesn't help you write code at all. It's the DB-API
> plus it's implementation that lets you write code. The implementation
> doesn't come with Python, so you have to look elsewhere for it.


So, you're worried about compliance, support, maintenance and so on.
What about stuff like mxODBC? Do you think that there's a real market
opportunity for supported super-distributions of Python, like
ActivePython but with a broader scope?

["complex additional modules maintained by outsiders"]

> Brushing that off and saying "Spyce, CherryPy, etc. are all out there, just
> download them"


Well, that was a suggestion that things exist which potentially do
PHP-like stuff as easily as PHP makes it happen. I can't confirm that,
though, since I'm not really impressed by the PHP/ASP style of
development and not inclined to experiment in depth with those
technologies just to be able to tell someone what they should be using
when they'd get a much better understanding by looking into the matter
themselves.

> is only a matter of degrees better than responding to "Program XYZ is
> full of bugs and crashes all the time and the developers ignore
> everyone" with "that's no big deal, it's open source, you can fix the
> bugs yourself and then it will be fine".


As I'm sure most of us are aware, selecting technologies tends to
involve assessing various factors before dropping those technologies
into our solutions. If "program XYZ" really is that bad, then you
probably don't want to fix it yourself unless there really is nothing
else that comes close to solving the same problems. But at least some
of the Web frameworks can be regarded as being mature enough for real
world use, and the decision to choose one of them can't really be more
involved than that to adopt Python in the first place.

Now, I think you do have a point about the number of technologies and
packages that may need to be combined in order to make a solution, but
I think that this can be addressed by packaging combinations of such
technologies. You see some of this kind of thing with Zope and
derivatives (and even with Apache and PHP, by the way), and it'd be
nice to see the Web-SIG looking into this area, too.

Paul
 
Reply With Quote
 
Brandon Blackmoor
Guest
Posts: n/a
 
      03-07-2004
R. Rajesh Jeba Anbiah wrote:
>
> HTH. HAND.


Is this your signature or nickname, or does it perhaps mean something in
your native language (like "ciao", for example)? I assumed it was your
signature, but it doesn't resemble your name, so I thought it may mean
something else. Perhaps it's like those "geek codes" some people put in
their signatures?

bblackmoor
2004-03-07
 
Reply With Quote
 
Geoff Berrow
Guest
Posts: n/a
 
      03-07-2004
I noticed that Message-ID: <c2g3gb$1sb5fo$>
from Brandon Blackmoor contained the following:

>> HTH. HAND.

>
>Is this your signature or nickname, or does it perhaps mean something in
>your native language (like "ciao", for example)?


Hope This Helps. Have A Nice Day

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: SciPy Core (Numeric Python Replacement) Version 0.4.X (beta)released Travis Oliphant Python 0 09-30-2005 07:30 AM
Python as VBA replacement under Windows? Wolfgang Keller Python 3 08-17-2005 04:07 PM
Python Regular Expressions: re.sub(regex, replacement, subject) Vibha Tripathi Python 3 07-05-2005 07:43 PM
Python as VBA replacement Eugeni Doljenko Python 0 10-05-2004 11:36 AM
XML best practices (was: Python as replacement for PHP?) Cameron Laird XML 3 03-03-2004 09:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57