php vs python

Guillaume Bog guibog at gmail.com
Sun May 25 23:33:35 EDT 2008


On Mon, May 26, 2008 at 8:12 AM, Jerry Stuckle <jstucklex at attglobal.net>
wrote:

> Ivan Illarionov wrote:
>
>> On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote:
>>
>>> Not at all.  I do it every day.
>>>
>>> And BTW - yes, I write Python, also.  But I find I can write better,
>>> faster code in PHP.
>>>
>>
>> I find I can write better code in Python. Maybe it's just a matter of
>> personal preference?
>>
>>  Do you write PHP?
>>>
>> I did. And I hated it very much. I hated it so much that even I had few
>> Python scripts that generated PHP for me when it was possible.
>>
>>
> So you really don't write PHP.  Enough said.


I write or review PHP code everyday. While much can be done in PHP5 I still
feel Python has a cleaner definition and therefore allows writing faster
clean code.

I many places around I see people saying "doing XX is evil" or "YY
tool/function is now on my blacklist". Most of the time it is because of an
undocumented bug, unpredictable side-effect, or obscure security issue. This
propagates fears, and fears are not, in my opinion and experience, the best
companion of developers. It makes you stick on only the domain you know, and
write code very slowly and defensively. Fear comes from what we don't
understand. Take Regexp for example: when I came first to my current job,
nobody used them, everyone feared them, because Regexp can "bite" (i.e. do
something strange you cannot explain easily). After some time and patiently
explain Regexp sample to my teammates, everyone now want to play with them
(even when using them makes no sense).

If a language makes their users more confident and propagates less fears, I
would say it is better than the others in this respect. PHP has a good
documentation with user comments, which makes me more confident (I'll find a
solution) but, in my opinion, Python is better in this respect because the
way it has been crafted makes me more confident. (Often, when I open a PHP
application, the first 100 lines will be defensive stuff against
magic_quotes or other weird settings, while when I open Python third-party
modules, the first lines are most often nice docstrings, and the next lines
are easy to decipher classes and functions just doing the work.)

PHP did bite me hard (like a wild dog) at least once (postgreSQL NULL values
fetched through pg_fetch_object were both null and not null !... the bug was
very hard to find)

ASP / MSSQL did bite me a lot (like a dangerous snake) with undocumented
bugs, and so on.

Javascript can bite (like a wild cat) but can be domesticated through
frameworks like prototype.js

CSS can bite while HTML usually can't

As everyone knows pythons doesn't bite! (Or at least didn't bite me yet.)


>
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex at attglobal.net
> ==================
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080526/970fbcf4/attachment-0001.html>


More information about the Python-list mailing list