I wonder if there is any way to achieve that sort of thing with C/C++ and other languages.
I wonder if there is any way to achieve that sort of thing with C/C++ and other languages.
Ruby though... I really hate it. Overloading on numbers for example. Which module lets you do 5.some_verb? Where did you import it?
In python and C you have imports local to the file or included headers. In ruby it doesn't matter as long as it's been imported somewhere in the same runtime??
Absolutely bonkers.
PS: I am quite new to ruby so please enlighten me if I have it all wrong :)
It's been a while since I really used Ruby in anger but to discover where these things came from you need to just look up the documentation of your dependencies and their dependencies, and see where something got added to. For me most of it came from ActiveSupport, and I ended up using that library by itself in other projects than just Rails.
Exactly, which seems directly opposed to the Ruby ethos of happy developers.
I do appreciate the magic of having stuff like 5.bytes or 8.days, but I don't see the reason for having runtime imports or at least warnings that you're using modules required elsewhere.