Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I actually prefer auto-loading, which lets you iterate through a package manager much easier/faster - PHP iterated through PSR-0[0] before landing on PSR-4[1], and you can always build your own (which is what most frameworks pre-composer were doing).

With Rails 7 and Zeitwerk, the Ruby community has landed on a very similar auto-loading system as PHP now[2] with constants translating to paths by convention.

[0]: https://github.com/php-fig/fig-standards/blob/master/accepte...

[1]: https://www.php-fig.org/psr/psr-4/

[2]: https://github.com/fxn/zeitwerk#the-idea-file-paths-match-co...




Yeah, I prefer an actual module system over PHP namespaces plus autoloader. It feels like a hacked on module system tbf. BUT I do get lots of real work done using namespaces and a PSR autoloader so it works.

I do wish they would extend auto loading for standalone functions and constants though.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: