Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

zdog judges perl vs. php

by zdog (Priest)
on Oct 16, 2000 at 00:31 UTC ( #36827=perlmeditation: print w/ replies, xml ) Need Help??

I hate to be the one to return to this subject which has caused so much ... well, I don't know if fighting is the correct word, maybe arguing, but anyway, you get the point. Recently, I have been looking into the world of PHP. I haven't read much on it but I did read the section on it in O'Reilly's Webmaster in a Nutshell. It went over the basics of it and how it can be embeded and it gave short descriptions of many of its functions. I tried to install php on my Linux box, but I ran into some trouble with Apache, so I haven't been able to experiment with it much.

However, I did go through the Monastery and read some threads comparing Perl with PHP. Among them were php? and Compare Perl vs PHP. I read through them and found that they had many of the same opinions which I had formed before coming to them. So I want to in a post give my own opinions on the subject and I'm sorry if I end up repeating other posts, but hopefully I will be able to express a new perspective on the situation.

In addition to looking at these two languages as programming languages, I want to also look at them as programs in themselves.

Okay. So, you have a program. It works and can do the things you need it to do. However, you want to make it more pleasant to use, so you add some help features and maybe some nice graphics, etc. Correct me if I'm wrong, but as you add to your program, the program becomes less effecient. It still does what you need it to do and more, but the things you wanted to use it for in the first place, slow down with the additions of other features.

For me, the same situation is apparent between Perl and PHP. PHP is basically a good web tool with pretty good form handling capabilties as well as great database tools. Perl can be used for that and much, much more. That is why we refer to Perl as "full featured", or something like that. But, as Perl has more features than PHP, the aspects of Perl that PHP is commonly used for, slow down in Perl. So, even though PHP is much more limited in its usage than Perl, what it can be used for, is more effiecient than the same usages in Perl.

In conclusion, from my evaluation of the situation, I find that it is impossible for one programming language to be the best in everything, because more specialized languages will excel better in there specialty than a "full featured" language does in the same field.

Being the inexperienced programmer that I am, I may be very wrong. If so, can you please tell me that and try to explain to me how I am wrong. Thank you.

Zenon Zabinski | zdog | zdog7@hotmail.com

Comment on zdog judges perl vs. php
RE: zdog judges perl vs. php
by merlyn (Sage) on Oct 16, 2000 at 01:04 UTC
    But, as Perl has more features than PHP, the aspects of Perl that PHP is commonly used for, slow down in Perl.
    Are you just intuiting that, or do you have evidence for that? I'm guessing that's not so, actually, so I'd like to see why you think that.

    -- Randal L. Schwartz, Perl hacker

RE: zdog judges perl vs. php
by extremely (Priest) on Oct 16, 2000 at 01:47 UTC

    Assuming you have no troubles with either install, PHP drops in and starts working a whole lot easier than mod_perl + a content package. If you have troubles with both, PHP is mega easier to deal with.

    Honestly, that is the only thing Perl is slower at, in my real world experience. I've used both, I've installed both multiple times, I keep winding up in mod_perl. I've found that PHP, ColdFusion, and similar systems all make easy things real easy, categories of hard things ok, and everything else fricking impossible. Perl makes easy things ok and everything else possible.

    A quick perusal of both would lead you to believe that PHP is quicker, but in the end, what will make all the difference is how quick you can do the hard stuff, computers today can flood T3s with dynamic content, but developer time is worth thousands of PCs...

    --
    $you = new YOU;
    honk() if $you->love(perl)

      Which is why my cute phrase is "PHP is training wheels without the bicycle". It's seductive, but tops out faster than any serious developer would be happy with. Fine for the casual web-interaction hacker, but if you program more than an hour a day, you'll be frustrated.

      -- Randal L. Schwartz, Perl hacker

        Correction: if you insist on using it exclusively, you will probably run up against its limitations fairly quickly.

        Personally, I like the TMTOWTDI aspect of perl.... I extend that to using other languages where I'm more comfortable doing so.

        So far, I'm not frustrated with php, and I generally code for far more than one hour a day. But, then again, I have perl.... who could be frustrated with perl? :)

      One point, which no-one seems to mention (or, perhaps think worth mentioning).... development time.

      I find that I can code simlar web applications more efficiently (in terms of *my* time) in php than I can in perl. I learned perl and php together, and, in terms of numbers of lines of code, (in my local archve of "completed" work) have done about 50% more perl... so that's not simply because I've worked in php more.

      PHP is limited, but I don't think that this is always a bad thing.

      For myself, if it's displaying on the web, and is quite simple, I use php. If it's not suitable for the combination of my skills, and php, then I'll figure out how to do it in perl. So far, this combination works well...... for me.

(Ovid - why PHP causes discord here) RE: zdog judges perl vs. php
by Ovid (Cardinal) on Oct 16, 2000 at 02:41 UTC
    I hate to be the one to return to this subject which has caused so much ... well, I don't know if fighting is the correct word, maybe arguing, but anyway, you get the point.
    Perhaps the reason it generates so much "discord" is that this site is dedicated to Perl. I'm not trying to be rude, but it appears to me that many come here and try to say "Hey, why aren't you using PHP for such and such?"
    [C]an you please tell me that and try to explain to me how I am wrong.
    zdog, it's not that you are wrong. You are absolutely correct that different languages have different strengths and no language, regardless of its versatility, excels at everything. Perl, for example, is not the best language for rapid GUI prototyping.

    I think the reason PHP generates so much discord is that people come here to discuss Perl, not to have someone come along and say "why don't you use PHP?" Many monks, I suspect, have a fanatical devotion to Perl and will automatically object to PHP. Most, however, are willing to consider alternatives. But they (and I) don't want to see this site turned into PHP Monks and, as a result, will respond accordingly.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

      "Please, please!  This is supposed to be a happy occasion!
            Let's not bicker and argue about who killed who."
      
      
      I agree in part that this is Perlmonks so why are we discussing "Not Perl", I don't know what the approach should be, except it should be uniform.

      Perl has a singular community spirit; Perl Monks is an aspect of that, and it rocks. If other languages lack this; look to Perl, learn, and go build yer own site.

      Were Monks to use another languages, and be swayed, what then? Should we let them evangelize? Is it heresy? No! There was mention of an Off-topic node, PHP would fit in there. As would java, Python, C, Bash, etc.

      In all other manners I agree with Ovid's post and anything else would be corroboration at best and redundant at worst.

      --
      
      Brother Frankus.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://36827]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2014-09-23 01:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls