Live data from Hacker News

Ask HN: Why Python over Ruby?

news.ycombinator.com

161–170 of 198 posts

Re: Ask HN: Why Python over Ruby?

#161
post #56

Earlier quoted context omitted.

I have used both, Python more than Ruby. Python's iterators are more usable in many situations than the Ruby block system. I can return an iterator, stick it in a variable, call another function with it that returns another iterator, and so on. Python's classes also seem cleaner and less magical than Ruby's. For example, a method on a class is just an attribute that happens to be a method. Much more intuitive than Ru…

Everything is an object in Ruby, including the blocks. I'm not clear how you can't pass around a block -- or is it the block + iterator metadata you're talking about? I suspect that's just an experience problem, where Python promotes iterators over lambdas so lends itself to a different style of programming; I'm not sure how often you'd want/need to pass a full iterator around in Ruby. Personally I find blocks far mo…

Under what circumstances have you had to write a "metric buttload of boilerplate"? I've not encountered this with Python in my experience.

Re: Ask HN: Why Python over Ruby?

#162
Most of the discussion seems to ignore the "in this space" (scripting existing software packages) part of your question.

I submit that Python is more popular in this space because:

- many end users will be users of the package first, and programmers very much second. In this case a very gentle learning curve is more important than ultimate expressivity for hackers.

- In the same vein, it superficially looks more like BASIC than Ruby does

- The C API may be simpler to use than the Ruby interpreter, though never having used Ruby's C API that's speculation on my part. Never understimate implementor laziness as a technical driver.

Re: Ask HN: Why Python over Ruby?

#163
post #72

Earlier quoted context omitted.

Why is that? It can easily be proven. I'm not trying to suggest that everyone who uses Ruby is an arrogant child as I even have friends who certainly don't fit that bill, but when you have an especially abrasive attitude like that within a community, it only takes a minority to sour the majority. And while it certainly isn't a fault of the language , it definitely influences it usage for some people.

Umm....and have you ever spent anytime time in #python? Some are helpful, but there are a choice few who I would describe as arrogant children. In any community of size, you get good seeds and bad seeds. Python is not immune to this.

Actually, for a while I was spending quite a bit of time in #python. I didn't come across "arrogant children".

Looking at some of the drama and prima donna action in the Rails community (from a distance) just made me sad and grateful that my corner of Python (scientific computing) doesn't have those sorts of issues.

Re: Ask HN: Why Python over Ruby?

#164
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.)

Speaking as a commercial Python developer, I can honestly say that there is a tremendous amount of interest in and usage of Python across a wide spectrum of commercial and enterprise applications. This is everything from realtime high-frequency trading to oil exploration to mixing toothpaste to processing Hubble images to manufacturing SATA and PCIe driver chips. The very active, very professional community around the language, combined with the ease of integration with legacy codebases in FORTRAN, C, and C++ makes it very popular in the commercial sector. Consequently, there are numerous institutions and companies that have developers spending time on improving the langauge and its underlying libraries. Guido is a sharp guy and is sensitive to all the places where Python is used, and he takes these into consideration when approving or disallowing language changes. This understanding and the overall process makes the language "mature".

On the flip side, I am not aware of any significant impact of Ruby in commercial development that is not web-driven. When we bid on projects and talk to prospective customers, we're typically making a case against Java and C++. I can't recall a single instance where someone seriously asked us about Ruby. (We've had more inquiries about KDB and K, that abomination of a language.)

So, just my $.02 as a scientific software developer.

Re: Ask HN: Why Python over Ruby?

#165
post #23

Earlier quoted context omitted.

How does python compare to ruby in terms of web development? I get the impression that there are more 3rd-party libraries in Ruby, so it is easier to get web code up and running with ruby.

I think this impression comes from the culture of experimentation in Ruby and more widespread willingness to adopt new tools and libs very quickly. Python definitely has a diverse web development community and more options in some areas (like templates), but it's more conservative, not necessarily evolving as rapidly and, like Python overall, resists influence from other languages. For instance, Haml and Saas are pre…

FWIW, there are lots of Python folks moving to git and hg as well. But I don't understand what VCS choice has to do with language culture. What's next, a critique of editor choice? :)

Python is such a large tent that it's quite inaccurate to say that "the Python culture" lacks a sense of experimentation and adoption of new tools. What you might be getting at is the fact that there are already so many existing libraries in Python for doing most things that there's not a lot of public reinvention of wheels going on.

Re: Ask HN: Why Python over Ruby?

#166
post #137

I think it's mostly about maturity, of the runtime, of the language, and of the community. For example, Ruby has backward incompatibility issues in minor releases that would never be permitted in Python. They had to jump to Python 3 for even fairly small things that wouldn't be accepted in the 2.x line. Even subtle incompatibilities between Python versions are taken seriously, and there's a documented process for dep…

Ian B., aren't you occasionally one of those crochety naysayers? :)

Re: Ask HN: Why Python over Ruby?

#167
post #50

Earlier quoted context omitted.

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 encour…

In Perl you have "wizards" and in Ruby you have "rockstar ninjas"... No other language communities do this.

Re: Ask HN: Why Python over Ruby?

#168
post #76

1. Get latest OpenSolaris. 2. Install latest SunStudio 3. download latest source of Python (3.1) and Ruby (1.9.1). 4. Try to build them with CC=/opt/SUNWspro/bin/cc" CFLAGS="-m64" 5. See the results. Run make test for ruby.

Our company provides and supports commercial builds of Python along with 40+ other packages (including scipy, numpy, PIL, wxPython, etc.) on Solaris. The Sun compiler is not great, but that has very little to do with Python.

Re: Ask HN: Why Python over Ruby?

#169
post #165

Earlier quoted context omitted.

I think this impression comes from the culture of experimentation in Ruby and more widespread willingness to adopt new tools and libs very quickly. Python definitely has a diverse web development community and more options in some areas (like templates), but it's more conservative, not necessarily evolving as rapidly and, like Python overall, resists influence from other languages. For instance, Haml and Saas are pre…

FWIW, there are lots of Python folks moving to git and hg as well. But I don't understand what VCS choice has to do with language culture. What's next, a critique of editor choice? :) Python is such a large tent that it's quite inaccurate to say that "the Python culture" lacks a sense of experimentation and adoption of new tools. What you might be getting at is the fact that there are already so many existing librari…

"FWIW, there are lots of Python folks moving to git and hg as well"

It's not remotely as universal as it was for Ruby developers. When working with Python you still can't go a day without hitting an svn repo, but with Ruby you'd easily not touch one for months.

"But I don't understand what VCS choice has to do with language culture."

A lot, and I already described it. Ruby developers and the Ruby language overall are less conservative and more open to dramatic change than Python developers or the language. Each model has its benefits.

"'Python is such a large tent that it's quite inaccurate to say that "the Python culture'"

It's a large tent, but the common thread is Python and Python's principles, and they define the culture.

"there are already so many existing libraries in Python for doing most things"

But individual developers don't do most things, each works on certain things. Python has lots of libraries, but that doesn't mean it's the best choice for any specific job. As a web developer, there are a huge number of Python packages that don't matter at all in that domain. If sheer number of libraries mattered, we'd all be using perl.

Re: Ask HN: Why Python over Ruby?

#170
post #167

Earlier quoted context omitted.

"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 encour…

In Perl you have "wizards" and in Ruby you have "rockstar ninjas"... No other language communities do this.

Except for python, of course:

http://www.google.com/search?q=python+ninja

http://www.google.com/search?q=python+rockstar

Post reply on HN