Live data from Hacker News

PHP in 2022

stitcher.io

41–50 of 318 posts

Re: PHP in 2022

#41
post #32
post #26

Earlier quoted context omitted.

Why shouldn't PHP be able to compete here? I personally prefer Python over PHP for stylistic reasons but I have no doubt that PHP is capable of doing the same things as Python, even if the syntax looks a bit more outdated.

Because it wasn't designed for long-running processes or data processing at first. It evolved a lot, but I don't see it outside of simple backends for websites.

That applies to Ruby and Python as well.

Re: PHP in 2022

#42
>>Packagist, now with over 3 million registered versions and more than 300.000 packages

I see PHP continues to import all of the problem of npm into the PHP community, I moved away from php about the time packagist started to gain ground.

Re: PHP in 2022

#43
post #38

I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…

There are definitely parts of PHP and its ecosystem that have been trying to copy Java. On the flip side, PHP is quite similar to Java when it comes to its value proposition, so I can appreciate why the devs have chosen that path. Like Java, PHP is stable and slow-moving. It takes backward compatibility seriously, and it has a huge community. PHP is to small-time "webmasters" and lifestyle businesses what Java is to…

Why would one pick PHP over Java except because "you already know PHP"?

> If you're a fast-moving startup who will replace your entire codebase every six months, you might be better served by JS.

Noooooo... :)

Re: PHP in 2022

#44

I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…

> Why would I choose PHP when starting a greenfield project?

For me, the answer is Laravel.

Re: PHP in 2022

#45

I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…

> I'm curious what is the value proposition of the latest PHP version(s).

I think more and more people have started to realise that typed languages make better, more reliable software. The incremental additions to PHP's type system are just a move towards this, I think and can be seen in other languages such as Typescript.

I'm just not a fan of dynamically typed languages anymore, even for small scripts.

> Why would I choose PHP when starting a greenfield project?

I think it depends on your greenfield project, but there are many domains where problems are just solved related to e-commerce or shuffling around content online.

To this point, PHP benefits just from the fact that it has been around for so long, and will continue to be supported far into the future.

Many PHP frameworks like Symfony have LTS releases that will ensure software is supported years into the future, with strong support from agencies.

Re: PHP in 2022

#46
post #32
post #26

Earlier quoted context omitted.

Why shouldn't PHP be able to compete here? I personally prefer Python over PHP for stylistic reasons but I have no doubt that PHP is capable of doing the same things as Python, even if the syntax looks a bit more outdated.

Because it wasn't designed for long-running processes or data processing at first. It evolved a lot, but I don't see it outside of simple backends for websites.

> It evolved a lot, but I don't see it outside of simple backends for websites.

I'd say that something like MediaWiki, Wordpress or Drupal exceeds the definition of "simple backend".

Personally, I even tend to write shell scripts in PHP simply because the language is far more sane than Bash (and god forbid naked old sh) and I don't have to fight whitespace with Python.

Re: PHP in 2022

#47

Javascript is what PHP should be since day 1.

> Javascript is what PHP should be since day 1.

ReasonML or ReScript is what JS should have been since day 1.

Re: PHP in 2022

#48
post #32

Earlier quoted context omitted.

Because it wasn't designed for long-running processes or data processing at first. It evolved a lot, but I don't see it outside of simple backends for websites.

That applies to Ruby and Python as well.

Not sure about Ruby, but Python is a pretty popular choice. There are tons of open source projects that are used by big players for data processing and complex backends.

Re: PHP in 2022

#49
post #40

I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…

> Why would I choose PHP when starting a greenfield project? Because you don't know better. If all you have is a hammer, everything looks like a nail. Ruby + Rails is miles ahead of PHP + Laravel. If you want more static typing (which I currently believe is a good thing) I really like Kotlin (+ KTor or + Javalin). If you are okay without OO and like static typing Haskell + IHP is pretty complete. If you are okay with…

You can write JavaScript via Typescript, and you now have one of the best and most popular languages there is (including sum types). There are still a lot of warts, but it’s actually a really nice language IMO.

Re: PHP in 2022

#50

enums in PHP! I've been waiting a long time for this

And now you can wait for them to be used by (std) libs. This kind of features are hard to bolt on later on.
Post reply on HN