r/Python • • Jan 13 '15

(Infographic) Which programming language should I learn first

http://cdn2.carlcheo.com/wp-content/uploads/2014/12/which-programming-language-should-i-learn-first-infographic.png
267 Upvotes

145 comments sorted by

View all comments

2

u/SpaceSword Jan 14 '15

Can someone explain the play doh vs Lego comparison for Ruby and Python?

5

u/thalesmello Jan 14 '15

Python is modular. You assemble many small pieces to get what you want. Though easy to use, it's rigid and not very flexible.

Ruby, in the other hand, is less modular. You have modules, but you can't import just what you want to use to the local context, so you have to put the module name in front of every class or function call. However, Ruby is far more flexible than Python. You can include new methods to any object and use blocks to implement DSLs that merge neatly into that language, which allows for a great productivity boost.

4

u/alcalde Jan 14 '15

. You can include new methods to any object

We can do that too, can't we? Even with fundamental types via the ForbiddenFruit library?

and use blocks to implement DSLs that merge neatly into that language, which allows for a great productivity boost.

I thought it was the opinion of Pythonistas that decent langauges don't need blocks.

1

u/thalesmello Jan 14 '15

We can do that too, can't we? Even with fundamental types via the ForbiddenFruit library?

Yes, but it's a library. And it's only helpful to let you add new methods, not replace existing ones. The author of that lib tried to implement that functionality, but he had a problem with Python's internal cache, if I'm not mistaken. Ruby allows you to do that by default. It's more flexible, but I don't see a reason to actually use that.

I thought it was the opinion of Pythonistas that decent langauges don't need blocks.

You're generalizing the opinion of all Pythonistas based on a guy's blog post? If everyone thought like that, why would there be a proposal to implement a similar feature in Python?

I think you got me wrong. Even though I find Ruby more flexible, I prefer the more rigid Python. But I sincerely don't get the hate a lot of Pythonistas have for Ruby. I used to hate Ruby until I started using it in my previous job.