python vs ecmascript

Oktay Safak oktay_safak at yahoo.com
Thu Nov 22 10:46:25 CET 2001


I dealt with Javascript for some time before I took a
serious plunge into Mighty Python and here are my
observations about the language:

Javascript looks very appealing at first JUST because
of its C (or Java) like syntax with weak typing and
dynamism(and I think these are the ONLY things that
make JS appealing at first sight). Considering the
domain that you are supposed to use it you think "oh
well, this is great". And I agree that it may well be
more than enough for its intended purpose. But no
matter how close it may compare to Python
conceptually, actually they are not comparable.

You admire JavaScript when you see at first but there
is always a feeling that something is not just right
with the implementation of these ideas. And only after
studying Python you finally understand what is wrong:
it is mostly a lack of coherence and good design.
Compared to Python's coherence and good design JS
looks like a *pile* of features arbitrarily brought
together. Python on the other hand, has borrowed many
ideas from other languages but their unification is
truly unique (at least to me). Apart from the many
extras of Python as a mature and general purpose
programming language, its implementation of the ideas
of good syntax, dynamic typing and code dynamism
(which is the result of being an interpreted language)
is much better. C-like syntax looks appealing at first
if you have that background but it promotes highly
cryptic coding and it is no easy task to figure out
what a sufficiently advanced JS script that some other
guy has written is meant to do. On the contrary,
Python syntax is very unorthodox and may seem odd at
first but when you eat your prejudices and get it, you
begin to wonder how you have done without it and how
you'll ever be able to code in other languages again.
Even advanced Python code (like the ones in the
standard library) are highly readable and fairly easy
to understand. For typing, Python has taught me some
good lessons too: after VBA and JS I thought that weak
typing was nice, but after studying Python I
understood that it is not *weak* typing that is nice,
but it is *dynamic* typing. Other posters also wrote
on this typing issue so that's enough for now I think.

Apart from these similarities, Python has much much
more to offer as a language which others in this
thread have mentioned. But what is especially
important to me (second to its great community:) is
its ability to lend itself to the development of
(very) large and complex programs which I used to
think would only be possible with something like C++.
Especially after 2.2, Python has become quite "slick".
Javascript aside, even the giants have a serious
thrill now. The only disadvantage of Python against
them is that it's not as fast due to its interpreted
nature, but that is what it is.

Since Python's origins predates JS, it is quite
possible that JS script inventors knew and were
influenced by Python. That may or may not be the case,
but Python is what JS guys have missed, I think.

and-there-is-no-Tim-Peters-for-Javascript-ly yours,

Oktay Safak 
c.l.p resident lurker


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1




More information about the Python-list mailing list