473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1770
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.