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

Sure, I can try! One part of the Rails "magic" that the framework tries to abstract away from an app developer is code loading. So, instead of each file in your app needing to explicitly specify using "require" statements which other files it needs to run, Rails uses Ruby to automatically "require" files for you. This system is dependent on constant names and namespaces matching file names and directory structures. So, a constant (Rails model) like "Sports::Player" used in a controller might be found via lookup automatically in "app/models/sports/player.rb".

A system which does this has been a part of Rails for a _very_ long time, and Zietwerk is an upgrade to it by a longtime Rails contributor that fixes some of the previous downsides and gotchas.




Oh, so it's similar to PHP's autoloading based on psr4.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: