Comparison between Python and "Ruby"

Andrew Csillag andrew at starmedia.net
Fri Oct 29 18:19:54 EDT 1999


Martijn Faassen wrote:
> > * No way to automatically convert between long integer and small
> > integer.
> 
> I'll leave this to someone else. Is this a problem? A feature?

I rarely have problems with this since you can do 1+1L and get 2L....

> > * Writing extension modules is bothersome (some betterments in 1.5)
> 
> People more experienced with this can comment on this. Using SWIG certainly
> isn't very difficult, though..

In my experience, unless ruby's extension interfaces is like tcl's which
while simple, isn't terribly powerful, Python's is simple enough (I've
been known for doing simple extension modules in about 3 minutes -- no
SWIG). But even complicated ones with SWIG aren't hard.  Actually, even
without SWIG it isn't really hard, just boring since most of it is
boilerplate.

> > * Function objects are accepted as arguments, but iterators are more
> > elegant.
> 
> You can implement iterators in Python, though?
> Better core level iterator support would be nice for Python 2.0, though
> (for instance for loops could use them).

I argue that simplicity is better than elegance most of the time, thus
function objects over iterators.  Besides who wants to make an iterator
when you just want to pass a function you already have?  Reminds me of
how you pass methods around in Java (make an instance of (usually) an
inner class that inherits from some interface that just calls the outer
class's method)... Grr...

> 
> > I am still trying to download a copy of Ruby to look at it myself,
> > however do people think these comments are justified?
> 
> Most of them have a point, but the problems caused by these things are
> generally not big. Some of these problems are seen by others as advantages.
> All in all, if this is the worst list of problems one can come up with
> for Python..it could've done far worse. :)

>From what I saw, it looks like they tried to mix python and perl by
sticking the python down the camel's throat and got camel puke.  You
have whitespace for indentation, but all the regexy crap and extraneous
?'s and $'s that make it ugly.

-lets-make-a-language-named-perl-so-we-can-cast-it-to-swine-ly yours,
Drew
-- 
import string,sys;t=string;f=t.index;j=t.join;print(lambda
s:j(map(lambda
x,s=s:x[:f(x,':')+2]+j(map(lambda y:'%02X'%ord(y),x[f(x,':')+2:]),'
'),map
(lambda i,s=s:("%04X: "%
i)+s[i:i+16],range(0,len(s),16))),'\n'))(open(sys.
argv[1]).read())




More information about the Python-list mailing list