News for hackers. Stuff that matters.
Re:PHP in 2022 by fart32 on Tuesday January 11, 2022 @09:40AM (#29891908)
> The PHP community also prefers medium sized packages, so you don't get a thousand dependencies accidentally.

I think it was Laravel or Lumen? I tried that one once and was kinda amazed it pulled like 100 packages. In PHP ecosystem, I think that's considered a lot (to be fair, this is few years back). I've worked on fairly large projects (mostly Symfony + Doctrine and PHPUnit) and don't recall seeing so many dependencies.

Now compare this to initialization of any common JS framework starter.

Re:PHP in 2022 by captn3m0 on Tuesday January 11, 2022 @10:41AM (#29892786)
checked for a fresh laravel install: 110 packages, 40 of those are development dependencies. Of the 70, only 38 are non (symfony/laravel) dependencies.

The PHP ecosystem tends to use packages-for-interfaces, so that ups the count somewhat.

Re:PHP in 2022 by fart32 on Tuesday January 11, 2022 @12:12PM (#29894289)
Yes, I saw similar numbers (just not in empty projects, but I'm not familiar with Laravel/Lumen - there might have been a good reason for it).

The point is that Composer packages are far from being that granular, we have less dependencies by literally order of magnitude.

Re:PHP in 2022 by captn3m0 on Tuesday January 11, 2022 @12:41PM (#29894758)
I think a better measure really is lines of code. A comparison with react is _very unfair to laravel/rails_, with laravel being a full-featured framework, and yet react is still much worse:

laravel/framework:

  no-dev-deps: 307,405 lines of PHP (36MB)

  all-deps: 535,383 lines of PHP (58MB)
react (stock create-react-app)[1]

  all-deps: 1,570,720 lines of Javascript + 96417 lines of typescript (348MB)
rails (rails new app):

  (no-dev-deps): 264123 lines of Ruby + 23614 lines of C + 17009 lines of JS (55MB)

  (all-deps): 332083 lines of Ruby + 23614 lines of C + 18055 lines of JS (54MB)
Here's the raw results: https://www.toptal.com/developers/hastebin/osujizeraw.txt

[1]: create-react-app doesn't split out dev/prod dependencies https://stackoverflow.com/a/44872787/368328