Print

Print


Olá, como vai?

Luciano Ramalho <[log in to unmask]> wrote:
> Actually, Python is a general purpose programming language. It was not
> created specifically for server side scripting like PHP was. But it is
> very suitable to that task.

I'm not sure talking about what something used to be is as interesting
as talking about what it is. Both Pyhton and PHP can share whatever
moniker we choose (scripting-language, programming language,
real-time, half-time, bytecoded, virtual, etc.).

>> Not seen any scientific packages, but I've seen a few ray-tracers,
>> although they're all demo apps and fun toys (although I think that
>> applies to Python, too).
>
> No, that does not apply to Python. Python is widely used for hardcore
> scientific computing.

I was referring to the ray-tracing part.

> It is also the most important scripting language in large scale CGI
> settings

Yes, Python is widely used for scripting up interfaces into other more
complex systems. But rarely is the core of the thing written entirely
in Python.

>> Maybe your Google-foo is weak. :)
>
> Or maybe he's just realizing that outside of server side web
> scripting, PHP is just not so widely used.

Absolutely, and fair enough.

> Having used both languages, I discovered that Python is easier for
> most tasks, and one reason is that the libraries that come with Python
> are extremely robust, well tested and consistent.

Hmm. PHP is extremely robust and well-tested, but yes, it's not all
that consistent, especially not before version 5.2+. However, things
have moved on, and with release 6 around the corner things will be
tighter still. Just like the first versions of Python were
interesting, so was PHP's, but where the biggest problem with the
evolution of PHP was the very fact that it was the most popular
language for rapid web development by far.

> PHP is very
> practical for server-side web scripting, but it's libraries are
> unfortunately full of gotchas, traps and unexpected behaviour.

There's gotchas in every language, even Python.

> A key reason for that is the fact that Python has always had an
> exception-handling mechanism while PHP has grown something like that
> only a few years ago

True enough. But earlier versions of any language are less desirable
than the latest versions, so I'm not sure this is a prevailing
argument for the horribleness of PHP or any language. These things
evolve. PHP 5.3+ and soon 6 are looking very good, indeed, but yes, we
will just have to live with a poor reputation brought on by the big
number of users and the pre 5.2+ era.

> So, I my opinion, PHP is great at what it does best: enabling quick
> server-side Web scripting on almost any hosting service on Earth.

I'm fairly sure you can say that because you haven't done much other
kind of PHP work. :)

> For everything else, it is very worthwhile to learn and use a general
> purpose dynamic language such as Python, Ruby or Perl.

Of course. Developers should learn many of languages, and choose
wisely the language best suited to the problem at hand.

> Sorry for the rant. I must confess I am a founder of the Brazilian
> Python Association and was its first president, so you can call me a
> Python advocate.

No bias at all, really. :)


Kind regards,

Alex
-- 
 Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps
--- http://shelter.nu/blog/ ----------------------------------------------
------------------ http://www.google.com/profiles/alexander.johannesen ---