in reply to Re: Perl Popularity in thread Perl Popularity
If you read carefully, I'm not bad-mouthing other languages. Other language. Specific. PHP. I'm not slagging Python, Ruby, or any other of the interpretive bretheren (although I admit to not liking them - Python's whitespace in particular is a deal breaker).
PHP at a basic level is a similar language to Perl. PHP has emerged from a specific problem domain, and is now being thought of as a general purpose scripting language. My thoughts on PHP mirror RMS' thoughts on TCL - it seems to be a pointless diversion.
If people think PHP is easier to learn than Perl, I think they're wrong. However, that can't be happening through critical analysis, because apart from the specific case of code-in-web-page, Perl wins over PHP. Something else is causing people to think PHP is more suitable for work than Perl, to the extent they discuss it as above.
Re: Re: Re: Perl Popularity
by hardburn (Abbot) on Dec 17, 2003 at 15:08 UTC
|
If people think PHP is easier to learn than Perl, I think they're wrong.
I think they're right. Pick through a copy of the Camel and see how many times they write something like "but be careful not to do x, because that actually does y, and the Earth will crash into the sun". PHP is derived from Perl, but avoids a lot of the shortcuts Perl implemented, so there is less for a new programmer to learn. However, this minefield of shortcuts is what makes Perl so nice to program in once you figure it all out.
Additionally, PHP supports a lot of core functionality that is good for web programming. For instance, although I consider PHP's database layer to be broken, the fact is that it's in the core. The same can't be said for Perl's DBI. Likewise, Perl's CGI.pm is a beast of a module, even if all you really need is param(), header(), and maybe cookie(). PHP web programming tutorials cover those things in their first few chapters, but how many CGI/Perl tutorials out there are still teaching you to parse params by hand?
---- I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
| [reply] [d/l] [select] |
|
Not sure about the Camel - I'm not sure there is a whole load of "don't cross the streams" stuff, although perhaps they do introduce some advanced stuff a little early. But, for example, if you didn't introduce arrays (I don't think PHP has them? Only hashes?) you save a whole load of oddness like $#array. Comparing the languages like-for-like, I think Perl is as easy if not easier in many respects. Maybe there ought to be a 'Really Simple Perl' Guide...
I agree with the benefits of PHP, though. I hate the language, but my rant about it was that there is a real hole it's filling that Perl cannot touch currently, and I don't think it's anything to do with right tool for right job-ism. Your example of CGI is right on the money.
| [reply] |
|
Not sure about the Camel - I'm not sure there is a whole load of "don't cross the streams" stuff, although perhaps they do introduce some advanced stuff a little early.
I mean stuff like the autoincrement operator's magic on strings. If you're a new programmer, you can get along just fine without knowing that. Yet there it is, stuck right in chapter 3.
This is just to say that the Camel (and much of Perl's distribution docs) cover advanced stuff too early to be useful as a newbie guide. There are books that are good for that, though (like "Learning Perl").
if you didn't introduce arrays (I don't think PHP has them?
Hashes are just weird arrays with slow lookup times that allow you to dereference them with a string instead of a number. Of course, I'm hand-waving over a lot of implementation details here.
---- I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
| [reply] [d/l] |
|
I don't think that Perl is easy compared to many other languages, and I certainly don't think Perl is easy to
learn.
But I don't think it's relevant when judging the usefulness
of a language. It's easier to learn to ride a bike that it
is to learn to drive a car. That doesn't mean people ditch
their cars and replace them by bikes. Just because something
is easier to learn, or it's not as rich as Perl doesn't mean
it is as useful. (But that doesn't mean that something that
is more useful is harder to learn).
Abigail
| [reply] |
|
|