Hacker News new | past | comments | ask | show | jobs | submit login

Yes, Ruby is my favorite language but they really messed up the module system. Ruby basically has no module system at all and everything is in the global namespace.

I mean, that's not technically true, there's definitely a module system. In fact, in some ways Ruby's module system is more powerful than Python's since it's completely divorced from the concept of the file. You can split a single module across multiple files or create multiple modules in a single file. You can nest modules as well of course.

The problem is with the module import system, which as you alluded, imports the module structure in a given file into the global namespace. And it imports everything! There's simply no way to say which bits you want and where they should go.

I actually don't really see a reason why the import system could not be changed while keeping the module system in general as is. I wonder if anyone has ever tried something like that...

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact