fxn / zeitwerk

Efficient and thread-safe code loader for Ruby
MIT License
1.99k stars 118 forks source link

Use require instead of require_relative #297

Closed JuanVqz closed 4 months ago

JuanVqz commented 4 months ago

I wonder if it's "better" or more recommended using require over require_relative, I think it is, so, suggesting the change, happy to hear what is best.

fxn commented 4 months ago

require means "look this relative path up in $LOAD_PATH and load it`. It is a file lookup in a system-wide collection of directories.

require_relative means "load this file right here". It is more concise and intentional (and marginally more performant, though this is not the point for me).