PDA

View Full Version : Perl of PHP - What do you prefer?



ghenry
23rd August 2004, 09:21 AM
I am starting to love Perl.

jimbo
23rd August 2004, 03:39 PM
I really like PHP. Object Oriented and fast, terrific database integration and lot's of good documentation and scripts available. I've been doing all my web programming as well as starting to use it for scripting and haven't found any limitations. I hear you can also do GUI app with it now. I've got to give that a try.

ewdi
23rd August 2004, 03:42 PM
i like php but for shell scripts i rather use perl, perl have more control however need to be careful :) because that control could be double edge sword :)

zylr
23rd August 2004, 03:49 PM
Python.
Its a scripting language like Perl, but it is cleaner, has better OO, has really simple syntax and lots of packages that come with it.
Check it out, its already in Fedora. Type: python at a prompt.
For docs and a really good tutorial, visit the offical Python webpage: www.python.org
:)

earobinson111
23rd August 2004, 03:52 PM
I like python alos, Yet a good programer knows that each language has its pro's and con's so i some times use all 3 of them, but mostly python!!!

crackers
24th August 2004, 04:30 AM
I tend to avoid Perl when possible - I've been subjected to the gawd-awful obfuscation that you can do with it and some of it just made my head hurt - a lot! For the large majority of what I need to do via shells, I just use plain ol' Bash. Right now I don't have a "middle-ground" - but from what I've seen I'd probably lean towards Python. If I can get over code blocks being defined by indentation. BLECH!

zylr
24th August 2004, 03:42 PM
I've been subjected to the gawd-awful obfuscation that you can do with it and some of it just made my head hurt - a lot!
Yup, thats Perl!
But you get so used to the $_ and some other operators. It makes it easy, but in a bad way... A really bad way!

pigpen
24th August 2004, 03:50 PM
I use PHP for web development but also for command line scripting when bash gets too complicated.
Although I'm pretty familiar with PHP by now, I'd like to know more PERL and am really eager to learn Python
(especially when it comes to GUI programming - pygtk comes to mind).

Mat
24th August 2004, 04:36 PM
IMO, i've never seen a "clean" (read: easy to understand) perl script.. I much more prefer tcl.. can be used in cgi's as well and is just lovely :)

zjimward
25th August 2004, 01:39 AM
It's always a matter of taste. I use PHP for web development. For scripting I mostly use Python. I've used perl and written a lot of bash. Scripting and Languages all have good and bad. My rule, is write it so some one else can maintain it and don't go for the tricks to make yourself look smart. It'll byte you in the core dump every time. :rolleyes:

crackers
25th August 2004, 04:30 AM
is write it so some one else can maintain it and don't go for the tricks to make yourself look smart.
Write COMMENTS!!!! That means it also won't get you when you're trying to figure out whatinhell it does 6 months later... :p

zjimward
25th August 2004, 08:11 PM
Write COMMENTS!!!! That means it also won't get you when you're trying to figure out whatinhell it does 6 months later... :p

Comments are great too. Also use variables that make sense and not just x, x, z. Nothing like a loop that contains a = 1 to 500. Much better when it is nEmployees = 1 to 500. Then some one actually knows what it's counting.

crackers
26th August 2004, 04:56 AM
Nothing like a loop that contains a = 1 to 500. Much better when it is nEmployees = 1 to 500. Then some one actually knows what it's counting.
Er, sometimes. Some of us old fogeys still use i,j,k,l for loops - especially when it's "just a loop" and the counter really has no significance beyond being used in a loop.

Now, five extra points to anyone under 40 years of age that can tell the rest of the class where the "i,j,k,l" idiom came from... :D

ghenry
27th August 2004, 09:50 AM
If anyone wants a yourname@perl.me.uk just let me know. Just bought the domain and hosting a few things on there.

ChrisMUC
27th August 2004, 12:57 PM
I am starting to love Perl.

Well, you cannot compare Perl and PHP at all. They've got completely different aims.
Perl is a scripting language for every kind of text processing/manipulation, while PHP
was developed for dynamic webpage generation.

I like perl pretty much (and I also like PHP for webpage generations), I even once wrote a large app with GUI and database backend, but to be honest - coding that in perl is a bit masochistic, and today, I'd definitely not recommend it any more. Maybe, it's because I'm converted to Java.

Mat
27th August 2004, 02:57 PM
is java still slow? i can remember doing a program with the swing gui and it was slow as hell, on a P4 and winXP... since that day I was disappointed :)

crackers
28th August 2004, 04:31 AM
is java still slow?
Depends on what you mean by "slow." Does it still take a bit of time to get the JVM running? Well, yes - it's a big program. Does Swing still suck? No way! It's quite zippy with the 1.4.x versions - there was a speed increase just on it by over 25%. For a user-interface app, it's eminently suitable. Most "slow" Java apps were written poorly. A good Swing app is close enough to "native" that it may be hard to tell the difference. If you want to see how fast a pure-Java/Swing app can be, try out a trial run of IntelliJ IDEA from netbrainz.com

Plus, it's kind of hard to have a slow language and run Enterprise-class servers where response times are measure in 10's of milliseconds. :D

You still can't do intense computational "stuff" - but that's not what Java was built to do.

Mat
28th August 2004, 01:59 PM
well, I never liked to code in Java, perhaps that's why I wasn't able to look behind that factor.. I just noticed, that opening new dialogs (I don't even know anymore what java's term is for that :)) took quite a while... more than with C or delphi apps for instance..


Mat

khamar
28th August 2004, 11:58 PM
PHP is fine for what it does, but when you need a Swiss-Army knife with chainsaw attachments use perl.
The reasons are very simple; community support and CPAN. If your task is even remotely "normal" a code example in perl is but a few mouse clicks away. Still need help, post your concern on perlmonks.org and get a response within the hour. Need help right now? Post your question into the perlmonks chatterbox and get an immediate answer (sometimes from the module developers, book authors, or Larry Wall himself. {ok, the last one is a stretch but he does appear every week or two})
Perl has been the glue of our internet for a decade, and continues to solve problems in areas of banking, bioinformatics, data analysis and data visualization, database design, and many other daily programming tasks. Perl makes the easy things easy and the hard things possible. No other single language provides the range of capability with the natural language structure found in perl.
A few resources for consideration;
Success Stories: http://perl.oreilly.com/news/success_stories.html
PerlMonks: http://perlmonks.org/
Dozens of Tutorials: http://perlmonks.org/index.pl?node=Tutorials
Comprehensive Perl Archive Network: http://cpan.org/

ghenry
29th August 2004, 01:28 AM
Exactly. I agree totally.

crackers
29th August 2004, 03:48 AM
Perl has been the glue of our internet for a decade
True enough - but that doesn't mean I have to like it, now does it?