Hacker News new | ask | show | jobs
by LyndsySimon 3385 days ago
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.

3 comments

I think you mixed things a little bit. Where does ruby (the language) uses "convention over configuration"? I see frameworks using this but not the language itself. If you dont like ruby on rails, thats fine, I dont like either. But that has nothing to do with the language itself.

When you talk about "functions are not first class objects", do you mean you cannot assign it to a var? Well thats because they are not functions, they are methods. I think thats great. A method belongs to a class. Thats how Smalltalk also implemented it, as far as I know. In fact Ruby and smalltalk (the mother of all OO languages) shares a lot in common.

If you like functional programming style, thats fine, but yeah then maybe you should use haskell, erlang, elixir, ...

When you mention grokking Active Record and Ruby's "convention over configuration", it gives the impression that you are conflating Rails with Ruby. It's similar to if someone in the Ruby camp were to conflate Django or Flask with Python. Also, functions very much are first-class citizens in Ruby, otherwise blocks, procs, and lambdas wouldn't work!
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.
It's a dynamic languages... what would you expect?

For most boring everyday cases Python's "type system" (it's too much to call it so, but anyway) is quite ok, catches lots of bugs that would seep through in Javascript or PHP, plus functions as first class objects to match everyone intuition and it's quite a pleasant experience.