Perldocs for Schwartzian transforms?

R

Randal L. Schwartz

jl> I remember when I was new to Perl and I wanted a function that was
jl> similar to glob() but worked recursively. From "Learning Perl" I knew
jl> to use the File::Find module, but when I read its perldoc, I was very
jl> confused. The reason? I was disoriented due to the fact that I was
jl> expecting to find a function that could be used like:

jl> my @listOfFiles = recursiveFind($topLevelDir);

jl> but instead found File::Find::find() which worked in a way that was
jl> very unfamiliar to me.

By "new to perl", you are probably also meaning "fairly new to
programming". File::Find uses a "callback" pattern, and if you hadn't
been familiar with that from other programming knowledge, you *would*
indeed be confused by File::Find. But that's not the fault of
File::Find or even the documentors there. If we had to explain what a
list is every time a function returned a list, the docs would balloon
to the point where they'd be far to heavy to carry.

What you were *probably* looking for is the inside-out functions
in the CPAN of File::Finder or File::Find::Rule. Yeah, it turns out
they are built on File::Find, but they make the change from being
a callback-based function to a return-value based function.

I think what you're arguing for is more hand-holding for beginners. I
think what we keep saying is it's all there, but maybe a little rough
for beginners to find. But that's why there's a market for paid
consultants and paid books and paid trainings. If you can't
understand readily what the free sources are saying to the experts,
you hire someone to bridge that to your level. This is the efficiency
of Open Source at its heart... the developers can write docs to other
developers (taking a lot of shortcuts), and the rest of us can get
paid to translate that to beginner-speak.
 
J

jl_post

jl" == jl post@hotmail com said:
jl> I remember when I was new to Perl and I wanted a function that was
jl> similar to glob() but worked recursively. From "Learning Perl" I knew
jl> to use the File::Find module, but when I read its perldoc, I was very
jl> confused
File::Find uses a "callback" pattern, and if you hadn't
been familiar with that from other programming knowledge,
you *would* indeed be confused by File::Find.
By "new to perl", you are probably also meaning "fairly new to
programming".

Not really, no. I was unfamiliar with the new things that were
introduced to me by learning Perl. I remember reading somewhere that
Perl is a lot like C, but at the same time not a lot like C. This
could be considered to be a contradiction, but its point is that,
although C programmers find that Perl may have a "C" type of flow to
it, it's still not C and has some definite differences that the
programmer needs to keep in mind. Hence, when C programmers migrate to
Perl for the first time, they are almost guaranteed to feel disoriented
somewhat as they find themselves somewhere that looks like their home
turf, but really isn't.

Just a few days ago I came across an appropriate example. A C/C++
programmer (who had been programming in C for decades and C++ for at
least a decade) came to me for help with Perl. He had trouble
accessing a specific element in an array.

When I looked at his code, I saw that he was trying to access a
specific element with code like:

print location($ndx);

I explained to him that, like C, those parentheses made that piece
of code a function call (instead of an array look-up) and, like C,
arrays were accessed by placing square brackets around the index
(instead of parentheses). I also explained that, unlike C, a dollar
sign had to be placed in front of "location".

When we corrected these errors and saw that the Perl program
compiled, he told me that the documentation specifically had an example
of parentheses being used. I told him he was probably looking at an
example of a function call and mistook it for an array. He denied
that, and went back to theh documentation.

To my surprise, the documentation he was looking at was a perldoc
(this pleased me because almost nobody I introduce perldocs to actually
turn to them when needed). However, he looked at the sample code again
and, as a surprise to him, the sample code in the perldocs was written
as:

print $location[$ndx];

just like I had said it was supposed to be written.

He muttered something like, "I could have sworn it was written the
other way." Now, what was strange was that a seasoned C/C++ programmer
should make that mistake. It's no stretch to believe that a BASIC
programmer could make that mistake, but someone who's been programming
in C since before Perl was invented? How could he make a mistake like
that, considering that the array syntax for Perl is almost exactly like
it is in C?

I contribute it to disorientation. It's going to happen somewhat no
matter how familiar someone (new to Perl) is to other programming
languages. Sure, having good college professors and studying hard
helps a lot, but some amount of disorientation (no matter how small)
will always be experienced by a programmer learning a new concept.
This disorientation can even leak into areas of knowledge that the
programmer had firm knowledge on (like array syntax). It's an odd
phenomenon, but I know it exists.

So how do we eliminate this disorientation completely? Frankly, I
believe it's not possible to eliminate it entirely. This
disorientation is a fact of life, something we have to live with
because we're human. We can work to reduce it somewhat, but the fact
that everyone is different means that everyone will stumble across
different things.

I love the "perldoc perltrap" documentation because it seeks to shed
light on where people can trip up (and get disoriented) and clearly
explain why and what the correct mode of thinking is. Of course,
because we're all different, that perldoc can never ever be complete,
but at least it addresses some of the more common issues that plague
new (and even experienced) Perl programmers.
But that's not the fault of File::Find or even the documentors
there. If we had to explain what a list is every time a function
returned a list, the docs would balloon to the point where
they'd be far to heavy to carry.

Very true. You could even say that, since programming can be used
to solve open-ended problems, that an infinite amount of documentation
is necessary, since there are, in theory, an infinite number of
programming concepts. I'm not even going to attempt to answer the
question "How much documentation is enough?" because that question has
a very gray answer, and will differ from person to person. (The
answers given by the same person can even vary if the question is asked
several months apart.)

But nevertheless, that's one of those issues that is significant to
me (even though many (or even most) programmers don't give it much
thought). For example, if 20% of Perl programmers got confused about a
list being returned in one particular function, should we re-explain
what a list is? Probably not, but a one sentence reminder designed to
clear up potential confusion might not be out of line, especially if
it's stated near text that has confused a significant number of people
in the past.
I think what you're arguing for is more hand-holding for beginners.

In a way, yes. I've never really been opposed to hand-holding, but
I've noticed that some people are adamantly against it.
I think what we keep saying is it's all there, but maybe a little
rough for beginners to find. But that's why there's a market for paid
consultants and paid books and paid trainings. If you can't
understand readily what the free sources are saying to the experts,
you hire someone to bridge that to your level. This is the efficiency
of Open Source at its heart... the developers can write docs to other
developers (taking a lot of shortcuts), and the rest of us can get
paid to translate that to beginner-speak.

I agree with that. However, I've continually been encouraged to
write code that anyone (familiar with that programming language, of
course) can understand. I happen to mostly agree with statement.
Unfortunately, a common attitude I see is:

"I always write clear code. If I can't understand someone else's
code
[and that can include lists of lists, or even hashes] then that
code is
bad code and should be rewritten to be less esoteric."

To me, this attidue has a major fallacy: it assumes that what is clear
to one programmer is clear to all programmers, and what is unclear to
one programmer is esoteric code.

I find it hard to disagree more with that attitude. One thing I
find myself reminding programmers is: "Code is always clearest to the
programmer who wrote it. Keep in mind that, no matter how clear and
understandable your code is to you, no other programmer will think it's
as clear."

I also ask programmers to look back at the code they've written and
try to identify areas that might trip up future maintainers. If
they've found an area, either re-write it so that the chances of
confusion are descreased or, if that's not possible, add a comment or
two explaining the intent of the code and what its purpose is.

But if the programmer won't identify that any areas of their code
might be difficult to understand (claiming that their code is clear
enough and that only bad programmers would be confused), I remain
skeptical of their claim.

I see I've gone off on a tangent again. Well, permit me to tie
things together:

I've noticed that certain programmers have certain passions. A
friend of mine's passion is to remove duplicate code where possible and
to re-write classes so that they are adhering to real Object-Oriented
concepts (instead of being classes that are only half-way there, which
I've seen a lot of). My personal programming passion (and the reason
for these posts) is to not have blocks of code (and especially whole
files) that have unclear intentions. In other words, if I can't tell
what the purpose of a block of code is by looking at it, it should
either be re-written or have comments added to it (to smooth out the
rough parts, so to speak).

Of course, what is clear and what is not is different for every
programmer, but at least an effort can be made to clarify one's code
(another saying of mine is "Always write code so that it can be
understood and maintained by someone not quite as intelligent as you").

But how far must you clarify your code? This has been a subject of
much debate (made even more heated by the fact that some people think
that every piece of code they write is clear -- despite the fact that
no maintainers seem to think so), so I've taken the stance that a Perl
programmer should be responsible for knowing, at a minimum, whatever is
covered in the O'Reilly "Learning Perl" book (the Llama book). If they
don't know at least 90% of the material covered in there, they
shouldn't be programming in Perl.

But if you do write Perl code, don't bother explaining the concepts
found in that book. But if you come up with new programming concepts
(there are an infinite number of them, after all), explain them. Don't
just assume that a decent programmer will be able to understand it just
as you did when you wrote it in your program. The programmer who wrote
the code has the benefit of the thought processes required to think up
of the new programming concept, and will therefore perceive the code to
be quite clear -- but the maintainer (unless he/she has the ability to
read other people's minds) won't have that benefit and will perceive
the code as being significantly more convoluted.

A neat thing about programming is that a programmer, when asked to
wirte a program to accomplish a certain task, will pull an idea "out of
the ether" (so to speak) to create a program that's never been written
before. The fact that this new program has never been seen before in
all of human history automatically gives it a disadvantage in having it
understood by others.

The programmer who wrote this brand-new program has an exceptional
understanding of how the program works. It is my opinion that it is
his/her duty to not assume that others have the same level of clarity,
but to review the code and identify "problem spots." Once identified,
the programmer should either eliminate them (by rewriting them into a
common convention (such as one covered in the Llama book)) or, if
that's not possible, impart the knowledge needed in the form of
comments. The comments don't necessarily have to explain everything
(they could just point to existing documentation).

But leaving code devoid of comments is a trap: sure, simple code
doesn't necessarily need it, but when code becomes more complex, it's
practically guaranteed that maintainers won't understand it without
hours of study (and even with study there's always a good chance that
the code will be misunderstood, leading to errant and contradictory
code).

An example (the last one, I promise): I once came across code that
had four nested for-loops (there were actually five loops, but one of
them wasn't nested). I could understand what two of the loops were
doing, but I couldn't figure out the other three loops. Unfortunately,
there were no comments explaining the purpose of the other loops,
leaving that to be divined by the maintainers (namely, me). Well, I
found out who originally wrote the code, printed out the code in
question, and brought it over to the original programmer, asking him
what the code was doing.

I don't think the programmer even knew the code was written by him,
as his irritated response was, "You think I can understand some code
that just happens to be brought up to me?"

Unfortunately, this attitude is all too common. Personally (and
this is where many people disagree with me), I think that the intent of
all blocks of code should be immediately apparent. Either they should
follow a well-known convention, like:

my ($filename, $type, $outputFilename) = @_;

(believe it or not, not all Perl programmers understand what that line
of code does... this is unfortunate as they should know) or they should
explain its purpose with the help of comments. And not every
programming concept has a convention (there are an infinite number of
programming concepts, after all), so every program should have
clarifying comments, unless the program is so simple that it probably
already exists elsewhere (or if you're literally writing the at the
command line with the -e switch!).

I'll end it here with the thought that we are all unique and
therefore have different levels of understanding of different
programming concepts. Hand-holding isn't necessarily a bad thing,
especially if more than 20% of maintainers will need it.

(If you got this far, thanks for reading!)

-- Jean-Luc Romano
 
A

A. Sinan Unur

(If you got this far, thanks for reading!)

Well, honestly, I got this far, and I was instantly grateful that I
would not have to read and/or maintain your code. I would never really
get to seeing the code among the comments.
Just a few days ago I came across an appropriate example. A C/C++
programmer (who had been programming in C for decades and C++ for at
least a decade) came to me for help with Perl. He had trouble
accessing a specific element in an array.

When I looked at his code, I saw that he was trying to access a
specific element with code like:

print location($ndx);

Based on what you have written, after fixing the errors, that line of
code should a paragraph on arrays, the meaning of the $ sigil in Perl,
why we denote the array as @location, whereas a specific element is
addressed as $location[$ndx]. How, if $location[$ndx] did not exist
before, the array will automatically grow, and $location[$ndx] will be
undefined so on and so forth. Just so no one will ever be disoriented,
because disorientation is caused by too little explanation.

The phrase "information overload" comes to mind.

By documenting code at this level, you would actually make it harder on
the reader to work out the big picture. Every reader would be bogged
down by lengthy discussions of the most trivial Perl features.

Sinan
 
R

Randal L. Schwartz

jl> Not really, no. I was unfamiliar with the new things that were
jl> introduced to me by learning Perl. I remember reading somewhere that Perl
jl> is a lot like C, but at the same time not a lot like C. This could be
jl> considered to be a contradiction, but its point is that, although C
jl> programmers find that Perl may have a "C" type of flow to it, it's still
jl> not C and has some definite differences that the programmer needs to keep
jl> in mind. Hence, when C programmers migrate to Perl for the first time,
jl> they are almost guaranteed to feel disoriented somewhat as they find
jl> themselves somewhere that looks like their home turf, but really isn't.

But C *also* has callback patterns. This is not unique to Perl. That's why I
asked if you meant "fairly new to programming". That you didn't know about C's
callback possibilities confirms that.

jl> But how far must you clarify your code? This has been a subject of
jl> much debate (made even more heated by the fact that some people think that
jl> every piece of code they write is clear -- despite the fact that no
jl> maintainers seem to think so), so I've taken the stance that a Perl
jl> programmer should be responsible for knowing, at a minimum, whatever is
jl> covered in the O'Reilly "Learning Perl" book (the Llama book). If they
jl> don't know at least 90% of the material covered in there, they shouldn't
jl> be programming in Perl.

Of course, I promote that stance as well, although some would consider it a
bit self-serving. :)

print "Just another Perl hacker,"; # the original
 
J

jl_post

A. Sinan Unur said:
I was instantly grateful that I would not have to read
and/or maintain your code. I would never really
get to seeing the code among the comments.

To be honest, I think you misunderstood my point, Sinan. Yes, I do
try to use comments, but I don't comment ideas that I believe all Perl
programmers should already know.
Based on what you have written, after fixing the errors, that line of
code should a paragraph on arrays, the meaning of the $ sigil in Perl,
why we denote the array as @location, whereas a specific element is
addressed as $location[$ndx]. How, if $location[$ndx] did not exist
before, the array will automatically grow, and $location[$ndx] will be
undefined so on and so forth. Just so no one will ever be disoriented,
because disorientation is caused by too little explanation.

The phrase "information overload" comes to mind.

By documenting code at this level, you would actually make it harder on
the reader to work out the big picture. Every reader would be bogged
down by lengthy discussions of the most trivial Perl features.

You are very correct. However, as I stated in previous posts, Perl
programmers should already know this, and this shouldn't have to be
documented in the form of comments. In other words, comments
explaining this behavior shouldn't appear in the code because:

1. it is documented in "Learning Perl."
2. it is documented in "Programming Perl."
3. it is mentioned in the perldocs.
4. a realistic Perl programmer should already know this fact.
5. there are numerous web pages that explain this fact.

In regards to Schwartzian Transforms (getting back to the main topic
of the thread):

1. they are not mentioned in "Learning Perl."
2. they are not mentioned in "Programming Perl" (at least,
not in the index).
3. they are scarcely mentioned in the perldocs.
4. it is not a good idea to assume that any decent Perl programmer
has already encountered them and know how they work.
5. there are, however, web pages that explain them in detail.

The only point going for them is point 5. However, in order for any
decent Perl programmer to find out more about Schwartzian Transforms
(assuming he/she doesn't already), he/she must know the term
"Schwartzian Transform." Otherwise, what would they search for in
Google or look up in Wikipedia? They might not even be aware that such
a programming construct exists outside of the original coder's mind!

That's why I mentioned before that it would not be a bad idea to
include a simple comment with a Schwartzian Transform, like so:

# The following line of code uses a Schwartzian
# Transform to sort the files by file size (read
# "perldoc perlfaq4" or look it up on Wikipedia
# to learn more about it):
@sorted = map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [ $_, -s $_ ] } @files;

The comment doesn't have to be long (or even as long as I made it).
However, having a comment placed there with the name "Schwartzian
Transform" gives a self-sufficient Perl programmer something to search
for in case he/she would like to expand his/her knowledge to make sure
he/she has properly understood the code. Otherwise, the maintainer
would just have to guess at the purpose, hoping that no mistake was
made in guessing.

In my experience, coders often make mistakes when they have to guess
at the function or purpose of an unfamiliar piece of code. Giving them
the means to make the code familiar to them reduces the chances of them
unintentionally putting a bug in the code.

Have you ever read code written by someone else and thought things
like:

WHY did the coder use this code?
WHAT WAS THE REASON behind the coder writing the code this way?
I WISH I COULD UNDERSTAND the purpose of this code.

Naturally, the coder who originally wrote the code doesn't have
those same thoughts. But maintainers that come after them often do.
Of course, a coder not familiar with the basics of Perl will have a lot
more of these questions than a coder who is familiar with the standard
canon of Perl books.

But in general, programming concepts that relate to Perl are found
in the "Programming Perl" and "Learning Perl" books. Yet,
theoretically, there are an infinite number of programming concepts
that could be applied to most any programming language, and many of
them can (and do) end up in Perl programs. It is these concepts (the
ones that Perl coders are not realistically assumed to already know)
that I feel should be documented -- either in the form of comments or
in a document that is pointed to by comments.

So is a decent Perl coder expected to know about Schwartzian
Transforms? You might think yes (and decide not to place comments
alerting the maintainer about it), but if you do, you are taking a risk
whenever you use one in your code. Without a helpful comment, a future
maintainer risks butchering your Transform code thinking he/she knows
what its function is meant to be.

For that reason, I like to place a short, succinct comment
explaining a piece of code that a decent maintainer might never have
run across (and is not necessarily expected to know beforehand).
Otherwise, I'm taking the chance that a coder might change or modify it
to do the wrong thing, not even knowing that he/she doesn't understand
what it's really supposed to do.

-- Jean-Luc
 
R

Randal L. Schwartz

jl> You are very correct. However, as I stated in previous posts, Perl
jl> programmers should already know this, and this shouldn't have to be
jl> documented in the form of comments. In other words, comments
jl> explaining this behavior shouldn't appear in the code because:

jl> 1. it is documented in "Learning Perl."
jl> 2. it is documented in "Programming Perl."
jl> 3. it is mentioned in the perldocs.
jl> 4. a realistic Perl programmer should already know this fact.
jl> 5. there are numerous web pages that explain this fact.

If you add "Intermediate Perl" (formerly "Learning Perl Objects References and
Modules") to that list, your argument is moot. And I see no reason to exclude
that doc.

print "Just another Perl hacker,"; # the original, number 0

--
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!
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
 
A

Anno Siegel

A. Sinan Unur wrote:

Sinan's article (the one you're responding to) is almost a month old.
That's an eternity in Usenet terms.

[...]
In regards to Schwartzian Transforms (getting back to the main topic
of the thread):

1. they are not mentioned in "Learning Perl."
2. they are not mentioned in "Programming Perl" (at least,
not in the index).
3. they are scarcely mentioned in the perldocs.
4. it is not a good idea to assume that any decent Perl programmer
has already encountered them and know how they work.
5. there are, however, web pages that explain them in detail.

You make it sound as if the Schwartzian Transform were some trick
specific to Perl that a programmer must be told about. That's not
how it is.

The technique of sort key caching has been known to programmers a long
time before Perl was even invented. The Schwartzian Transform is nothing
but a particularly elegant way of applying the technique to Perl arrays.
Arguably, a decent programmer should know about key caching (or be able
to come up with it as needed), never mind the programming language.

IOW, there is no need to anchor the term Schwartzian Transform in the
Perl core documentation. Its status as a piece of Perl folklore is
perfectly adequate.

Anno
 
B

Bart Lateur

Anno said:
The technique of sort key caching has been known to programmers a long
time before Perl was even invented. The Schwartzian Transform is nothing
but a particularly elegant way of applying the technique to Perl arrays.
Arguably, a decent programmer should know about key caching (or be able
to come up with it as needed), never mind the programming language.

In which case, pointing to Guttman/Rosler's paper on sorting techniques
would be rather appropriate.

<http://www.sysarch.com/Perl/sort_paper.html>

while I was searching for it (Google doesn't have it near the top of
results if you search for "Guttman-Rosler sort"), I found this page:

<http://raleigh.pm.org/sorting.html>

(which pointed to the above page).

And the best tutorial I've ever seen on the SchwartzianTransform, was on
the site <http://www.5sigma.com> (from the hand of Joseph N. Hall of the
"Effective Perl Programming" book fame) but it disappeared due to a
server disk crash. Sigh.
IOW, there is no need to anchor the term Schwartzian Transform in the
Perl core documentation. Its status as a piece of Perl folklore is
perfectly adequate.

Nah... I do believe it deserves a mention in perlfaq.
 
R

Randal L. Schwartz

Bart> And the best tutorial I've ever seen on the SchwartzianTransform, was on
Bart> the site <http://www.5sigma.com> (from the hand of Joseph N. Hall of the
Bart> "Effective Perl Programming" book fame) but it disappeared due to a
Bart> server disk crash. Sigh.

That was actually an extract of the portion of Effective Perl (the book)
that I wrote about the ST. Thank you. :)

Have you seen what I wrote about the ST in the Alpaca? I explain
"computing expensive keys" through a rather humorous analogy regarding
monkeys and coconuts.

print "Just another Perl hacker,"; # the original

--
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!
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
 
U

Uri Guttman

BL> In which case, pointing to Guttman/Rosler's paper on sorting techniques
BL> would be rather appropriate.

BL> <http://www.sysarch.com/Perl/sort_paper.html>

BL> while I was searching for it (Google doesn't have it near the top of
BL> results if you search for "Guttman-Rosler sort"), I found this page:

that is the original paper submitted to an early perl conference (3rd i
think. this is before OSCON). the docs to sort::maker cover all 4 major
sorting techniques (as the module supports generating all 4
styles). in the tarball is also the raw text for a slide show for a talk i have
given on the module. this also covers with examples the 4 sort styles.

http://search.cpan.org/src/URI/Sort-Maker-0.04/slides/sort_maker.txt

BL> Nah... I do believe it deserves a mention in perlfaq.

i agree. :)

uri
 
J

jl_post

jl" == jl post@hotmail com said:
jl> In other words, comments explaining this behavior
jl> shouldn't appear in the code because:

jl> 1. it is documented in "Learning Perl."
jl> 2. it is documented in "Programming Perl."
jl> 3. it is mentioned in the perldocs.
jl> 4. a realistic Perl programmer should already know this fact.
jl> 5. there are numerous web pages that explain this fact.

Randal L. Schwartz replied:
If you add "Intermediate Perl" (formerly "Learning Perl Objects
References and Modules") to that list, your argument is moot.
And I see no reason to exclude that doc.


I actually meant this list to be a combination of what decent Perl
programmer should know along with documentation that is easily
accessible to most of them. (I also included "Programming Perl"
because I (along with many other Perl programmers) consider it to be
the foremost reference manual for Perl programming.)

Whether or not "Intermediate Perl" belongs on that list really
depends on whether or not you think a decent Perl programmer must have
already read that book. As I've stated in previous posts, I strongly
believe that, at a minimum, a decent Perl programmer should be
responsible for knowing whatever is covered in the O'Reilly "Learning
Perl" book. If they don't know at least 90% of the material covered in
there, they shouldn't be programming in Perl. For me, this doesn't
include "Intermediate Perl," although I do acknowledge that it is a
good book to know, and that reading it can readily improve your Perl
skills.

Please don't think that in stating this that I believe your opinion
is wrong. On the contrary, I like to consider others' opinions, but I
don't always draw the same conclusions.

It's basically from experience that I don't think a qualification
for being a decent Perl programmer should be having read "Intermediate
Perl." I have enough trouble getting potential Perl programmers to
read "Learning Perl" (even in cases when the book is readily available
to them), learning how to use the perldocs (I was shocked when I found
out that some full-time Perl programmers didn't even know how to use
them), as well as using "use warnings;" and "use strict;", that I'll be
more than happy if the only Perl education they've had is to read
through "Learning Perl" and put its concepts into practice.

Otherwise, if not reading "Intermediate Perl" (and not knowing about
Schwartzian Transforms) automatically disqualifies a programmer from
being a decent Perl programmer, I honestly don't think I've ever worked
with a qualified Perl programmer.

So when a potential Perl programmer comes to me for help with Perl,
I tell them to read "Learning Perl," a book I myself used to learn Perl
(and also happen to think is very well-written). Getting them to read
that book (as well as learn how to use the perldocs) is hard enough
(believe me, I've tried) so I try not to make it any harder than it is
by recommeding other books that only a small percentage of Perl
programmers actually own and have read.

In short, I do acknowledge that reading "Intermediate Perl" makes
one a better Perl programmer, but I don't think it should be a
requirement for being a qualified Perl programmer.

Just my two cents.

Have a good week,

-- Jean-Luc Romano
 
A

A. Sinan Unur

In short,

I am afraid your posts are anything but.
I do acknowledge that reading "Intermediate Perl" makes
one a better Perl programmer, but I don't think it should be a
requirement for being a qualified Perl programmer.

Not necessarily reading it per se so long as the person is well versed in
the topics explained in that book. Now, if you are saying understanding
those topics is not necessary for being a qualified programmer, I cannot
agree with that.

Sinan
 
T

Tad McClellan

Number 3 should be number 1.

Books can easily be out of date by the time they are published,
and are certainly out of date after sitting on your bookshelf
for a while.

The standard docs are updated with each new release.

But the most compelling reason (to me at least) is that you're
expected to know the free (as in beer) stuff, but you are not
required to make Tim O'Reilly richer[1].

Randal L. Schwartz replied:


I actually meant this list to be a combination of what decent Perl
programmer should know along with documentation that is easily
accessible to most of them.
Whether or not "Intermediate Perl" belongs on that list really
depends on whether or not you think a decent Perl programmer must have
already read that book.


I don't think that a "decent Perl programmer" must have read _any_
Perl books.

I do think that such a programmer must be rather familiar
with the docs that ship with the programming language though.

As I've stated in previous posts, I strongly
believe that, at a minimum, a decent Perl programmer should be
responsible for knowing whatever is covered in the O'Reilly "Learning
Perl" book.


I can agree with that, but here you did not say "read", you
said "knowing whatever is covered in".

Under the "whatever is covered in" criterion, I'd say that
references (covered in the Alpaca book) are a must.

OTOH, there was plenty of useful work done with Perl 4,
when there were no references...

I suppose some would impose a similar requirement on knowing OO.




[1] Though I really like how he spends some of it!
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top