Should I Learn Python or Ruby next?
Stephen Hansen
ixokai at ixokai.io
Wed Jun 23 19:35:38 EDT 2010
> Would you like to present another way of achieving the same code that
> makes Python look better, i would love to see it. Here is an even more
> interesting example of "Ruby linear-flow" verses "Python lisp-style-
> nesting"...
>
> RUBY:
> ["three","one","two"].map{|x| x.capitalize}.sort.join(',')
>
> PYTHON
> ','.join(sorted(map(lambda x:x.title(), ["three", "one", "two"])))
','.join(x.title() for x in sorted(["three", "one", "two"]))
> I do the Python code all the time without thinking twice about it. But
> to a noob i'll bet Ruby is more decipherable in these cases. It's
> ironic that Python was created by a westerner and we read it from
> right to left, and Ruby was created by a easterner and we read it left
> to right. Go figure?
You read Python from right-to-left; "we" don't-- I don't.
--Stephen via iPad.
More information about the Python-list
mailing list