> Nothing forces you to use Composer
And yet nearly everybody does. Is there a compelling upside to justify that tradeoff? I can't think of a worse fate for a language than trying to mimic Java circa 1998, but that's exactly what's happening.
Re:Build command line apps using PHP 7
by SwellJoe on Sunday September 03, 2017 @05:20PM
(#15163992)
Sure, I think they're good things. But, some other languages manage to do the same without so many letters and without so much boilerplate.
Re:Build command line apps using PHP 7
by NightlyDev on Sunday September 03, 2017 @05:37PM
(#15164066)
Just curious - what languages do you have in mind?
Re:Build command line apps using PHP 7
by SwellJoe on Sunday September 03, 2017 @05:57PM
(#15164160)
JavaScript has gotten extremely concise in recent years, even with type annotations (with TypeScript or Flow). Perl with Moose/Moo is very concise. I dunno about Ruby or Python in terms of type annotations, but both have more concise class definition syntax. So, kinda all of the direct competitors to PHP have a more concise syntax for the same features.
But, maybe more importantly, this seems to be using classes where it makes little sense to use classes, but I see it a lot in PHP code. An idiomatic implementation of the same kinds of tools in JS/Perl/Python/Ruby might be shorter simply by virtue of not wrapping everything in a class. It's sort of an anti-pattern to OOP-all-the-things in those languages, while in PHP there seems to be a religious zeal for classes.
It's all opt-in. Nothing forces you to use Composer, classes or even type hinting in PHP if you do not depend on third party libraries backed by composer. Most of C extensions from 10 years ago are still here and procedural code from that era would probably still work today on PHP 7.