Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 7th, 2005, 1:15 AM   #1
bae
Newbie
 
Join Date: Apr 2005
Posts: 17
Rep Power: 0 bae is on a distinguished road
perl and php

can perl do pretty much everything php can?
is it an effective decision to learn perl in this manner?
bae is offline   Reply With Quote
Old Aug 8th, 2005, 1:36 PM   #2
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
Hi,

the one and only answer is: it depends :p

perl is powerful indeed, much more powerful than php. I consider php beeing an ill language. Forgive me guys but php is a degenerated language. It's great to achieve some dynamics in web-stuff but to actually code sth that is worth it beeing called a (web)application it's way to hard to code in php without getting lost. Php is error prone and bloated. Yes u get it i don't like it really. Perl on the other hand is a mighty friend when it comes to some serious problems. Since perl5 it's becoming an OO language too. I never saw cleaner and shorter code than perl-stuff. Btw. perl-hacker can produce the ugliest and obfuscated code on earth as well *gg*.

My vote is: give perl a try if you want more than just developing some dynamic pages on the web, you will not regret it. Use php in the other case. Though perl and the cpan-cgi-package is a good alternative. But remember, unless mod_perl is installed perl will be a bit slower than php as the apache forks off a new process on every call to a script.

my two cents
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Old Aug 8th, 2005, 1:44 PM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
My $.02 is... Perl is more geared for universal scripting where as PHP should be used in the confines of web applications.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Aug 8th, 2005, 6:47 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I have to disagree with you, prolog. Perl is an incredible language. It's brilliant for both quick and dirty scripts and entire applications. However, your post suggests you don't utilise more advanced website programming, such as databases. Built-in database support, image manipulation etc. make PHP ideal for web development. It should be - that's its primary purpose. And hey, it supports regex too!
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 8th, 2005, 7:02 PM   #5
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
Hi,

hey Ooble , i know my post is a bit offending and it's meant to be

I know what php is capable to do and i aggree with what u said. But as u are an experienced php-scripter i believe that you are with me when i say that even you had times when you looked over your code and said: "damn this is anything other than clean or easy to maintain code". PHP has too much ways to do the same things. Though my primary focus lies on development in c++, i'm just a slave as so many out there. I had to use php loads of times. I know how to utilize it, i know how to use databases from within, and as my roots lie in OOP i tried to wrap it all up using the poor class-support of php which is only a mimicri. But i did not critizise the possibilities php gives you, i mainly critisezed the design of this language. It makes it hard to write easy to maintain code for the reasons given and many more. It also lacks a bunch of features i was expecting, but ok i can not expect c++ from sth that is marked to be php. As i stated php is the way to go for dynamic pages in conjunction with datebase and new standards like css2 and xhtml it can be very powerful, but again it is damn ugly.

Hope you got the point as it's , again, hard to explain for me .. as english is not my native language.

So far ...
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Old Aug 11th, 2005, 10:08 AM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I follow, and I mostly agree with what you say. But how can you say the code looks ugly when you're comparing it with Perl? :p
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 11th, 2005, 4:04 PM   #7
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 321
Rep Power: 4 mackenga is on a distinguished road
You can write pretty code in Perl if you want (check out the perl entry on http://www.99-bottles-of-beer.net/ ... not sure if this is an example of pretty Perl or especially ugly perl. Guess it depends on your viewpoint).

Perl does have good database access via the appropriate modules, too. I find the ugliest thing about PHP is something that would be hard to avoid; how do you indent code when you may be generating HTML from inside PHP embedded in HTML? I'm the kind of anal sort of hacker who'd want the indentation to look correct in the generated output, too (though granted, CGI.pm produces ugly HTML too).

I'd say, Perl is bigger than PHP. It can handle more than PHP can. However, if you are happy within PHP's limits, and have to choose one or the other, you'll get up and running with PHP faster. You can always learn Perl later.
mackenga is offline   Reply With Quote
Old Aug 11th, 2005, 4:10 PM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Tabbing's easy: echo "\t";
I'm the same, y'see.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:55 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC