[Tutor] Ruby Code Blocks vs. Python Lambdas

Alan Gauld alan.gauld at btinternet.com
Tue Nov 7 10:56:42 CET 2006

"Carroll, Barry" <Barry.Carroll at psc.com> wrote

> Thank you for this post.  I was in a discussion of Ruby vs. Python 
> at
> lunch today.  The consensus was that Python was much better than 
> Ruby in
> all ways.

That's a little hard on Ruby. There are many good features and several
of them are arguably improvements on Python. But Python is
still easier for me personally to grok, I'm not sure why exactly.

> I have struggled considerably with lambdas since taking up Python. 
> I'm
> still not really comfortable using them in production code.  I agree
> that Ruby's style is more intuative and easier to use.  I wonder if 
> a
> future version of Python could adopt this style.

I think it would be difficult without adding block delimiters to
the language, and most of the common symbols already
have a role ([],(),{}, |, etc).

Also Guido prefers explicit definition of functions to
anonymous ones - explicit is better than implicit is
one of Pythons principles after all.

Alan G. 

More information about the Tutor mailing list