Live data from Hacker News

Ask HN: Why Python over Ruby?

news.ycombinator.com

111–120 of 198 posts

Re: Ask HN: Why Python over Ruby?

#111

Earlier quoted context omitted.

Very flexible. Once you learn what the sytnax means the implementation of blocks and iterators is one of the best parts of the language. 3.upto(6){ |x| puts x } I don't think the uniqueness of a language is any reason not to learn it. To be honest that sounds lazy. PS I'm not a Ruby zealot, and Python is a great language

So I just saw 3 ways to print from 3 to 6... are those all used in the wild? Zen of Python: "There should be one-- and preferably only one --obvious way to do it." Sure, there are other ways to do it in Python, but it'd be frowned upon to use something like 3.upto(6) rather than a standard range() that everyone is used to. Readability matters.

While I agree that readability matters _a lot_, the "Zen of Python" honestly bugs me. But maybe it's just the counter-culture ethos that dwells inside me. +)

Note: I used Python daily at work and for open source projects. I also use Ruby for open source projects. I like them both.

Re: Ask HN: Why Python over Ruby?

#112
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.

See http://rubyonrails.com and convince yourself :)

Ruby On Rails is a framework not a collection of third party libraries (like pypi), that said if you really want to compare RoR to something then that's http://www.djangoproject.com/

Re: Ask HN: Why Python over Ruby?

#113
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."

How can you say that a language with active development and an active community has "died"? Seems like an odd conclusion to make, IMHO.

And it is really easy to enjoy Ruby without Rails. A friend and I have been doing it for a couple years now.

Re: Ask HN: Why Python over Ruby?

#114

From the Python website: "Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we're looking for more people with skills in this language." When I first saw this, I went "Google? Whoa. I gotta check this out" :)

It is impressive, but beware of cargo culting.

http://en.wikipedia.org/wiki/Cargo_cult_programming http://weblog.jamisbuck.org/2008/1/7/never-ever-cargo-cult

Re: Ask HN: Why Python over Ruby?

#115
I've worked with a lot of languages. Python, C++, Scheme (and CLISP), Java, C#, Perl, Ruby, etc. Every language I've used besides Ruby, I feel that I have to fight the language to actually implement my idea. The fact that programmers want flexibility should be obvious by the contortions present in C++ with boost, particularly the lambda libraries. People are so desperate for flexibility that they use template metaprogramming. This general impulse points to programmers wanting better abstraction capabilities. C# and Python have higher order functions and many other virtues, too. Ultimately, for me I could do anything I wanted to in Ruby without fighting the language. I'm sure there are people that have the same personal connection with Python. When I want the very flexible abstraction--I use Ruby. There are things that out of practicality I use Python and other languages for. Awhile ago I was experimenting with fractal terrain generation. The implementation is procedural, and all using Ruby does is greatly limit the performance of the program--so I implemented it in C++. I use Python for Bioinformatics research because of the excellence of Numpy.

Re: Ask HN: Why Python over Ruby?

#116
post #13

Earlier quoted context omitted.

Though it must be said, rubygems is miles ahead of anything available for python.

I'm not convinced that's true, as the depth and quality of rubygems are inferior to the depth and quality of eggs available in python. Find me e.g. a "gem install scipy" equivalent for Ruby. However - "easy_ un install scipy" REALLY needs to work!

My point precisely. I was referring to the package management system being better, not necessarily the packages available.

Re: Ask HN: Why Python over Ruby?

#117
post #34

Earlier quoted context omitted.

...strange ad-hoc combination of other languages. I call bullshit, sir. Ruby is objectively less strange and more consistent than Python. Some has to do with the fact that Python is older - hence has more baggage to carry. A lot of it, though, just has to do with poor/missing design choices. Specifics? - ruby 'block' passing convention is much cleaner and more powerful than python's 'for'/iterators. - python's global…

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…

Ruby 1.9 has real iterators now.

Re: Ask HN: Why Python over Ruby?

#118

Earlier quoted context omitted.

Very flexible. Once you learn what the sytnax means the implementation of blocks and iterators is one of the best parts of the language. 3.upto(6){ |x| puts x } I don't think the uniqueness of a language is any reason not to learn it. To be honest that sounds lazy. PS I'm not a Ruby zealot, and Python is a great language

So I just saw 3 ways to print from 3 to 6... are those all used in the wild? Zen of Python: "There should be one-- and preferably only one --obvious way to do it." Sure, there are other ways to do it in Python, but it'd be frowned upon to use something like 3.upto(6) rather than a standard range() that everyone is used to. Readability matters.

I like the Zen of Python myself, but the first thought that crossed my mind was that the Python example could use xrange and save the generation of a temporary list. So there are at least two ways of doing it in Python, both of which look very similar and differ only in the underlying implementation.

This makes me curious how much more frequently range is used than xrange and in what situations it's preferable.

Re: Ask HN: Why Python over Ruby?

#119
post #13

Earlier quoted context omitted.

Though it must be said, rubygems is miles ahead of anything available for python.

I'm not convinced that's true, as the depth and quality of rubygems are inferior to the depth and quality of eggs available in python. Find me e.g. a "gem install scipy" equivalent for Ruby. However - "easy_ un install scipy" REALLY needs to work!

I believe the parent was referring to the rubygems system, not the quality of the gems themselves.

Re: Ask HN: Why Python over Ruby?

#120

In Python you dont' have to type 'end', just kidding although for some reason it reminds me of VB for this reason. I wish it didn't but it does. Why have an end be anymore than 1 character on a serious note, that is lots of keystrokes extra not needed. But more seriously Python is a growth like Javascript. It has grown and adapted to every change it has been required because it has a very rapid iteration time and is…

Not having some way to explicitly note the end of a function was actually something that initially bugged me about Python. I think I'm over it now...

end

Post reply on HN