Help understanding the decisions *behind* python?
nobody at nowhere.com
Sun Aug 2 04:47:59 CEST 2009
On Sat, 01 Aug 2009 19:19:43 -0700, sturlamolden wrote:
>> More than one person here has
>> observed that the time to learn to program Pythonically is inversely
>> proportional to their experience in Java.
> I believe it is opposite. The longer the Java experience, the longer
> it takes to program pythonically. The correlation is not inverse. In
> particular, programmers accustomed to Java or C++ seem to use for-
> loops awfully lot. And when they do, they always loop over a sequence
> of integers, and use these as array indices.
It would be more accurate to say that of programmers who are *only*
accustomed to Java or C++. I've been using C for 80-90% of my code for 25
years, and I wouldn't normally loop over the indices. But then the other
10-20% is Lisp, Tcl, Haskell, PostScript and, more recently, Python.
OTOH, using a "for" loop when you could use a generator means less work
when you need to make a minor change and a generator is no longer
More information about the Python-list