Hacker News new | past | comments | ask | show | jobs | submit login

Python is my main language, but can understand the attraction of Ruby over Python to people stuck with Java or PHP and screaming out for something new.

Python has stuff in it that's weird until you learn to ignore it. Example - joining several items in a list so they're comma-separated. In python you do this:

    print ', '.join( [1,2,3,4,5] )
The code doesn't work in the way someone new to the language thinks about the problem. I've trained two colleagues in the basics of python, and both of them gave me the "what hope did I have of working that out?" look when I showed them this.

In ruby you do this:

    puts [1,2,3,4,5].join(", ")
Ruby avoids the whitespace debate but still manages to produce reasonably pretty code. You have to type 'end' (slightly more verbose), but you save on the colon at the beginning of the scope, and it's probably easier to write non-functional one-liners in ruby as a result. (I wouldn't know, I love my lambda :) )

Python's self keyword has the sitting-at-the-plugboard feel to it. So does __init__ - the token is ugly. Then there is the unfortunate 'super' syntax. Experienced python programmers rarely need or use it, but transitioning Java developers think in a way that leans on frequent superclassing. The python __name__ == '__main__' pattern is cryptic. Packaging mechanisms are ugly (again - something Java developers will be itching to use).

I suspect Ruby presents less culture clash if you come to it from Java, and is easier to get your head around if you come to it from PHP. Smalltalk isn't in the same domain as tools like perl, python, ruby. I think rails rode on the back of Ruby rather than the other way around - there was nothing revolutionary in rails, it was an enabler for Ruby.




You're focusing on the small surface details.

Also, the words "begin" and "end" were used in ALGOL and PASCAL and no one had much of a problem with them.

Concepts > languages/notations


When someone is deciding what language to learn, though, surface details are the main thing they have to work with. It doesn't necessarily make it justified, but it's the reality of the situation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: