3 ms·
I think PHP suffers from the java migration, we now write code like this https://github.com/aran112000/Advent-of-Code-2019-PHP/blob/master/Day01/Day01.php https
by slifin 7y ago
I think PHP suffers from the java migration, we now write code like this https://github.com/aran112000/Advent-of-Code-2019-PHP/blob/master/Day01/Day01.php https://github.com/aran112000/Advent-of-Code-2019-PHP/blob/m... when functions in a namespace would have sufficed
It seems like collectively developers are patting themselves on the back for putting the same old crap code in classes, as if putting data into a change by reference data structure is a good idea
Personally I'm trying to migrate out to Clojure where mutation is hard and controlled by default & we don't pretend modelling reality with a tree of nouns is a good idea
- pas 7y agoClasses are/were thought as awesome because you can do dependency injection via providing an object, but you can't easily do that with just providing a different implementation namespace. That said, maybe PHP is not the language where you need to do DI. Just have a few different config files around, do the includes and wiring there and that's it. And hope for the best. (After all there's no compile, no checking of interface correctness with any kind of DI either.)