472,951 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 software developers and data experts.

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 1746
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Wilson CPU | last post by:
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: -------------------------------------...
31
by: surfunbear | last post by:
I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
13
by: Otto J. Makela | last post by:
I'm trying to install to php the Perl-1.0.0.tgz package (from http://pecl.php.net/package/perl, enabling one to call perl libraries) to a pre-existing Solaris system. Unfortunately, the attempt...
6
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation...
4
by: billb | last post by:
I installed a perl extension for PHP to use some perl inside my php primarily because I have perl working with oracle and not php and oracle. So I want to use my old perl scripts, and use the...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.