Ah, that's new! had no idea PHP copied this concept from java. Rails completely avoids dependency injection.
You know what, if the php community starts to heavily type annotate and use a framework like Symfony, I start to fail to see the point of using that and not java.
Indeed. PHP has been trying so hard for so long to be a dynamically-typed Java I don't know why they don't just rebrand as DJava or something like that. I've never known any commonly-used language relinquish its own identity the way PHP has.
>I've never known any commonly-used language relinquish its own identity the way PHP has.
What do you mean by this? I can take a guess, and it seems like you're upset PHP has progressed beyond its humble beginnings as a templating language into a fully fledged OOP language with frameworks rivaling Spring, such as Symfony and Laravel. Sure, PHP has its issues, but so does Java if you want to go that route. I still can't find an answer that doesn't point to poor design as to why in Java a Stack is a class but Queue is an interface. Java also didn't get generics until v5, which is now probably one of the most definitive features of the language. Java has changed a lot since its inception. If it weren't for modules and (especially jlink) being introduced in java 9 we'd still be dealing with massive production jars. Java has changed a ton and so has PHP, both for the better.
I disagree. PHP was always supposed to be beginner friendly, fast to prototype, dynamic etc. Java was never any of these things. Having it's major frameworks become so heavily inspired by Spring isn't what PHP used to be.
And again, if I have a type annotated codebase which is more and more a Spring clone, why wouldn't I just use Spring? What's the upshot to go with PHP + Symfony then?
>I disagree. PHP was always supposed to be beginner friendly, fast to prototype, dynamic etc.
>having it's major frameworks become so heavily inspired by Spring isn't what PHP used to be.
Inspired by doesn't mean the same as. It's no different than any other non-DI frameworks unless you want to write framework-specific packages. Laravel has DI under the hood but you don't have to write annotations nor structure your code in a certain way to be able to use it. It does all of that for you.
>And again, if I have a type annotated codebase which is more and more a Spring clone, why wouldn't I just use Spring? What's the upshot to go with PHP + Symfony then?
They're far easier to use with less overhead. You don't need to know tons of annotations and configurations to get requests to behave a certain way. You've already admitted earlier that you've never used Laravel nor Symfony, so I'm not sure why you're arguing about their ease of use when you don't have experience with either. They're significantly easier to use than Spring.
I'm referring mainly to the idiomatic fanfold PSR doc comments which litter PHP codebases along with the head-scratching practice of inserting a blank line between each line of code, the upshot of which is that you're lucky to be able to read 10 lines of code on a screen without scrolling.
Those "complaints" aren't even focused on the language but instead the developer. I still don't know what your original comment was about other than seemingly being irritated PHP isn't still in the same state it was 15 years ago.