|
|
|
|
|
by khaledh
1441 days ago
|
|
> You should then be able to call “Baz::Bar::foo()” from any other file in your project structure without a “require” at all. IMO, this is a downside rather than an upside. It's optimizing for writing rather than reading. This hurts understandability for someone who is not familiar with the code base. |
|
The difference is convention over configuration. In Ruby, if you know the convention, then you know exactly where everything is defined without needing to read it. In Python, you must read all those import statements to know where something is coming from, not to mention write them in the first place.
And if you really need to know where something is defined, you simply ask it.
So IMO, Ruby optimizes for both reading and writing.