3 ms·
I think the difference is in the community. I've used both Python (extensively) and Ruby (a little bit). While the capacities of the languages are relatively si
by jaimebuelta 5y ago
I think the difference is in the community. I've used both Python (extensively) and Ruby (a little bit). While the capacities of the languages are relatively similar, the people around the languages, at least the ones creating packages and driving the discussion in conferences are actually quite different, for some reason.
People attracted to Ruby are mostly of an "artistic mindset", they want to be expressive, write code that doesn't look like programming code and using "magic" like dynamically created methods, monkey-patching, etc is accepted or even encouraged.
On the other hand, Python attracts more people with "engineering mindset", they like straight forward code that's readable, clear and understandable, even if it's not as expressive. "Magic" elements are frowned upon: for example, imports are explicit and always included in each file.
Obviously, I'm exaggerating it, but I think is a clear differentiation between the communities.
My guess is that the "Python mindset" got into creating better integrations for "engineering applications", like NumPy or SciPy, and that created some positive feedback in certain environments. The main strength of Python is its rich ecosystem of third party packages. There's a compounding effect, making it grow faster and faster.
- kstrauser 5y agoI think that’s exactly it, and that there’s much less understanding required to start reading and writing Python code. Ruby has some beautiful features, but they make it much less clear to newbies who are trying to figure out what on earth’s going on.
- hnfong 5y agoYou're definitely not exaggerating. Ruby makes it easy to do "magic". Which is fun to write, but painful to read for others. I've encountered real cases of ruby code where a simple code snippet behaves differently with and without a `require` (IIRC, some utility function added to a class with monkey patching). In another case I've also had to modify (and to some extent maintain) a codebase that relied on overriding `method_missing` in the happy case / normal flow. I was trying to find out where some method was being defined by grepping the whole codebase. It probably cost me half a day of unabridged profanity. In theory you can do the same thing with python -- thing is it usually doesn't happen for some reason (likely the ones you mentioned). Something about the language features and the culture in the community lead to devs doing different things with the different languages. But the effect is real, and I know which language to avoid if I had the choice.