468,554 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

php and perl

Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter
Jun 12 '07 #1
9 1595
peter wrote:
Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter
Peter,

They're both good languages. Each has its advantages and disadvantages,
of course. And both are in more widespread use than Java, IMHO.

I've learned all three. I use PHP the most; Perl next and Java the least.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 12 '07 #2
Jerry Stuckle wrote:
>
Peter,

They're both good languages. Each has its advantages and disadvantages,
of course. And both are in more widespread use than Java, IMHO.

I've learned all three. I use PHP the most; Perl next and Java the least.
care to discuss your thoughts on adv/disadv?
thanks
Jun 12 '07 #3
On Jun 12, 1:31 pm, peter <p...@juno.comwrote:
Jerry Stuckle wrote:
Peter,
They're both good languages. Each has its advantages and disadvantages,
of course. And both are in more widespread use than Java, IMHO.
I've learned all three. I use PHP the most; Perl next and Java the least.

care to discuss your thoughts on adv/disadv?
thanks
I noticed you asked again for pro/con breakdowns and such. I'm not
much of a resource--you'll see that others are much more reliable on
this group--but I thought I'd share my experience just the same.

I've learned all three at one point or another, but I haven't
developed in Java for a few years now. I don't really like Perl in
general; I feel like PHP does everything I would need Perl to do and
does it with cleaner code syntax and structure. As a result, I never
really used Perl in anything large scale or with a significant scope.

At the time when I used all three, I found PHP to be the easiest to
read and write visually, and also one of the easiest to learn--I think
the syntax and structure made sense and I typically described it to
people unfamiliar with it as a programmer's language (this was after
using C++ and Java in school and learning Perl). That being said, I
think that PHP's OOP support at the time (this was a few years ago)
was nonexistant, and only with PHP5 has it really gotten to the point
where I'd use it in production code. Java is much more strictly OOP
and was very useful for compiled console applications, and I enjoyed
using it for that purpose.

Now, of the three, I use only PHP, developing applications online part
time and as a hobbyist. If I wanted to develop a GUI based console
application, I would probably rather figure out the PHP GTK than go
back to Java, but that is more because PHP is so comfortable for me
now.

So, to summarize:
PHP:
-pros: easy to read, easy to learn, intuitive syntax, good for web
development
-cons: new OOP support, relatively dynamic structure (you will see on
here people talking about how functions or behaviors change between
point versions)

Java:
-pros: strong OOP, good documentation (that I recall), good for
console applications & GUIs
-cons: harder to learn, takes longer to become comfortable, I think;
pretty strictly OOP

Perl:
-pros: great cult like following ;-)
-cons: somewhat unintuitive, obsolete compared to PHP (IMHO)

That's my opinion, anyway.

Jun 12 '07 #4
peter wrote:
Jerry Stuckle wrote:
>>
Peter,

They're both good languages. Each has its advantages and
disadvantages, of course. And both are in more widespread use than
Java, IMHO.

I've learned all three. I use PHP the most; Perl next and Java the
least.

care to discuss your thoughts on adv/disadv?
thanks

BJ has made some comments - although I don't necessarily agree Perl is
obsolete. There are a lot more packages out there for Perl than PHP,
IMHO. And they're much easier to install. But I pretty much agree with
the rest. I did find Perl hard to understand until I really got into
it. PHP, OTOH, was pretty natural - probably because of years of C++
experience.

Perl is also a lot more stable. No major changes between releases, like
is occurring in PHP. I haven't had much trouble with PHP code breaking
from one release to the next, but that's more because I'm careful in
what features I use. But it still does occasionally. And I suspect
when Release 6 comes out I will have to make some changes.

Java is also pretty stable. Although new features are being added,
there isn't much which breaks the code. But I've found it to be much
more CPU-intensive than PHP or Perl. There are also many fewer hosts
who support Java (one of the main reasons I got into PHP and Perl).

Basically I pick a language depending on the job to be done. Most of
the time it's PHP. But as I said before - I use the others, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 12 '07 #5
peter wrote:
Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter
thanks guys. it was useful. Being from a UNIX background, I found perl
intuitive :) if php is c++ like, I dont think I would care for it. I
shall see if others contribute more later.

i appreciate your comments.
peter
Jun 12 '07 #6
On 12.06.2007 13:19 peter wrote:
Hi,

this is not stinky bait. If you take it that way, please dont respond..

I have been away from UNIX software for quite awhile and want to get
back into it. I liked "C" but Java seems like the way to go for
compiled langs, now days so I will learn that.

At one time, I did a bit of perl but now I see php alot. I was
wondering what you guys thinks of the pros/cons of perl and php.

I appreciate your time,
peter

perl and php are both outdated, cumbersome and ugly. You’d be better off
learning python or ruby, IMHO.

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Jun 13 '07 #7
peter wrote:
thanks guys. it was useful. Being from a UNIX background, I found perl
intuitive :) if php is c++ like, I dont think I would care for it. I
shall see if others contribute more later.
I would say that PHP is more Perl-like than C++-like. I started PHP with a
background in Perl and found it very easy to pick up.

Here's an example to demonstrate their similarities.

Perl:

#!/usr/bin/perl

$a = 1;
$b = 1;
$c = undef;
$psi_old = undef;

print "Approximating psi...\n";
while (1)
{
$psi = sprintf('%.08f', $b/$a);
last if ($psi_old eq $psi);
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

PHP:

<?php

$a = 1;
$b = 1;
$c = NULL;
$psi_old = NULL;

print "Approximating psi...\n";
while (1)
{
$psi = sprintf('%.08f', $b/$a);
if ($psi_old == $psi) break;
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

?>

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 109 days, 15:48.]

URLs in demiblog
http://tobyinkster.co.uk/blog/2007/05/31/demiblog-urls/
Jun 13 '07 #8
>peter


perl and php are both outdated, cumbersome and ugly. You’d be better off
learning python or ruby, IMHO.
hmmm more to consider, thanks
Jun 13 '07 #9
Toby A Inkster wrote:
peter wrote:
>thanks guys. it was useful. Being from a UNIX background, I found perl
intuitive :) if php is c++ like, I dont think I would care for it. I
shall see if others contribute more later.

I would say that PHP is more Perl-like than C++-like. I started PHP with a
background in Perl and found it very easy to pick up.

Here's an example to demonstrate their similarities.

Perl:

#!/usr/bin/perl

$a = 1;
$b = 1;
$c = undef;
$psi_old = undef;

print "Approximating psi...\n";
while (1)
{
$psi = sprintf('%.08f', $b/$a);
last if ($psi_old eq $psi);
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

PHP:

<?php

$a = 1;
$b = 1;
$c = NULL;
$psi_old = NULL;

print "Approximating psi...\n";
while (1)
{
$psi = sprintf('%.08f', $b/$a);
if ($psi_old == $psi) break;
$psi_old = $psi;
print "$psi\n";

$c = $a + $b;
$a = $b;
$b = $c;
}

?>
C/C++:

#include <stdio.h>
float a = 1.0;
float b = 1.0;
float c = 0.0;
float psi_old = 0.0;

puts ("Approximating psi...");
while (1) {
psi = b/a;
if (psi_old == psi)
break;
psi_old = psi;
printf ("%f\n", psi);
c = a + b;
a = b;
b = c;
}

Of course, C++ has many OO features the C doesn't have.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 13 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mark Wilson CPU | last post: by
31 posts views Thread by surfunbear | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
13 posts views Thread by Otto J. Makela | last post: by
6 posts views Thread by surfivor | last post: by
4 posts views Thread by billb | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.