Python questions from C/Perl/Java programmer

Grant Griffin g2 at seebelow.org
Wed Aug 30 03:28:19 EDT 2000


Tom Biggs wrote:
> 
> Clarence Gardner wrote:
> 
> > [Tom Biggs]
> > >> I doubt I'll abandon Perl altogether - I try to pick the right
> > >> tool for the right job - but Python looks very clean.
> > >
> > [Tim Peters ]
> > >I was a Perl programmer before I picked up Python, but that was in '91(!).
> 
> Well, Tim, you gave it up too early...  <grin>   Perl 5 is a blast.
> 
> > >After a year or two, you may well find your Perl use reduced to 5-liners!
> 
> > >And even then, over & over you find yourself saying "hmm!  If I had written
> > >that in Python instead, I wouldn't have had to track down this bug".
> >
> > Tom, just in case you might feel obliged to pick up Python gradually, let
> > me tell you the way I did it.  I was writing mostly Perl with some C when,
> > about three years ago, I picked up "Programming Python", read it that night,
> > and haven't written a Perl program since.  That day, I started implementing
> > a billing system for my company, completely in Python.  When I occasionally
> > need to go back and do something to it, it's a breeze and I prostrate myself
> > before my icon of Guido and give thanks that I didn't write it in Perl.

Yup.  Just go cold turkey on Perl--you'll experience a sigh of relief
rather than any withdrawal pains. <wink>

And I've had to resist the urge To carry that a step further and rewrite
all my old Perl scripts into Python (so I can maintain 'em <wink>).  But
I haven't been able to completely resist: Python is such a pleasure that
one finds excuses to use it.

However, in translating some of my Perl code, I've been surprised to
find that that it's mostly a mechanical exercise.  For example, Python's
'dicts' are semantically about the same as Perl's...whatchamacallits?. 
The mechanicalness of the translation suggests the possibility of a
translator program.  <<comprehensive python archive network>>.  But from
what I understand, there still are enough semantic differences to make a
translator difficult to implement.  (But one that handles only the
mechanical part still would be pretty useful...)

> >
> > I also believe in using the right tool for the job, but somehow none of my
> > jobs call for using Perl....
> 
> Obviously I must withhold judgment until I learn Python.  Eric Raymond
> loved Perl too but judging by the way he raved about Python (pretty much
> the same as your reaction, "he ain't workin' on Larry's Farm no more" <grin>)
> I may end up the same as you guys.

Now, don't believe everything Eric Raymond tells you. ;-)  <<red hat
investors>>

In my own case, I got steered to it when I read "Advanced Perl
Programming": the author spends a chapter or two explaining Perl OO
(which is partly why I bought the book--to try to figure that junk out),
and then quietly slips in something like, "but Python is my favorite OO
scripting language."  <<sells o'reilly's python books>>

I also was interested in doing TK programming, and I found the Perl
interface to it to be *VERY* difficult to install.  The Python
installation of TKinter has one well-known pothole, but it's still much
easier.  (Ironically, though, I've never actually done any TK
programming!)

> I recently wrote a whole suite of Perl applications where the data was
> so tightly integrated with the hash trees, that the program became
> simplicity itself.  I hope I'm not making too bold a claim here but
> I've never seen any Perl code anywhere which looked at all like it.
> The programs shrank to 20% of their original size after I came up
> with the scheme I used, and became (IMO) more understandable.
> I'm also very much a fanatic for readable code, too, so I flatter myself
> that the programs were easy to someone besides me to pick up
> (It's way to easy for the lazy to write totally indecipherable Perl.)

That's one of the beauties of Python: writing indecipherable code is so
difficult that only the most dilligent even try. <wink>

> But of course Python has its own 'hash equivalent' data structure
> (I'm such a newbie that I can't remember what they're called right
> now) so who knows what I will come up with.

Oh...that's right: "hash".  Thanks--I remember now. <wink>

just-as-C-succeeded-Pascal,-so-python-is-destined-to-succeed-perl
  ly y'rs,

=g2
-- 
_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation	      http://www.iowegian.com



More information about the Python-list mailing list