7 ms·
That's a fair point, what's magic and what's a good abstraction is highly subjective. I guess I'm a fan of the principle of least surprise. I'd far rather exp
by EdwardDiego 3y ago
That's a fair point, what's magic and what's a good abstraction is highly subjective.
I guess I'm a fan of the principle of least surprise.
I'd far rather explicitly define a configuration property in some file than "if you create an environment variable called FOO_CONFIG_X=5, the Foo framework will populate your settings for you!"
Because when the Foo framework doesn't respond to your incantations the way the docs say it should, then you're going to spend the rest of the day reading code to figure out why.
Shit, the Spring annotation magic made me miss XML context files for that reason, the XML made wiring explicit, as opposed to auto wiring annotations that failed deep in the bowels of the beast.
It's a continual problem across languages and frameworks, the (admittedly very) convenient magic is great until it isn't.
I've lost enough time on it in my career that these days the only dependency injection libraries I'll consider for a new project have to be compile time.
Still as much magic, possibly even more (trying to understand Quarkus' compile time DI library ArC is... something), but at least it breaks before you can deploy it.