Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning Ruby from Python; Differences and Similarities

Tags:

python

ruby

Inspired by Learning Python from Ruby; Differences and Similarities.

I'm in the exact opposite boat - I'm pretty well-versed in Python, but I need to start learning Ruby soon (and Rails later, but that's another topic). The question I'm linking to addresses this a bit, but are there any other resources out there that teach Ruby for someone who already has Python experience? (In other words, someone with a background in programming, but who doesn't yet know the difference between code that IRB will execute properly and proper Ruby code.)

EDIT: I'm not just looking for a list of the differences between the two languages - I'm wondering if there are any guides/walkthroughs that are directed towards teaching Python programmers to write idiomatic Ruby. I know similar guides exist for migrating to Python from other languages, but I don't know about Ruby.

like image 754
chimeracoder Avatar asked Jan 22 '11 17:01

chimeracoder


People also ask

How different is Ruby from Python?

Python is generally better for educational use or for people who want to build quick programs rather than work as developers, while Ruby is better for commercial web applications. There are more specific differences when comparing Ruby versus Python, and they have in common that there are many ways to learn both.

Which is easier to learn Ruby or Python?

Learning Curve Without a doubt, Python is much easier to learn because of how the language is structured - and how explicit it is. One can literally become proficient in two to three months. Ruby takes much longer to learn due to its flexibility.

Why is Ruby so similar to Python?

They have similar performance because both Ruby and Python are scripting languages. Each framework provides you all the concepts from traditional MVC frameworks like models, views, controllers, and database migrations.

Should I learn Ruby if I know Python?

Whether you should learn Ruby or Python depends on the applications you want to use programming languages for. Ruby is more difficult to learn than Python and is best for web development and design. Python is ideal for data science use cases, and it's best for tech newbies.


2 Answers

While not targeted at Python programmers, you might find this idomatic Ruby talk useful.

(Related, but for Python: Code Like a Pythonista: Idiomatic Python)

like image 160
moinudin Avatar answered Sep 20 '22 11:09

moinudin


The Ruby website has a page exactly on this topic. It's a summary list, so other answers with more best-practice style comments are surely a good idea.

like image 44
Phrogz Avatar answered Sep 20 '22 11:09

Phrogz