3 ms·
having used both ruby and python extensively, my guess is that what gave python an edge is better support for namespacing and stricter adherence to local scopin
by zem 3y ago
having used both ruby and python extensively, my guess is that what gave python an edge is better support for namespacing and stricter adherence to local scoping. it is far easier to read a largish python project and easily see where every symbol the code uses is defined; ruby makes it a lot harder because by default everything is tossed into one big top-level namespace and imported implicitly.
concrete example:
python:
foo.py:
def f():
...
bar.py:
import foo
x = foo.f() # very clear where f comes from, just look up foo.py
ruby:
foo.rb
def f
...
bar.rb
require 'foo'
x = f # grep through the code if you want to know what f is