Live data from Hacker News

Ask HN: Why Python over Ruby?

news.ycombinator.com

121–130 of 198 posts

Re: Ask HN: Why Python over Ruby?

#121
post #50

For me it's very simple ! I can READ other people's Python code with greater ease than Ruby, Java, C#, C++ or even C. At the end of the day, the quicker I can assimilate library code the quicker I can use it well and the quicker the module gets completed and fully tested. Of course, with Google and Eric Raymond raving about it, the confidence factor increased further.

This is a cultural issue. In the Ruby (or Perl) community, if you use obscure language features to do a common task in a single line of code, you will be worshipped as a god. In the Python (or Tcl) community, you will be viewed with suspicion. Not that Python doesn't have one-liners (e.g. comprehensions) - just that everyone agrees which ones and when and how to use them.

"This is a cultural issue. In the Ruby (or Perl) community, if you use obscure language features to do a common task in a single line of code, you will be worshipped as a god."

Just which Ruby community is this? None that I associate with, that's for sure.

To the people who voted the OP up; is it because of your own first-hand experience with other Rubyists? For all I know there are clusters of Ruby coders who encourage obscurantism, but I've not encountered them (though I've been part of debates over just what constitutes "obscure").

Re: Ask HN: Why Python over Ruby?

#122
post #55

Ruby has clever syntax. Python has pure syntax. Ruby has method aliases. Python does not allow a string to capitalize itself. Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function. Ruby has strict object-oriented encapsulation. Python is laid-back about objects, because you probably know what's g…

None of these are reasons why Python is more prevalent than Ruby. Also, i would point out that sometimes, expressiveness is useful :P So sorry sir, but this isn't just biased, but also bordering on a troll. Bullet points like these are not justifications in themselves. They're just a list of things to try and DDoS an argument. What is your actual point?

Sorry to see you so down-modded.

"So sorry sir, but this isn't just biased, but also bordering on a troll."

Poster is being facetious (somewhat :) ) to make a point about differences in language and community philosophies.

The semi-troll nature is pretty amusing, though. The "verse/prose" comparison is sure-fire flame-bait; I love it. I will keep that one handy ...

Re: Ask HN: Why Python over Ruby?

#123
post #55

Ruby has clever syntax. Python has pure syntax. Ruby has method aliases. Python does not allow a string to capitalize itself. Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function. Ruby has strict object-oriented encapsulation. Python is laid-back about objects, because you probably know what's g…

I think it's like dog people and cat people.

Python is like being in the Netherlands. You're surprised that everything seems to work so well but at the same time something feels a bit weird.

Re: Ask HN: Why Python over Ruby?

#125
post #100

What's clear to me reading the comments in this thread, is that there are a lot of people who like Python, and don't understand what people appreciate in Ruby. None of these are reasons why people choose Python over Ruby. Or why Python has become more popular. It is worth noting that Python was also mentioned a lot as a teaching tool when its popularity began ramping up, and some universities have replaced Java and S…

To claim that Ruby is a tangled soup of options and syntactic sugar is to miss the point really. What is the point? I sincerely wish to learn, for my own intellectual curiosity. Because I have read Ruby code and I have done Ruby tutorials and talked to people who use Ruby and for the life of me, no matter how hard I meditate on the issue, I cannot understand why anyone would use Ruby over Python. I don't feel Python…

"Ruby presented far more cognitive hurdles for me because it allows you to do things in ways that seem simultaneously mildly more convenient and completely counter-intuitive to everything I've experienced with similar styles of languages over the past 10 years."

Don't use Ruby.

If it presents that much trouble, go find another language. Use Python or C# or Haskell or whatever fits best and gets the job done.

Many of the things you find to be cognitive hurdles and completely counter-intuitive are there on purpose. They are never going away because many other people (and matz in particular) find them to be cognitive enhancements and completely intuitive.

Don't waste time fighting it.

Re: Ask HN: Why Python over Ruby?

#126
post #15

Python is far more mature, isn't a strange ad-hoc combination of other languages, has a third-party library to do anything and everything (which is probably also reasonably mature), and doesn't have a community rife with arrogant children. I'm generalizing to some extent, of course, but these are the things that I and other developers I know associate with Ruby (including many who's startups are built on it). I imagi…

"Python is far more mature"

How so? It's mot like Python is 10 or 20 years older, so how do you determine the "far more" part?

And of what value would this difference in maturity be? COBOL is "far more" mature than Python. Is that a big win for COBOL?

Once a language reaches some reasonable age and general wide-spread usage, points about maturity seem silly.

(On reflection, I suspect you're just trolling.)

Re: Ask HN: Why Python over Ruby?

#127
post #70

Earlier quoted context omitted.

Quoting an article on the topic: Having ploughed through several tutorials, I did not find Ruby particularly "elegant", or its syntax particularly obvious. Much of it seemed ad hoc, thrown together, in particular when there were several different ways of doing something, and it seemed to be the philosophy of the language to provide all of them. I did not find its constructs as intuitive and natural as claimed, trying…

Well, I can answer at least a few of those 'WHY?!'s. Firstly starting with my_string['foo'] = 'bar', this is a syntax that is used a lot in Ruby for anytime that you wish to recover a subset of a collection - you can use it with a Dir object for example to recover a subset of directories/files, or in the case of a hash, to recover the object stored at the key. The thing is that you need to think about it as being a s…

>I get the impression that you simply didn't spend enough time with Ruby to come to understand its idioms, in which case, you're not really in a position to effectively criticise the language...

Well yeah like others have been saying, python is more attractive to new users is probably partly why it's more popular. You don't need to work as hard to understand its idioms, it's more readable by newbies (by anyone), etc.

Re: Ask HN: Why Python over Ruby?

#128
post #51

Earlier quoted context omitted.

Check out the Ruby blog scene. It's a wonder they actually write any code in between the bragging about how awesome they are and slagging each other off.

So you're going to judge the entire Ruby community by like... 5% of their bloggers? :P

Hey, now we can judge the entire Python community by tdavis's comments.

:)

Re: Ask HN: Why Python over Ruby?

#129
post #97

Earlier quoted context omitted.

"a community rife with arrogant children." During FISL, a couple days ago, I witnessed something that really bothered me. It was a presentation comparing Rails with Seaside (which is, by itself, like comparing racing cars with subarines) and the arrogance of the Rails guy dismissing Seaside, Squeak and Smalltalk was very uncomfortable. It seemed the room was too small to fit all the egos inside it. I considered stayi…

Rails folks are like that. Even though the rest of the Ruby community is much more reasonable, the weekly Rails debacle has driven a lot of people away from Ruby, including me. If Rails weren't around, it would be much easier to enjoy Ruby without having to use it in isolation. Then again, a whole lot of people wouldn't have gotten into it in the first place. Ruby lived fast and died young. If you don't want to use P…

"Ruby lived fast and died young. "

Sweet! I am making a living using a zombie, undead, from-beyond-the-grave programming language!

I better hook up that USB Ouija board and get coding.

Re: Ask HN: Why Python over Ruby?

#130
post #46

Both have their uses. I was a Perl hacker so Python was the obvious choice for me - but I would use Ruby for specific projects, for example if I desperately wanted a one-off app that primarily depended on a stable Ruby library where no Python one existed.

"I was a Perl hacker so Python was the obvious choice for me"

Interesting. I was a Perl hacker, and Ruby was the obvious choice for me.

Post reply on HN