Re: Re: Re: Re: php-cli vs python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Admittedly, there are some annoying features of PHP, the most
annoying one being its "dynamic" typing (opposed to "weak" typing).

I think its worth mentioning that 'dynamic' and 'weak' typing both refer to
type checking, yet they refer to different aspects of type checking.
a lanuguage is either dynamically or statically typed and either weakly or
strongly typed, going by wikipedia:
http://en.wikipedia.org/wiki/Type_checking#Type_checking

and PHP is supposedly dynamically, weakly typed
http://en.wikipedia.org/wiki/Php

python apparently uses duck typing
http://en.wikipedia.org/wiki/Python_(programming_language)
http://en.wikipedia.org/wiki/Duck_typing

all based on wikipedia; take it or leave i guess.

anyway on the topic, ive never used python, but i run gentoo and portage is
written in python.
since i intend to dig into portage at some point, i will envitably have to
dig into to python as well.

php does have some annoyances, but i find they can almost always be handled
with a workaround even if an unattractive solution has to be implemented.
the funny thing about this topic is, i typically find myself comparing php
to java.

-nathan

On 6/9/07, Abdullah Ramazanoglu <ar018@xxxxxxxxx> wrote:

Crayon Shin Chan dedi ki:
> On Friday 08 June 2007 04:10, Abdullah Ramazanoglu wrote:
>
>> I found one intersting item though: Under the "What does Python have
>> that PHP doesn't?" header, there's a bullet stating that "support for
>> all major GUI frameworks". I know that both php and python have support
>> for gtk. Am I to understand from this statement that python has also
>> support for qt?
>
> Yes, it's called PyQT. For purely non-web work Python beats PHP hands
> down. Plus it runs on more platforms.

Thank you Crayon,

PyQT seems really cool (I like Qt better :)

For the part regarding Python beating PHP on the CLI/GUI, I've been
thinking about this. I might be totally wrong, but I tend to view it like
this:

In order to make a long term decision about a language, I dissect the core
language itself and its "family" (libraries, dev tools, etc. but mainly
libraries). All languages evolve, but their starting point both gives them
a head start in their particular problem domain, and also it defines how
far the language can evolve into other problem domains. E.g. it's
difficult for Perl to evolve into a PHP-like web programming language.

Now, with Python and PHP, I think both evolves into the other's problem
domain. How successful and how far they will be in doing this, might
revolve around 3 points:
1. Their core quality (language specs)
2. The distance of their starting point to the point they evolve into.
3. Library support (coupled with gaining popularity in the target domain)

As for the 1st point, I can't talk much, as I'm a Python illiterate and
PHP
newbie. Nevertheless, there are subjective opinions about Python
being "beautiful", "cool", "elegant" etc. but they are not very
quantitative. I'm yet to see a quantitative solid example demonstrating
the advantages of Python against PHP regarding their core language
qualities. Admittedly, there are some annoying features of PHP, the most
annoying one being its "dynamic" typing (opposed to "weak" typing).
Sometimes I need to fight against PHP to protect my data from being
spoiled by PHP's high-level eager assumptions. But I guess it's the way
it's supposed to be in any high level language - be it PHP or Python. PHP
is not C, neither is Python.

As for the second point, PHP seems to have an advantage over Python here,
because (CLI/GUI library support aside) it's quite a decent language to
write programs for general purpose problem domain. At least it satisfies
my current expectations in that regard. So, while I find PHP core an
adequate language for general purpose programming, I don't know how
satisfying Python is in web programming domain. I know from a distance
that it has issues like lacking "safe-mode" equivalent, built-in sessions,
etc. But given enough evolution and libraries, I'm sure Python would be a
contender in web programming domain.

This brings me to the third point, library support and developer
popularity. Both feeds back the other: Library support encourages
developers to use the language in other domains, and developer popularity
(or demand) paves the way for library support to get better and better,
thus it can evolve as far as core language specs don't become a hindrance.
Currently, CLI/GUI library support for PHP is not as powerful as Python's.
I accept this and I expect this: PHP-CLI is just taking off. Currently its
usage is also low (I'm the sole bug submitter for php-newt library) but
I'm trying to see what it would be like in 5 years' time. If CLI/GUI
library support gets on par with Python's, then what's the point for me to
(fail to) master two similar languages instead of really mastering just
one?

It might be said that then I can equally start with Python, using the same
logic. True. But currently, I perceive PHP as more satisfying on the CLI
than Python on the web. So I perceive I can more successfully use PHP as a
dual domain language than Python. So, presuming that both languages will
evolve quite close to each other in the future, I can start with which one
better satisfies my current needs. That's roughly why I'm more and more in
favor of PHP. At least I think I can wait till I can justify to myself
adopting multiple similar, high-level scripting languages.

Sure, I'm concerned (much concerned) with non-web library support and
developer adoption of PHP - just like I'd have been concerned with
Python's web-support if I were going with Pyhon.

As I've said earlier, this is all IMHO, and I might be totally wrong.

Kind regards,
--
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux