python vs ecmascript

Cliff Wells logiplexsoftware at earthlink.net
Fri Nov 16 12:59:35 EST 2001


On Friday 16 November 2001 08:17, Peoter Veili wrote:
> Anyone familiar with ECMAscript (JavaScript)?  How does it compare to
> Python?  I studied ECMAscript last year, people have an aversion to it
> from doing web client programming, but it is a high-powered OO scripting
> language in its own right.  Clearly the one downside of ECMAscript vs
> Python is that Python has been around longer and has a large set of
> existing libraries.
> Besides that is there any major advantage that Python has?  I am new to
> Python
> but already I am seeing some limitations that don't exist in ECMAscript.  I
> am
> also a bit annoyed at some things like having to wrap objects in a str()
> before
> printing, I don't see why this can't be automatic.  

Since when?  The print statement automatically invokes str() on its arguments.
>From the documentation:


This thing about only
> having
> two scopes, local and global,  I don't see the logic.  Is this by design,
> or is it
> simply a current limitation?  The book I have says it may change in the
> future.

If you are using Python 2.1:

from __future__ import nested_scopes

Will give you what you are looking for.

Perhaps you perceive limitations in Python (compared to ECMAscript) because 
you know how to do things in ECMAscript but not in Python.  The only way 
you're going to really find out which you'll like better is to sit down and 
start writing programs in them.

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308




More information about the Python-list mailing list