News for hackers. Stuff that matters.
Re:Ruby is beautiful (but I'm moving to Python) by rue on Sunday November 28, 2010 @03:05PM (#1948123)
I have a strong dislike for the now-nearly-meaningless terms "beautiful", "eloquent", "elegant" &c. but for me the deciding factor between Ruby and Python for a project (assuming no constraints from libraries required and such) is Ruby's internal consistency. Python is a bit more haphazard; the infamous `len(str)`, to wit.
Re:Ruby is beautiful (but I'm moving to Python) by masklinn on Sunday November 28, 2010 @03:11PM (#1948143)
> Python is a bit more haphazard; the infamous `len(str)`, to wit.

There is nothing infamous about it. It's a multimethod, the designers of Python decided that mandating the same function for everything (via a common protocol under the covers) was better than risking people implementing a thousand different method names. They did the same with the iterator protocol.

Re:Ruby is beautiful (but I'm moving to Python) by rue on Sunday November 28, 2010 @03:32PM (#1948198)
I think that is a poor argument since the same is not true of every function. Therefore, it feels inconsistent to me, which is the only basis I can make judgments on.
Re:Ruby is beautiful (but I'm moving to Python) by masklinn on Sunday November 28, 2010 @04:21PM (#1948341)
> I think that is a poor argument since the same is not true of every function

What is not true of every function?

Re:Ruby is beautiful (but I'm moving to Python) by binomial on Sunday November 28, 2010 @10:46PM (#1949300)
I think the GP was referring to "mandating the same function for everything (via a common protocol under the covers) was better than risking people implementing a thousand different method names".
Re:Ruby is beautiful (but I'm moving to Python) by adambyrtek on Sunday November 28, 2010 @05:45PM (#1948590)
I wouldn't call Python haphazard, it's just a different approach. Ruby was designed from the ground up as an object-oriented language, and the fact that everything is a method call (message) gives it a touch of consistency. This is different from Python which is a multi-paradigm language. In fact the early releases didn't support objects-oriented programming at all. On the other hand Python may feel more consistent because of the fact that, in contrast to Ruby, there is one obvious way to do something[1].

[1] http://www.python.org/dev/peps/pep-0020/