Python is wierd!

Mark Baker mbaker at 0x7a69.net
Tue Jul 25 16:24:28 EDT 2000


In article <397DE866.CA57D01D at alabanza.net>, "ye, wei" <yw at alabanza.net>
wrote:
>> 1. There are no keywords to declare static or instance variables; it
>> all depends where they are placed(whether it's right after the <class>
>> statement, or inside a <def>). Isn't it harder for other programmers to
>> know at one glance what type of attributes the class define?
> 
> This is what I couldn't tolerate as well!! I'm the same guy is looking
> for another new language, my path is C/C++->Java->PHP->Perl.

Python's scoping rules are rather simple. If you don't understand a
language's scoping rules, they will all look "weird." I imagine that you
would find LISP's lexical scoping quite odd, for instance.

When a language (like C++) reuses keywords ambiguously to indicate
whether a binding belongs to class or an instance, I'm sure that for the
unambitous learner, it too is confusing.

But it's rather hard to look at a class and not know if a given variable
belongs to a class or an instance, unless you bind it in some obscure place.

 
> I'm the same frustrated as you about the Perl/Java and now Python, Java
> is a good language, however it's not open language. Perl has some
> language deficients as well. Python is so loose for type checking.

That's the point. The idea is that static typing costs more in developer time,
creates stale frameworks, and provides little practical benefit for an
experienced programmer. Whether this is true or not, is a different story.

Languages like Java, though, aren't totally statically typed, so they're hardly
"safe" languages, but reduce productivity where they are statically typed
enough so that they're a hassle.
Compare development times between Smalltalk and Java, and you'll see
what I mean.

> However
>
> today I just read the Perl6 vision, it makes me very exciting -
> 
> http://www.perl.org/perl6/pr/initial_meeting.html The new Perl 6 will
> support Typing(e.g. "my Dog $spot") , OO, Threads and more features!!

Perl 5.6 already has the my Class $... syntax, as well as a hacked-on object
system, threads, and more "features" than I'd care to have in one language.

If you want a dynamic and static language, I'd suggest Dylan or Objective-C.
They both also avoid the problems of broken frameworks totally statically typed
languages fall into, through the flexibility of their dispatch systems.
 
> It also will bring some python's features into Perl.  :)

Elaborate.
 
>> Furthermore, some ppl claim that Python is easier to learn, enables you
>> to write much cleaner codes... However, after reading the python book,
>> my head is still spinning, trying to catch all the 'intricacies' of
>> this language. No doubt it will be a powerful and useful 'tool' to me
>> once i get used to it; but i don't think it's suitable to be a first
>> programming language for non-programmers(i read somewhere about this
>> project going on). Pascal(for procedural) and Java(for OOP) is still
>> the better choice to start off, IMHO.

This isn't related to your post, but its parent...
Python and Smalltalk are both good introductory languages, since they
are both less complex than Pascal or Java, and allow the student to learn
how to program, instead of fumbling over complex syntax.



More information about the Python-list mailing list