Autoloading is fine as long as you don't go nuts with gems or write classes that will stomp on other implementations of a namespace if autoloaded. The UX as the article concedes is great most of the time. The problem usually arises when someone pulls in a gem that does a ton of class opening and can poison the rest of the application with unexpected behavior. Yes, making you vulnerable to this is a downside of autoloading, but its within your control when adding new code.
Knowing where things are defined is table stakes. A language that supports making it nearly impossible to find a function definition is objectively bad.
My point is that itβs only hard to know that if you create that problem yourself in rails, with some exceptions in ActiveSupport. The system just allows you to make that mistake, but experienced practitioners generally will not do that.
Re:I'm Switching from Laravel to Rails
by seattle_spring on Sunday June 23, 2024 @10:56PM
(#40772363)
It's impossible to stop all 100+ engineers on a large team from using footguns like that. It's why I find Rails to be an awful solution for large or mature companies: sure if everyone is a "Rails ninja" who perfectly knows the consequences of every bit of code they write, a Rails app can be beautiful and perfect. That's simply not realistic as an org grows beyond a certain size.
https://bower.sh/on-autoloading