MCPM: [nypm: Perl Tutorials "Program Repair Shop" and "Iterators and Generators"]
Andy Murren
andy at murren.org
Tue Apr 16 12:57:58 CDT 2002
All,
For those interested. Does anyone want to see if we can get mjd
up here later this year?
----- Forwarded message from owner-ny at lists.pm.org -----
From: mjd-perl-pm at plover.com
Subject: Perl Tutorials "Program Repair Shop" and "Iterators and Generators" 28-29 May 2002
Organization: Plover Systems
Date: Tue, 16 Apr 2002 08:38:06 -0400
This year I'll be doing three tutorials at the big Perl conference in
San Diego. Two of them are new. As in previous years, I need to
practice these before I go to San Diego, so I'll be giving both
tutorials in Philadelphia next month.
If you were to attend in San Diego, you would pay about $320. But you
can come to my practice sessions for less than that. I will ask for a
(voluntary) donation of $5 at each class to cover expenses. This
request does not apply to Penn students, staff, or faculty.
WHEN
"Perl Program Repair Shop and Red Flags" will be held on Tuesday, 28
May. "Programming With Iterators and Generators" will be held on
Wednesday, 29 May. Both tutorials will start at 6PM and end around
9:30 or 10:00 PM. They will be held in Heilmeier Hall (room 100,
formerly Alumni Hall) in the Towne Building at University of
Pennsylvania. (Directions below.)
WHAT
Perl Program Repair Shop and Red Flags
This is not the same class as last year; it's a revised version with a
substantial amount of new material. Be forewarned that some of the
new material may be material that I did at last year's practice session
and then cut out of the class before the conference, so there may be
more overlap with last year's practice session than with what was
actually presented at last year's conference. On the other hand, some
of the repeated material is stuff I added in response to comments I
got at last year's practice session, so maybe it all evens out.
Here's the brochure description:
PERL PROGRAM REPAIR SHOP AND RED FLAGS II
You've probably been working too hard when you program,
writing twenty lines of code when you only needed ten. But
there is a better way, and I will show it to you. You'll
learn how to improve your own code and the code of others,
making it cleaner, more readable, more reusable, and more
efficient, while at the same time making it 30-50% smaller.
Smaller code contains fewer bugs and takes less time to
maintain.
This class expands on 'Repair Shop I' but is independent of
it, with little overlap. We'll see more red flags and more
common errors. I'll take a complete CGI tic-tac-toe
application and reduce its code by half without removing any
functionality or introducing any bugs. All code guaranteed
authentic!
Participants are encouraged to submit their own code for
anonymous review in the class. (Send it to
mjd-tpc6-repair2+ at plover.com.) Class content varies depending
on submissions, but is sure to include some of the following
topics:
Structural vs. functional code
Elimination of structure
Boolean values
Programs that take two steps forward and one step back
Programs that are 10% backslashes
print print print print print
C-style 'for' loops
Loop counter variables
Array length variables
Unnecessary shell calls
How (and why) to let 'undef' be the special value
Confusion of internal and external representations of data
Tool use
Elimination of repeated code with higher-order functions
Learning to use a hammer
The 'swswsw' problem
Avoiding special cases
Using uniform data representations
The brochure description for 'Programming with Iterators and Generators':
PROGRAMMING WITH ITERATORS AND GENERATORS
Sometimes you'll write a function that takes too long to run
because it produces too much useful information. A search
function might locate ten thousand matches. A database query
might return ten million records. What can you do?
Perl provides a simple and familiar model for dealing with
such problems: The filehandle! Instead of reading every file
in one giant gulp, we can use filehandles to staunch the flow
of information, trickling it into the program in manageable
gulps.
In this class, we'll see several important modules, such as
File::Find and DBI, which use this approach. We'll go inside
these modules and see how to implement filehandle-like data
structures and objects ourselves. We'll see how to write
functions that suspend themselves and then pick up later where
they left off. We'll learn how to take long-running slow
functions and convert them into speedy filehandle-like data
generator objects.
This fundamental technique is a mainstay of programmers in
other languages, but isn't as well-known as it should be.
You'll be amazed at how many difficult problems become simple
when you unleash the power of filehandles.
Introduction:
Filehandles are Iterators
Iterators are Objects
Common Examples of Iterators: readdir, each, and DBI
Homemade iterators
Examples
File tree scanning
Permutations
Genomic Sequence Generator
Filehandle Iterators
A Flat-File Database
Searching Databases Backwards
Random Number Generation
Alternatives to Iterators
Filters and Transforms: 'map' and 'grep' for iterators
Recursively-Constructed Iterators
The Semipredicate Problem
Alternative Interfaces to Iterators
An Extended Example: Web Spiders
Converting slow recursive functions to iterators
WHERE
The Towne Building is located at 220 South 33rd Street in Philadelphia.
For directions to the University, see
http://www.upenn.edu/admissions/undergrad/visiting/directions.html
Maps are available at
http://www.seas.upenn.edu/staff/pem.html
HOW
Unlike in past years, we have essentially unlimited space, so
reservations are not required; just show up.
However, if you want to receive the class handout materials, if any,
you should reserve copies in advance. To reserve materials, please
send an email message to
mjd-perl-practice-2002+ at plover.com
Don't forget to say which class or classes you plan to attend.
Please circulate this notice to any people or mailing lists that you
think might want to see it.
My profuse and heartfelt thanks to Chip Buchholtz and to the
University of Pennsylvania School of Engineering and Applied Science
for providing the space and AV equipment for these sessions.
Mark-Jason Dominus mjd at plover.com
----- End forwarded message -----
--
David H. Adler - <dha at panix.com> - http://www.panix.com/~dha/
"Dir-ty deeds...DONE TO SHEEP!"
Heh heh...AC/DC, eat yer heart out.
- Mary Roth
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe ny" to majordomo at lists.pm.org**
----- End forwarded message -----
--
Andy Murren
andy at murren.org
More information about the morriscounty-pm
mailing list