![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 17
Rep Power: 0
![]() |
perl and php
can perl do pretty much everything php can?
is it an effective decision to learn perl in this manner? |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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!
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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
|
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 321
Rep Power: 4
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|