Learning perl - for experienced programmers

J

John Bokma

John, I don't want this to sound ugly. I had decided to ignore your
remark. I formed the conclusion that you had no idea what you were
talking about.

Funny, maybe read the other replies, which probably do it better then I
can do.
The javadoc utility produces a Java API of your code. You can write an
application, run javadoc, and WITHOUT ANY FURTHER EFFORT ON THE
PROGRAMMER'S PART have a full API of your application. POD is an HTML
type

Like I said: you have to read more on POD. Also, it sounds like you have
little experience with javadoc. Maybe you should closely examine the
source that comes with a JDK install and count the number of lines that
have comment and wonder aloud why someone has been typing that. Next,
wonder how useful "your" javadoc is for pratical purposes after deleting
all those comments.

[ rest snipped, couldn't be bothered ]
 
D

davide

(e-mail address removed) ha scritto:
In my job, I use ColdFusion, Perl, and Java. Each language has its good
uses and bad uses. Perl is very good for one off scripts of less than
25 - 50 lines. In fact, it's very, very good for that. If you're
dealing with an application of 100 lines or more that will stick around
(snip)

this isn't my experience, at all. I am not a professional programmer,
just enthusiast about languages. I coded a commercial software, a 30k+
rows perl application (Tk GUI, not web something). It's a campsite
management application built over postgresql, working on a small
network (10 win32 and 6 linuxes + a database server). I paid attention
to use good programming rules for code reuse and maintainability. It's
perfect! It's very easy for me to open emacs and change something
after more that one year.

For the records: I'm going to port it to Python+WxPython. I'd like to
learn that language and this is a good chance for me to redesign some
part having fun! :)

Best regards,

Davide
 
J

John W. Kennedy

For many years, COBOL was the *only* tool for certain IO-heavy and
table-oriented tasks that come up in financial and administrative
computing. At least it was the only COmmon Business Oriented
Language and claimed to be specially fit for these purposes. People
believed it and developed large code bases in COBOL. In reality,
the FORTRAN of the day would have worked as well, if not better.

No, it wouldn't have, lacking, as it did (just off the top of my head):
decorated numeric output,
record I/O,
fixed-point arithmetic, and
even the most primitive string manipulation.
 
R

Randal L. Schwartz

cartercc> In my job, I use ColdFusion, Perl, and Java. Each language has its
cartercc> good uses and bad uses. Perl is very good for one off scripts of
cartercc> less than 25 - 50 lines. In fact, it's very, very good for that. If
cartercc> you're dealing with an application of 100 lines or more that will
cartercc> stick around for a while, I'd run like hell from Perl. (Within the
cartercc> past year, I inherited a great mass of Perl scripts, around 70 or
cartercc> so, each containing 500 or more lines of code, and it's absolutely
cartercc> not maintainable, nor maintained. As it breaks, we are rewriting in
cartercc> something else.)

It's a good thing Amazon.com and Ticketmaster haven't hired you, or the people
who worked at your company before you. Contrary to your experience, they're
finding that Perl *does* scale as well as any other language, *provided* you
treat it as a grown-up language.

In fact, the number of companies looking for good Perl programmers
who *do* have a clue about maintenance has been steadily increasing
over the past few years... I'm even hearing reports that there AREN'T
ENOUGH PERL PROGRAMMERS. Go figure.
 
J

John Bokma

In fact, the number of companies looking for good Perl programmers
who *do* have a clue about maintenance has been steadily increasing
over the past few years... I'm even hearing reports that there AREN'T
ENOUGH PERL PROGRAMMERS. Go figure.

Thanks Randal, that's very encouraging news :) Some people keep telling
me that I will soon get into problems as a programmer focussing mainly on
Perl. This got me worried enough to consider learning a "popular" language
like C# or PHP (yikes). I decided to settle for a "non-popular" one in the
end (I guess Python can be called that) *and* improve my Perl skills
(currently reading HOP) and your reply makes me happy :).
 
C

Charlton Wilbur

In fact, the number of companies looking for good Perl programmers
who *do* have a clue about maintenance has been steadily increasing
over the past few years... I'm even hearing reports that there AREN'T
ENOUGH PERL PROGRAMMERS. Go figure.

Got any leads in western Massachusetts? I'm looking, and I'm starting
to suspect that I'm looking in the wrong places, or that there aren't
any Perlish jobs out here, they're all in the eastern half of the
state.

(And addressing the larger point: Perl is an extremely flexible
language, and winds up being about as maintainable as the original
author wanted it to be. The same power and flexibility that allow
Perl to be very expressive and terse in the hands of a good programmer
allow it to be horribly obscure and un-maintainable in the hands of a
bad programmer. If PHBs had any coding wit, they'd realize this.)

Charlton
 
R

robb

davide said:
(e-mail address removed) ha scritto:

(snip)

this isn't my experience, at all. I am not a professional programmer,

FWIW, This IS my experience. I'm a professional programmer with 12
years of experience with Java, Perl 4 and 5, Python, Prolog, Smalltalk,
etc.

Just sayin'.
 
R

robb

I don't think you're going to find what you're looking for. I don't
believe it exists. It's kind of a weird irksome thing in the perl
world.

You can see that there've been suggestions that you look at just about
every perl book out there ... because your question doesn't really have
an answer.

In the python world, it'd be the standard docs, and maybe Dive Into
Python, for a slightly longer intro.
You might have a look at the Camel, aka "Programming Perl".

I'd avoid this one - one of the worst programming books I've ever read.
It, like most perl books are written heavy on "humor", and dense with
their own insider cutesy language and copious self-references. If you
wish your reference books read more like Tolkein, then you'll
appreciate it.
Or, just open a terminal and run 'perldoc perl'.

This may be your best bet. It still suffers from the egocentric
neologisms that pervade the perl scene, but it's useful nonetheless.
 
A

axel

John Bokma said:
(e-mail address removed) (Randal L. Schwartz) wrote:
Thanks Randal, that's very encouraging news :) Some people keep telling
me that I will soon get into problems as a programmer focussing mainly on
Perl.

Have you so far?
This got me worried enough to consider learning a "popular" language
like C# or PHP (yikes). I decided to settle for a "non-popular" one in the
end (I guess Python can be called that) *and* improve my Perl skills
(currently reading HOP) and your reply makes me happy :).

I think specialisation is the key and your Perl knowledge, which far
surpasses mine, is a major asset.

All I would say is that I think in the job market ability in Perl
needs to be linked with something else (be it Sys Admin, Databases,
&c.) to be really marketable. Certainly in more than one place I
have worked (actually now I think of it, none) I was not contracted
on my Perl knowledge... one in fact being a little shocked when I
was asked to do something in C++ but ran up a quick prototype over
a weekend. It was decided to build things on that instead. It
saved me grief as I dislike programming in C++ (just my own feelings)
and was busy enough anyway.

Axel
 
R

Randal L. Schwartz

robb> Very disingenuous.

Not that facts would disuade you, since you definitely have a chip
on your shoulder, but...

Java 1.0 was first publicly released in 1995[1]. Perl5 (with pod) was first
alpha released (to the public) in mid-1993[2]. Therefore, the statement is
accurate, and your challenge has failed.

[1] http://en.wikipedia.org/wiki/Java_programming_language
[2] perldoc perlhist
 
J

John Bokma

Have you so far?

Very hard to say, I have a slow period right now, but those things
happen (I sometimes have the idea customers wait for a specific signal,
and then email me all together in the same week)

I also have the feeling I see more small projects, but again, that can
be just coincidence.
I think specialisation is the key and your Perl knowledge, which far
surpasses mine, is a major asset.

Thanks :). And yes, I am very happy with my Perl knowledge, but also am
aware that there is still a lot to learn. One of the reasons I keep
reading this group is that now and then useful new stuff shows up,
either modules or pieces of code I wouldn't have thought about to write
it that way.
All I would say is that I think in the job market ability in Perl
needs to be linked with something else (be it Sys Admin, Databases,
&c.) to be really marketable.

Might be very true. I guess a few years ago CGI was the magic word to go
with Perl, but I don't like CGI projects much. I prefer the data in,
some magic, data out stuff outside CGI more. One of the projects I did
some time ago and really enjoyed was converting the printable output of
a closed source application (text + control characters) into a different
layout so it could be printed on top of a new form design.
Certainly in more than one place I
have worked (actually now I think of it, none) I was not contracted
on my Perl knowledge... one in fact being a little shocked when I
was asked to do something in C++ but ran up a quick prototype over
a weekend. It was decided to build things on that instead. It
saved me grief as I dislike programming in C++ (just my own feelings)
and was busy enough anyway.

:-D. My customers are aware of Perl, they either need an extra hand, or
ended up with a Perl program somehow and need it to be extended. I
originally used Perl like you describe: I was working on a project
(coincidally also involving C++) and we needed a quick solution for
generating documentation (a bit like javadoc). I wrote a prototype in
Perl, and it did the job. So I introduced Perl into that company, and
made their programmers enthousiastic for it.
 
R

robb

Randal said:
robb> Very disingenuous.

Not that facts would disuade you, since you definitely have a chip
on your shoulder, but...

Java 1.0 was first...

No, actually, I do believe it's disingenuous to say, "Yes! Perl has
this, and it's called POD. And it was there before Java."

That's like saying that Windows "Notepad" exists, and was there before
Open Office "Write". This is true only in the most superficial way: OO
Write provides features a full abstraction higher than Notepad.

As does Javadoc over POD.

Remember, the post this quote was in response to was that even if
handed a mess of poorly written Java code, there are tools such as
Javadoc that will provide real help. This is true no matter how poorly
the code was written. It's a feature of the language (the typing, the
syntax, etc.)

AFAIK, if a perl programmer followed only worst practices, then POD
will be useless. It's essentially a tool that relies on convention.

The two aren't comparable. (Why they should they be? Perl doesn't
have to be perfect at everything.) And therefore, it's disingenuous to
trot out, "Perl had this first!".
 
A

addinall

John said:
Thanks Randal, that's very encouraging news :) Some people keep telling
me that I will soon get into problems as a programmer focussing mainly on
Perl. This got me worried enough to consider learning a "popular" language
like C# or PHP (yikes). I decided to settle for a "non-popular" one in the
end (I guess Python can be called that) *and* improve my Perl skills
(currently reading HOP) and your reply makes me happy :).

Nothing wrong with PHP! I have done a few largish jobs for Telco's
using Perl to handle IO from RADIUS, IOS, LDAP and other secret
underworld places and present the results via SSH to another server
running PHP scripts/Web applications. Shrug, horses for courses.
Perl is neat, I love it to death. PHP has it's uses, bloody fast
in putting together a slick GUI.

Cheers,
Mark.
 
J

John Bokma

addinall said:
Nothing wrong with PHP!

There is a lot wrong with PHP :) It's getting better though. But it also
suffers from the same problem I saw with Perl when it was "hot": most
hosting providers offer version 4, not 5.
 
R

robb

John said:
Instead of trying to "remember" to what I replied and making things up to
look good, look it actually up.

You're right. I'm sorry - you did say that POD would produce
"something" from obfuscated perl code, and I'm sure it would.

My only beef is that this "something" wouldn't be useful, and I
wouldn't present POD as being the same as Javadoc when talking to a
newbie.
Furthermore, you somehow seem to be impressed by the ability of javadoc to
use the method signature (amongst other) to generate some bare
"documentation".

You betcha! An interlinked set of docs showing all inheritance
relationships, class names, methods and their parameters, exceptions
thrown, interfaces implemented, class and object variables.... all
from the raw self-documenting source code without any human-written
comments. It's a great embodiment of lazyness as a virtue. In my
experience, most people would find that pretty impressive.
 
A

anno4000

John W. Kennedy said:
No, it wouldn't have, lacking, as it did (just off the top of my head):
decorated numeric output,
record I/O,
fixed-point arithmetic, and
even the most primitive string manipulation.

Okay, the lack of records (what is record I/O?) is serious. Other
features could be supported by library routines.

Anno
 
C

cartercc

Randal said:
cartercc> In my job, I use ColdFusion, Perl, and Java. Each language has its
cartercc> good uses and bad uses. Perl is very good for one off scripts of
cartercc> less than 25 - 50 lines. In fact, it's very, very good for that. If
cartercc> you're dealing with an application of 100 lines or more that will
cartercc> stick around for a while, I'd run like hell from Perl. (Within the
cartercc> past year, I inherited a great mass of Perl scripts, around 70 or
cartercc> so, each containing 500 or more lines of code, and it's absolutely
cartercc> not maintainable, nor maintained. As it breaks, we are rewriting in
cartercc> something else.)
It's a good thing Amazon.com and Ticketmaster haven't hired you, or the people
who worked at your company before you. Contrary to your experience, they're
finding that Perl *does* scale as well as any other language, *provided* you
treat it as a grown-up language.

For the record, the code base I inherited dates from around 1994, and
was initially written for Perl 4. It was a one man operation, who was a
tenured faculty member with his degree in EE. Tom didn't believe in
deleting code, or library routines, or modules, but believed in keeping
them all around, in most cases not even commenting the old ones out.
His revision history looks like this: 1, 2, 5, 8, 12, 14, 16, 19, 24,
25. In one case, it literally took us three weeks to discover where a
variable was initialized. It came from a module three directories over!
Tom was a bright guy and was continually learning and improving, which
meant that we had a real mix of styles and quality. He died tragically
young, and about a year later, after his code started breaking, I and
another fellow were asked to review Tom's code and fix it. We read
through it for about 12 weeks, and decided it was an impossible task,
so we started rewriting it in Java.

It's not my purpose to rate one language as 'better' than another. I'm
a database manaber for a large public university, and most days I write
some Perl. I can do some wonderful things in just a few lines of code
(as could Tom), and people use the term 'magic fingers' when talking
about our work product. That shouldn't surprise you at all.

HOWEVER, I still maintain that Java is much, much better than Perl for
a large project. The very things that Perl programmers don't like about
it, like static typing, single inheritance, access modifiers, etc.,
enforce a strictness that Perl doesn't. Additionally, Java compiles to
bytecode, and I've not had a problem running class files on different
systems. With Perl, I've found that I need to code for the target
system. Programs written for Windows will run on Linux, but some
programs written on Linux will not, repeat, not, run on Windows.

I made an analogy earilier, Java is like a deuce and a half, while Perl
is like a sports car. Perl can do things that are difficult or
(virtually) impossible in Java, and Java can do things that are
difficult or (virtually) impossible in Perl. They are different
languages, with different strengths and different weaknesses.
Personally, I find them both useful. Further, I think if you were
sitting in my chair and faced with my responsibilities, you would agree
with me.

One final note. I teach a course in OO programming. Java IMO is a
perfectly horrible language to teach programming, the reason is that it
answers questions a beginning student doesn't know to ask. Once a
student has figured out how to program, Java is a delight to use. Its
object model is structured, clear, unambiguous, and straight forward.
Perl's object model, by contrast, is a mess. Tom was beginning to use
OO Perl for the last two or three years, and I guess he was doing OJT,
but I don't even think he could remember from app to app how and why
he set some class variables. Blame the programmer (you would be
justified in doing so), but share a small part of the blame with the
language.
In fact, the number of companies looking for good Perl programmers
who *do* have a clue about maintenance has been steadily increasing
over the past few years... I'm even hearing reports that there AREN'T
ENOUGH PERL PROGRAMMERS. Go figure.

I keep an eye on dice.com. If you search for Perl, you see admin and
web jobs, but few for Perl developers in general. Search for Java, and
you get plenty of general programming results. Java jobs: 14217; Perl
jobs: 4780 - a 3 to 1 ratio.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

On a personal note, I've been a fan of yours from LP 1. This is the
first time I've had any contact with you, and I want to say that you've
done a first class job with LP and also with LPORM. Thank you for what
you've done, and may you long continue to evangelize and educate.

All the best, Charles Carter.
 
J

John Bokma

You're right. I'm sorry -
Thanks.

you did say that POD would produce
"something" from obfuscated perl code, and I'm sure it would.

Can't recall I said that :).
My only beef is that this "something" wouldn't be useful, and I
wouldn't present POD as being the same as Javadoc when talking to a
newbie.


You betcha! An interlinked set of docs showing all inheritance
relationships, class names, methods and their parameters, exceptions
thrown, interfaces implemented, class and object variables.... all
from the raw self-documenting source code without any human-written
comments.

The question is: how useful is this.

Due to how Perl works, some of this information can not be obtained at the
moment, and probably for a part this is not going to change with Perl 6.
It's a great embodiment of lazyness as a virtue. In my
experience, most people would find that pretty impressive.

Then they don't know very much about programming. Due to how Java works,
generating such documentation is a piece of cake: the programmer has
already written out all required information, or it can be implied from
this information.

Perl makes this impossible due to eval amongst others.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top