Live data from Hacker News

PHP in 2021

stitcher.io

51–60 of 309 posts

Re: PHP in 2021

#51
Daily reminder that by Lindy effects, for each additional year of php still alive the probability of staying alive increase. We will probably die before PHP

Re: PHP in 2021

#52
post #8

My beef with PHP is not so much the language itself, but the weird community that surrounds it. The FIG standard that forbids TAB for indentation (which is perfectly legal in PHP), the notion that classes should be either abstract or final, the micro-optimizations (thou must use single quotes, things like that). I don't think anyone can tell anyone how to write PHP, because nobody knows how to get it right (myself in…

FIG stands for Framework Interop Group. At its peak, it was a place for representatives of the major PHP frameworks and libraries to hash out ways for their projects to cooperate more effectively, and some of the standards - such as PSRs 3, 4, and 7, have been extremely useful.

If you're not writing a framework or library for others to use, nothing the FIG says is necessarily relevant to you.

And in fact, even if you are, Doctrine, Guzzle, Laravel, and Symfony have all left the FIG, so it has even less relevance now.

So...it's a group that used to make standards for a very specific audience, and now mostly doesn't, in part because all of the most important members of that audience got fed up and left.

That's your biggest beef with PHP? Just adopt whatever standards you like.

Re: PHP in 2021

#54
post #50
post #5

In a post called "PHP in 2021" we really can't omit https://bref.sh/ -- it allows running PHP apps on AWS Lambda effortlessly. With all the serverless craze, it's a very important piece of the ecosystem. After writing PHP apps for two decades, I am absolutely stunned how easy it is. Amazon blogged about it at https://aws.amazon.com/blogs/compute/the-serverless-lamp-sta...

I don't get it - the cheapest webhosts ($3/month) all let you run PHP - why would I need a cloud function when I have an always-on machine? And if it's for something with high traffic, why would you want a cloud function anyway? I thought they are meant for "runs sporadically, so why have a machine that's always on?" setup.

When load varies you'll only pay while it's in use. Web-hosts without VMs or containers often promise a lot until you find their shadows limits. And those with VMs and containers can come out more expensive for some workloads.

The landscape is changing too. So if your work is stateless or relatively low bandwidth, and has variable load then it's probably worth trying FAAS.

Re: PHP in 2021

#55

PHP has been in a pretty good place since 7, IMO. These are some great developments. I would say that Laravel is an extremely high quality framework (on par with and even in some ways better than Rails) that nobody should be ashamed to use. It's unfortunate that the stink of old PHP is so powerful and that salaries are still lagging so far behind.

> I would say that Laravel is an extremely high quality framework (on par with and even in some ways better than Rails) that nobody should be ashamed to use. Never heard of Laravel. Decided to take a look. First thing the intro documentation says to do is install something called 'Docker Desktop'. I'm good, thanks. Why do I need Docker to play around with a web framework?

“ Never heard of Laravel. Decided to take a look. First thing the intro documentation says to do is install something called 'Docker Desktop'. I'm good, thanks. Why do I need Docker to play around with a web framework?”

Because modern web development is complex, and Docker helps make that burden less so.

You make it sound like you took one look at the docs, and that was just too much for you to go any further.

Don’t get into front end development, because you’ll lose your mind.

Re: PHP in 2021

#56
post #29
post #5

In a post called "PHP in 2021" we really can't omit https://bref.sh/ -- it allows running PHP apps on AWS Lambda effortlessly. With all the serverless craze, it's a very important piece of the ecosystem. After writing PHP apps for two decades, I am absolutely stunned how easy it is. Amazon blogged about it at https://aws.amazon.com/blogs/compute/the-serverless-lamp-sta...

For what it's worth, PHP has always been kinda "serverless". You just point the PHP interpreter at a file, and it runs the script contained in the file!

+1. PHP can easily host 1000 applications on a single node, while java people would struggle hosting 1000 docker contained spring boot monsters

Re: PHP in 2021

#57
post #50
post #5

In a post called "PHP in 2021" we really can't omit https://bref.sh/ -- it allows running PHP apps on AWS Lambda effortlessly. With all the serverless craze, it's a very important piece of the ecosystem. After writing PHP apps for two decades, I am absolutely stunned how easy it is. Amazon blogged about it at https://aws.amazon.com/blogs/compute/the-serverless-lamp-sta...

I don't get it - the cheapest webhosts ($3/month) all let you run PHP - why would I need a cloud function when I have an always-on machine? And if it's for something with high traffic, why would you want a cloud function anyway? I thought they are meant for "runs sporadically, so why have a machine that's always on?" setup.

I am using a lambda to answer a webhook. The lambda function writes into SQS and in turns, SQS calls a queue worker automatically.

Is this possible without AWS? Certainly. I was one of the two people who wrote the queue subsystem for Drupal more than a decade ago. And yet, AWS here does away with all the scalability concerns both up and down.

Re: PHP in 2021

#58

I know PHP is really great (and always has been). But sh*t, there is soooo much bad, no, really really bad PHP code that lives out there. Isn't it?

Yeah in my whole career, the worst codebases I’ve worked on are far and away PHP

Re: PHP in 2021

#59
post #11

It's nice to see PHP adding useful things like enums and async (green threads). My foray into Web development started with Perl, but quickly segued into PHP with how much simpler it felt. The ability to hop into vim on your server (or use CPanel back in the day) and edit your site live was exciting back then – but now that very thought makes me shudder with what could go wrong, haha. While I've moved onto JVM languag…

> FYI: Not sure if the author will see this but some spelling mistakes in the article. [0] E.g. s/reslease/release/

Thanks, I saw it :)

Re: PHP in 2021

#60

Earlier quoted context omitted.

Unfortunately the documentation does make it look like you need docker to get started. You don’t though. A litter further down in the docs there is a section for using just Composer, if you’re still interested in checking it out: https://laravel.com/docs/8.x#installation-via-composer

What happened to Homestead? That seemed to be the recommended way of starting last I touched PHP professionally (4-5 years ago)

Alive and well. And if you haven’t seen the surrounding laravel ecosystem in 4-5 years I think you will be quite impressed. The amount of 1st party integrations and side projects is amazing.

https://laravel.com/docs/8.x/homestead

Post reply on HN