why tar is strange

Martijn Faassen m.faassen at vet.uu.nl
Tue May 23 05:54:19 EDT 2000


Grant Griffin <g2 at seebelow.org> wrote:
[I am surprised you would take a year learning Python]

> Well, lemme give you an example.  I figured out the other day that the
> way to do sscanf was:

>    map(float, string.split(s))    # (IIRC)

> Well, obviously!

I never used that. 'for' loops are generally more clean and more
extensible in Python. I only find myself using map() rarely, filter()
even more rarely, and reduce() hardly at all. Of course your mileage
may vary.

> Besides map, Python has lots of built-in functions emboding concepts
> which aren't familiar to me as an experienced C/C++ programmer, for
> example:  map, reduce, lambda, filter, etc.

I think Guido's idea here is you shouldn't use those a lot anyway. It's
said he rather regrets adding 'lambda' to the language, after all. 
Not that this kind of functional programming can't be fun.

> Sure, one can RTFM about
> these.  But learning the "what" is just the beginning: learning the
> "why" and the "when" is what takes a lot of practice.  (Anytime someone
> says "the Pythonic way to do that would be...", they're talking about
> what I'll be learning over about the next year or so.)

Okay, that's picking up some idioms. It's just that after a few weeks
you can already write programs that, while they might not use the
absolute 'best' in idioms, they're already pretty *close* to what an
expert would write. So while you can still pick up stuff, you're actually
quite up to speed after a short while.

> Oh, and did I mention the libraries?  More study and practice is
> required here.  Whatever their intrinsic merits, Python's libraries are
> at least significantly different from the libraries of other languages
> (which are likewise different from each other.)

Some of them are; many of them are simple wrappers about C libraries
(which I never used when I used C, now I would use them far more :). 
Of course learning the libraries is an eternal process, but I wouldn't
classify that under learning *Python*. In general, it's not like most
Python standard modules are like C++'s STL or the stream library, after
all. You don't have to know their ins and outs before you can claim you
know the language.

If-you-had-I-couldn't-claim-I-did-ly yours,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list