You don't know how lucky you are.

achrist at easystreet.com achrist at easystreet.com
Sun May 18 03:29:27 EDT 2003


Dennis Lee Bieber wrote:
>         I recall my college days (and no, I did have RPG available at my
> college -- BASIC, FORTRAN, COBOL, SNOBOL, APL were the HOLs) when
> someone taking the computer route at another college asked me for help
> on an assignment (we both were part-timers at Sears). HIS school used
> RPG.
> 
> ASSIGNMENT SUMMARY: You are given two sorted files. You are to produce
> one sorted file combining the two.
> 
>         His planned solution... Copy F1 to Fout, append F2 to Fout, invoke
> system sort on Fout.
> 
>         Apparently his school failed to cover any moderate algorithm design...
> Like the common sort/merge algorithm (and since he already had sorted
> files that problem just reduced to just the merge part).
> 
>         Footnote: His school also managed to place him in a job after
> graduation -- I have no further news of his eventual end...

Not always wrong.  I did some timings on big IBM machines, and the
sort programs on those things are very highly optimized.  I found
that the sort program (syncsort, IIRC) could read + sort + write a
file faster than I could simply copy it with PL1 code (optimizer
on, record IO, properly blocked).  Of course, a decent sort program 
could be set up to do a merge, so you could save some of the copying,
but I believe that it would also detect when the input consisted of
just 2 runs (or maybe 1) and just do the merge.  And by requesting the 
redundant sorting, you would be completely protected from any need
to worry about any crash or hang-up or bad output if someone
screwed up and gave you a file that was unsorted, or sorted on
the wrong fields, or sorted using a different collating sequence.
WTH wants to program all that error-handling?  

The XP guys always ask, "What's the simplest thing that could 
possibly work?"  Sounds like he found it.  RPG guys were kind of
like that.  I had one working for me for a while, and I couldn't
keep him out of my office.  Everything I gave him to do, he'd
be back in 15 minutes with it finished.  I don't think he knew
much about alogorithm design,  and I didn't want to know what
was in his programs any more than I wanted to know what was in
my lunch at the company cafeteria,  but whatever it was, no matter
how ugly, he was good at it.


Al




More information about the Python-list mailing list