Perl is worse! (was: Python is Wierd!)

Huaiyu Zhu hzhu at localhost.localdomain
Sun Jul 30 22:10:21 EDT 2000


On Sun, 30 Jul 2000 02:47:39 GMT, Steve Lamb <grey at despair.rpglink.com> wrote:
>
>    Whoops, exited too fast.  When I started programming it was in Turbo
>Pascal 3.  I had the absolutely WORST time with that language at that time
>because of typing because I couldn't just do what I thought was logical.
>Furthermore the casting also didn't work in any manner that I thought logical,
>either.  I hit the same problem in C.  I really, REALLY despised being told
>that what I wanted to wasn't possible when I knew darn well it /was/.

There are different categories of typing.  There are strong (no automatic
conversion) and weak typing.  There are static (declared when variables are
created) and dynamic typing.  Python is strongly and dynamically typed.

Strongly and statically typed languages do have the problems you pointed out
- they are too brittle.  But the fault is more at the "static" part than the
"strong" part, at least as most people here would say.  Perl is sort of the
other extreme that is both weakly and dynamically typed - it feels too
anarchical (sorry I can't find the proper word).

There's no way one can escape type (or class) if one wants both 1+1==2 and
'1'+'1'=='11' in a language.  So far (at least) three mechanisms have been
described in this thread:

- associate type with names (variables), like C
- associate type with operators and context, like Perl
- associate type with objects (data), like Python.

If you try some real world examples, you might discover that the Python way
is better than the other two in many cases.  I've tried all three and this
is my feeling for the majority of cases.

Huaiyu

PS.  Ironically, in the area I'm mostly interested in at the moment, the
distiction between matrixwise and elementwise operations, I find that
association with operators is much better than association with data.  But
this is another (long) story.



More information about the Python-list mailing list