4 ms·
The problem is it's teaching you Python's module system, which is very different from Ruby's require system. Ex. 12 introduces `require` with example code that
by extension 15y ago
The problem is it's teaching you Python's module system, which is very different from Ruby's require system.
Ex. 12 introduces `require` with example code that is way over the reader's head at this point in the book, and unrelated to anything they have seen or will see until ex. 25. It also says that features are called "modules" but that's completely wrong -- Ruby modules are something else entirely. And the term "module" is used in the Python sense all over the book. All those need to be changed.
Ex. 25 asks the reader to require their own file but never explains how to get the file in the load path, so I don't think the reader has much chance of completing this exercise.
My point is that I don't think a direct per-exercise translation is going to work. Requires in Ruby are more complicated and used less often than modules in Python, and the book is very linear, so I think require will have to be introduced in a completely different way if it's going to make any sense.
There are other topics that have this problem, like heredocs. In Python they are pretty so it's ok to throw them at the reader early on. But Ruby heredocs will melt their eyeballs out of their sockets, and they are rarely used in practice, so they probably shouldn't be in the book at all.
I am working on these sorts of changes with the intention of sharing them with you to see what you think, but it's starting to snowball so I don't want to promise anything. I'll do my best.