I understand the subtle differences between require
, load
and autoload
in Ruby, but my question is, how do you know which one to use?
Other than being able to "wrap" a load
in an anonymous module, require
seems to be preferred.
But then autoload
allows you to lazy load files -- which sounds fantastic but I'm not sure practically what you gain over require
Is one method preferred over the other? Is there a situation where one method stands out?