Live data from Hacker News

Has Python killed Ruby?

news.ycombinator.com

21–30 of 64 posts

Re: Has Python killed Ruby?

#21

Ruby is a much simpler and more aesthetically pleasant language. Python has all sorts of sharp corners. You really should learn both but I think Ruby is a much easier starting point. Also, a lot of research on dynamic languages is being done with Ruby, e.g. TruffleRuby, JRuby, RubyOMR, and probably a few more I'm forgetting. Each of those projects is an impressive body of work in and of itself that points to Ruby bei…

> Ruby is a much simpler and more aesthetically pleasant language

That is open to disagreement. I will say the same, but of python.

HOWEVER, among the languages that put "aesthetically pleasant" as part of the charm, I think is safe to say that python/ruby are from the top 5.

Any of both will be a good choice using that criteria (and even considering the troubles with BOTH), so in my mind is hard to go "wrong" with any of them. Both have other features that could weight in the choice, but at level of language are more brothers in spirit than enemies.

---

I don't see ruby "killing" python, (I'm more a fan of python, ok?); just for the look of it the niches of both are more defined now.

SADLY, js is what is killing all the other languages in the web space. I wish a better language was the cause, but not, must be the far worse, more terrible, but the NON-choice.

Re: Has Python killed Ruby?

#22
I've used Python for about about eight years, and Ruby for right at six months. It took me about a week to feel competent in Ruby, and about a month before I was really comfortable with all of the metaprogramming functionality. Add another month to that before I really grokked ActiveRecord.

I much prefer Python. I thought for a long time that this was because I learned most of the fundamentals of computer science and professional development in the language, but I'm at the point now where I'm sure that's not the case. The Zen of Python really shows the differences between the two of them - "explicit is better than implicit", versus Ruby's "convention over configuration". I don't mind writing some boilerplate in Python, because the boilerplate is itself fairly terse and fully informs you of your system's architecture in the process.

I hate that functions aren't first-class objects in Ruby. Hate it. The subtle distinctions and behavioral differences between blocks, Procs, and lambdas are infuriating.

There are many things I would change about Ruby, but there's nothing wrong with it. It's just not a good fit for my way of thinking.

All that said, the question was "Has Python killed Ruby?" No, it hasn't. Ruby is still popular, and I think it very much fits the manner of thinking of many developers. For them, thinking in Ruby is natural and wrangling Python into submission would feel like writing Ruby does to me.

Re: Has Python killed Ruby?

#23
As a fan of python -and think python is overall better-, but also as someone that have learned (and used professionally) many languages, learn both. Even take a look at erlang/elixir or any other you think is interesting.

Ruby on Rails was a eye openner (my exposure to web was ASP classic (auch!!!) and ASP.NET (auch!!)) and the tutorial of

http://poignant.guide/

Was something good. I choose later python just because I think is a better overall language, but I have always read what the other side have to say. I will not hate to work on ruby, in contrast to, let say, js or java.

Not hate a language is probably a more nice thing that just like it ;)

----

You must balance much more that just the superficial aspect of the syntax, despite that I agree syntax MATTER A LOT. With time the superficial syntax will become a more deeper aspect of the experience (when you truly understand the language and see the semantic behind the words), but the ecosystem, the thing you plan to build, how well you absorb the knowledge, etc are also important.

Even when 2 languages look "nice" is possible that down the road one be "better" in your mind and other "harder" or the opposite. For example I get lost reading C-like languages and get easy Pascal-like language for the same thing and the same level of difficult.

For example, I read

http://learnyouahaskell.com/

And I loved it, but I can't make haskell work for real (to me). The language look nice at first, but it not "connect" to me. Instead I get F#.

Re: Has Python killed Ruby?

#24
post #20

Earlier quoted context omitted.

I agree Ruby is visually nicer and more aesthetic (though that will always be subjective), but I'd say it's probably harder for a beginner due to all of the metaprogramming constructs. Python is also very much not stagnant. Look at all of the major changes and feature additions in Python 3.3, 3.4, 3.5, and now 3.6.

Not just visually. It is also conceptually much more aesthetically pleasant. I still don't know how metaclasses, descriptors, __magic__ methods, multiple inheritance, all the different string formatting schemes, generators/co-routines, etc. work in Python. The amount of stuff you have to learn in Python is a lot more than in Ruby.

> The amount of stuff you have to learn in Python is a lot more than in Ruby.

I couldn't disagree more with this.

Python is pretty thin when you get down to it. Magic methods alone are 80% of the way to knowing how everything in Python works.

Multiple inheritance in Python is way simpler than the two-pronged inheritance scheme of Ruby, where you have both a parent class and modules (which can be loaded either before or after the parent class) to deal with. Want to see what order ancestor classes are applied? `object.__class__.__mro__`. Done.

Meawhile, in Ruby, you can call a function like this - `my_function(a, foo: 1, bar:2)` - and it feels like you're passing keyword parameters... but Ruby doesn't support keyword parameters. Instead, it's implicitly creating a Hash that's getting passed as the second parameter. Even more confusing, every function has an implicit "block" parameter that can be passed to it, and is silently ignored by default.

Re: Has Python killed Ruby?

#25
No.

I wrote a small Rails project a while back and along with it small non-Rails utility that made used a couple of generic modules (mail, config). Both the Rails project and the utility bit-rotted faster than anything anything that I ever written. Ruby, the language, is pleasant, and you can write beautiful, terse, expressive code. Functional constructs are nice, etc. Soured me on Ruby, I am afraid. I liked Perl too, and Ruby is not that different.

Python... I don't care for the significant whites space. lambda is crippled because it has to fit into a single line, tertiary operator is weird, and compressions reads backwards to me. Haskell has the same problem. It is nice how you can start with a class, then wrap attribute access later. Writing a simple new style class is verbose. The version 2 to 3 was rough, not sure if it's done by now. There is a lot of libraries, some parts of the standard library are nice.

JavaScript to me is mess with classes being bolted on, different ways to build an object, different ways to handle errors, different ways to handle callbacks. The write it once and run it either in browser and server ignores that version differences (i.e. what is the crappiest browser you have to support), and in general that environment is different. node.js with the async is an interesting experiment. To me it becomes difficult to read and reason about. To me, it was surprisingly difficult, to write a small sync util in node.js. There is a metric ton of libraries. I quite like JavaScript, but to me its becoming complex (as in C++) instead of burning off the bad parts (as in C). The language will be around "forever" due to the web, so that is what I use if possible.

Re: Has Python killed Ruby?

#26
post #20

Earlier quoted context omitted.

Not just visually. It is also conceptually much more aesthetically pleasant. I still don't know how metaclasses, descriptors, __magic__ methods, multiple inheritance, all the different string formatting schemes, generators/co-routines, etc. work in Python. The amount of stuff you have to learn in Python is a lot more than in Ruby.

> The amount of stuff you have to learn in Python is a lot more than in Ruby. I couldn't disagree more with this. Python is pretty thin when you get down to it. Magic methods alone are 80% of the way to knowing how everything in Python works. Multiple inheritance in Python is way simpler than the two-pronged inheritance scheme of Ruby, where you have both a parent class and modules (which can be loaded either before…

Ruby has had keyword arguments for a while now: https://robots.thoughtbot.com/ruby-2-keyword-arguments

Re: Has Python killed Ruby?

#27
Its like Rock, Paper, Scissors. One beats the other all the time. Its like a loop of Programming languages.

A programmer chooses a languages which is convenient for the task at hand. Ruby/Rails are amazing to lift off projects in hours.

Re: Has Python killed Ruby?

#28
I've never had a language click with me the way ruby has, I use it for basically any task that isn't low level. I have never liked python at all despite them being quite similar. Do whatever makes you happiest and most productive.

Re: Has Python killed Ruby?

#29

Earlier quoted context omitted.

> The amount of stuff you have to learn in Python is a lot more than in Ruby. I couldn't disagree more with this. Python is pretty thin when you get down to it. Magic methods alone are 80% of the way to knowing how everything in Python works. Multiple inheritance in Python is way simpler than the two-pronged inheritance scheme of Ruby, where you have both a parent class and modules (which can be loaded either before…

Ruby has had keyword arguments for a while now: https://robots.thoughtbot.com/ruby-2-keyword-arguments

Interesting - I remember reading a proposal for this, but I've never seen them in production code.

Re: Has Python killed Ruby?

#30

I've used Python for about about eight years, and Ruby for right at six months. It took me about a week to feel competent in Ruby, and about a month before I was really comfortable with all of the metaprogramming functionality. Add another month to that before I really grokked ActiveRecord. I much prefer Python. I thought for a long time that this was because I learned most of the fundamentals of computer science and…

Python's philosophy of "explicit is better than implicit" kind of dies when you get to types. Even the docs are quite vague on this too.
Post reply on HN