formats considered harmful? (was Re: report generation with format/write)

[email protected] ("Bradley M. Kuhn")
Newsgroups perl.trainers
Message-ID <[email protected]>
Larry Wall wrote:
> [email protected] writes:
> : Does anyone actually teach report generation with format/write?  I
> : haven't really seen anyone using it much in the last few years, but I've
> : just had a corporate client ask us to teach "reports" in Perl.
> : 
> : It's not part of our standard introductory Perl course, and to be honest
> : I'm dreading having to write it ... ick ick ick.
> 
> Unless line printers come back into vogue, I wouldn't put a lot of
> stress on it.  These days, most reports are printed on browser screens.


Hmm...from the mouth of the original author of formats.  Maybe it's time we
stopped teaching them.  :)

Sometimes, I feel like I am cheating students by glossing over formats,
since they are there in the language and I have used them myself for some
tasks I probably couldn't have done without them.

The hardest thing I have had is whether or not to cover them in the freely
redistributable tutorial I am writing (http://www.ebb.org/PickingUpPerl).
This tutorial came out of class prep. that I did for training courses, and I
always deferred to _Learning Perl_ for information on formats (as I, too,
dreaded writing format tutorial).  Perhaps I should leave them out
altogether.  Ah, decisions, decisions.  :)


> On the other hand, maybe fixed-width characters will be viewed as retro
> and cool in 5 years.  You never know, you know...

That would be particularly post-modern.  :)


(My best anecdotal story about formats was when I first learned Perl as a
 teenager coding for my dad (who first taught me Perl)'s software consulting
 company.  I used to submit my code to him in printed form for reviews.


 He had never used formats himself, and we had to fire up perl and check
 before I could convince him that:

  $---;

 was not an typo.  :)
-- 
         -  [email protected]  -  Bradley M. Kuhn  -  [email protected]  -
                          http://www.ebb.org/bkuhn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.