develooper Front page | | Postings from September 2000

Re: pack/unpack is damn unperlish. Explain them as Perl.

Thread Previous
Michael G Schwern
September 18, 2000 11:05
Re: pack/unpack is damn unperlish. Explain them as Perl.
Message ID:
On Mon, Sep 18, 2000 at 11:23:21AM -0400, John Porter wrote:
> Uh huh... Are you prepared to write an explanation of Perl arrays 
> without making any mention of Perl scalars?

"An array is a container for a list.  Items in the list can be added,
changed and removed, taken off and put onto both ends and even swapped

Language pedants will scream (please don't), but this is good enough
to get the reader's brain off the ground.  It conveys the basic ideas
of what an array is and what its good for while requiring a minimum of
computing knowledge.  Once the basics are applied, THEN you can start
explaining that the items are scalars, and what scalars are, and the
subtle differences between lists and arrays, etc...

Also, your challenge is not quite fair.  The average Perl programmer
must learn about arrays and scalars in order to get anything done in
Perl.  Teaching them simultaneously, or teaching one while assuming
knowledge of the other is acceptable.  I *never* need to know what a
"hex string (low nybble first)" is in day-to-day Perl.


Michael G Schwern
Just Another Stupid Consultant                      Perl6 Kwalitee Ashuranse
"You are wicked and wrong to have broken inside and peeked at the
 implementation and then relied upon it."
        Tom Christiansen in <31832.969261130@chthon>

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About