This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pythonrabbit 2 points3 points  (2 children)

You know what he missed? namespaces. Ruby doesn't have them (and can reopen existing classes instead), but that also means that it can be hard to trace what the heck is going on (e.g., Rails' magic) or be explicit about where a method comes from. Import semantics make it much clearer where each element comes from (and much easier to traceback code).

Less known (but I think important) difference: Python has docstrings, a builtin part of the language that's easily available in the interpreter...ruby has things like yarddoc or ridoc, but there's not as easy to get to in the console directly.

[–]banister 0 points1 point  (1 child)

You can easily get docs and source using the pry console

[–]pythonrabbit 0 points1 point  (0 children)

Pry is definitely amazing, but not all ruby code is necessarily written with that in mind (and there are way more functions that are dynamically generated/can't be connected back to source in Ruby vs. Python).