
|
View Full Version : Why PHP
oletom 03-07-2004, 10:15 AM Hi All :)
I spent a really long time learning perl just when I get the hang of it everyone starts changeing to PHP . What makes it so much better Perl has worked fine for years :confused:
Rob83 03-07-2004, 10:24 AM php isn't as intensive on the system as PERL is.
Php is pretty good at telling you were you f-ed up in the script, while Perl just likes to spit out a 500 Internal Error (unless you do perl -c test.pl in ssh)
php is easier to compile and ugprade as they continue to release different versions and fix their bugs.
php is faster and better to use in conjuction with MySQL.
Rich2k 03-07-2004, 11:04 AM Perl is a scripting language which just so happens to be used for the web, PHP is a web based scripting language first and then second come it's other uses e.g. command line interface, GTK, etc.
With that in mind in then becomes easier to see why a lot of specific web based functions are built into PHP whereas in Perl you need to go and find a lot of perl modules for it or code it yourself!
If you know Perl you won't find it hard to code PHP, personally I moved from Perl to PHP, I still do a bit of Perl coding but nothing like I used to.
hycloud 03-07-2004, 11:23 AM PHP is a much better and nicer language to learn than Perl. Perl makes you develop bad programming habits. PHP basically took all the nice things from Perl and C, and combine them. I love the PHP language.
Knogle 03-07-2004, 12:31 PM This post should be in the programming discussion forum. :)
On that note, why not ASP, ASP.NET, or JSP? ;)
phpcoder 03-07-2004, 01:15 PM PHP is easier to learn and create "smaller" script that it is to create a script in perl... at least I thought so :p
Rich2k 03-07-2004, 02:05 PM JSP in my opinion is far too complicated for your average coder to pick up easily... it's on a par with things like C++ for complexity.
However ASP.net is of a remarkably different idea.. sure it has J# capability but different types of people tend to go for the .net architecture. I program VB.net for windows but I'm really not a fan of ASP.net
projo 03-07-2004, 02:11 PM I had lots of money in Perl books and even a great Perl domain name (perldiving) and switched to PHP. I am much more productive in PHP.
PHP is definitely in the lead. If you look at script archieves such as hotscripts.com you will see PHP scripts 2 to 1 over Perl scripts. Perl use to represent the leading contributions but no more.
Perlboy 03-07-2004, 07:14 PM So, a language is "successful" when it has the highest number of scripts on HotScripts? Give me a break. PHP has to be the most poorly designed and developed language that ever became mainstream.
PHP is faster than standard Perl because it's an Apache module. Use mod_perl and the speed difference is much smaller.
PHP has a history of allowing script writers to write poor code and get away with it. As a system administrator I've come across hundreds of scripts written by Joe Bloggs who thought he could code (because PHP made it so easy) and subsequently his script was exploitable. I mean, what kind of moron sets form variables to global $variables? That has to be the most ludicrous idea in programming history. Sure, you can disable it but WHY did it exist in the first place?
PHP until recently had no reliable module implementation. As far as I'm aware it's still very limited in nature. For example, if you want to add Curl or Mcrypt support you have to recompile your PHP install (assuming you hadn't compiled it initially with the options of course). Perl on the other hand is a simple install Module::Name away.
Productivity != Better. It generally equals lower overall security. To all those PHP coders, if you think you can code PHP quicker than Perl then you're not writing securely enough. All I can say is, Lucky you're not on any system I admin.
Just my 2c,
Stuart
Rich2k 03-07-2004, 07:39 PM Just because some people don't know how to write code, or write is securely is not a reason to dismiss a language.
Perl is MUCH more dangerous to a system than PHP can be (if installed with security in mind). I've also managed to take down entire servers with simple coding bugs in Perl, but never so far in PHP as it has a script execution timeout (of course on development servers, never live servers ;) )
No-one should be selling scripts that rely on register_globals being on as it's just too easy to exploit.... people who are doing that should read the PHP manual a bit more carefully. It's not the PHP project's fault that some programmers have no idea what they are doing.
I can see why register globals was a nice idea at the beginning. You can still code security even with using register_globals as a method of setting your variables, but it take one heck of a lot longer than just using the super global arrays.
Out of interest if you think PHP is the worst designed language, and you prefer Perl... why is your site in PHP? Not a critisism, just curious.
Perlboy 03-07-2004, 07:48 PM Originally posted by Rich2k
Perl is MUCH more dangerous to a system than PHP can be (if installed with security in mind). I've also managed to take down entire servers with simple coding bugs in Perl, but never so far in PHP as it has a script execution timeout (of course on development servers, never live servers ;) )
Using a Kernel based process watcher can and will minimize Perl scripts getting out of hand (and you'll be able to monitor EXACTLY which user caused the problems).
No-one should be selling scripts that rely on register_globals being on as it's just too easy to exploit.... people who are doing that should read the PHP manual a bit more carefully. It's not the PHP project's fault that some programmers have no idea what they are doing.
*cough* Modernbill still relies on it (you don't receive orders otherwise). OSCommerce still needs it to. There's a bunch of other scripts but I couldn't be bothered looking them up.
I can see why register globals was a nice idea at the beginning. You can still code security even with using register_globals as a method of setting your variables, but it take one heck of a lot longer than just using the super global arrays.
I can't. Register globals was a nice idea at the beginning because no other language had made the "mistake" doing so.
Out of interest if you think PHP is the worst designed language, and you prefer Perl... why is your site in PHP? Not a critisism, just curious.
Serverpeak.com was coded by another web developer. He prefers PHP although I believe the extensions are kind of pointless since there isn't PHP specific code in there.
Seekbrain.com has the PHP gallery software but uses Moveable Type (Perl CMS) for post management.
Stuart
anlene 03-07-2004, 10:04 PM ahh.. a dangerous thread..
What i can say is, if you suspect PHP's abilities, then go ahead and learn other language.
I'll be happily waiting for PHP5 release which IMO, is difficult for me to write ugly code anymore.
And if you ask me, it just taste better... :pray:
Amish_Geek 03-07-2004, 10:14 PM Perl is Old, PHP is new... people like going with newer technologies.
Personally, I like PHP because its what I'm most familiar with. I'm not going to waste time learning perl when I already know PHP.
projo 03-07-2004, 10:42 PM Originally posted by Perlboy
So, a language is "successful" when it has the highest number of scripts on HotScripts? Give me a break. PHP has to be the most poorly designed and developed language that ever became mainstream.
I programmed in Perl for about 2 years and really liked it. I was an advocate and would talk about it in elevators to strangers. I even gave a paper on the potential of Perl in the academic environment (doesn't make me an expert, just means I liked it and had an opinion). I am still impressed with the features and strength of Perl. I could easily believe that it is a better designed and developed language. So what, I like what I like and I prefer PHP for web development, and so do what appears to be 2 PHP/Perl scriptwriters out of 3.
I think that every web developer should eventually become familiar enough with Perl to make minor modifications and configurations. I just don't think it should be one of the first 3 languages investigated or learned.
I agree with you that PHP is mainstream. I additionally believe it is the most successful (based upon popularity) web development language. And here is the big one: I additionally believe that anyone managing a web site for other people is more likely to run across PHP scripts than Perl scripts.
And as far as a break is concerned, send me your address and I will send you a coupon for a free coffee break. :)
Sizzly 03-07-2004, 10:52 PM PHP is great for rapid development. You don't need to define variables, so many functions are built-in, it's like it does everything for you automatically. I can just think up whatever I want, write it down in PHP, and GO! :)
On the other hand, I think of Perl as being a very stable and professional language. But 500 errors have made me sick of trying to use it.
Neo3Net 03-08-2004, 12:20 AM Perl was not built for the web. PHP was built for the web.
I love PHP, it is easy to do anything, but you must practice good coding skills and although PHP is a wonderful language it is built horribly. Its function library isn't even consistent. Some are lowercase some are uppercase some have underscores some don't.
acidHL 03-09-2004, 07:26 AM Originally posted by Neo3Net
Perl was not built for the web. PHP was built for the web.
This guy has got the right idea. You can't compare them.
For example - if you wanted to do a lot of system based coding you would choose perl over PHP right?
Why use Perl for web scripting? Your just making it hard on yourself.
BOTH are great languages, the key isn't using whats "better", its using the correct language for the job.
Rich2k 03-09-2004, 09:13 AM Possibly, except PHP does now have a command line interface so you can use it for system programming too now.
ProgramGeek 03-09-2004, 10:07 AM As for using ASP or at that, anything .net on a server. Microsoft scares me. That's all i can say...
Steve-PWH 03-09-2004, 01:06 PM Originally posted by Rich2k
Possibly, except PHP does now have a command line interface so you can use it for system programming too now.
Only is u mad, stupid or off ur rocker
Yeah PHP is good for the web but its to loose by far and defo not for system programming
As Perlboy said, They code some PHP and think they PHP coders, I have seen some discusting code in PHP aps but PHP lets u get away with it
Where the statement
use strict;
In PERL means u do it right (Infact all PERL should be coded under strict)
inFused 03-09-2004, 05:10 PM Originally posted by Rich2k
Just because some people don't know how to write code, or write is securely is not a reason to dismiss a language.
Perl is MUCH more dangerous to a system than PHP can be (if installed with security in mind). I've also managed to take down entire servers with simple coding bugs in Perl, but never so far in PHP as it has a script execution timeout (of course on development servers, never live servers ;) )
That's true, ofcourse, if you're coding in Perl, you could add in your own timeout system.
I know both PHP and Perl. I use PHP for web based applications (as that was PHP's original intention), and Perl for system applications. Both languages are robust, and they both have their pros and cons.
unlucky1 03-09-2004, 06:52 PM Never used PERL but I will say I have seen some really horrible code in PHP. As far as using global variables, I don't know what to say. I've personally never used them since my days of pascal or ada programming; I hold them on the same par as using a goto. It all boils down to the programmer. If you have learned programming from a book and not just from sitting there manipulating some script you are much better off with a good foundation, but it's not mandatory.
Rich2k 03-10-2004, 05:51 AM I used to use globals in the early days before PHP 4.1.0 but ever since programming commerical software in PHP I've used the super global arrays instead.
Personally I've never used the command line interface to PHP, I just know that it's there ;) I still use Perl for that.
|