Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python vs Ruby holy war thread

Name: Christy McJesus !DcbLlAZi7U 2005-04-12 13:11

Last week I learned Python. It's not perfect but it's pretty damn cool.
This week I'm starting on Ruby. I've just encountered blocks and I would approve if someone would answer this: are blocks merely an ugly kludge because the author did not know about lambda expressions, or can they do something lambdas can't?

Name: Anonymous 2005-04-17 16:32

Just try this:
Python: [ x**2 for x in xrange(100000) if x % 2 == 0]
Ruby: (1..100_000).select { |x| x % 2 == 0 }.map { |x| x**2 }

RUBY WINS! Python is ten times slower!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List