Live data from Hacker News

PHP in 2021

stitcher.io

121–130 of 309 posts

Re: PHP in 2021

#121

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

I started my career in 2006 with PHP and was using it a few years before in private. I used it until 2012.

After that I switched to JavaScript and never went back. First, I did frontend development, then backend with Node.js, then Mobile with React-Native. In between games and now serverless.

PHP isn't bad, it became quite nice these days. But it simply isn't as flexible as JavaScript.

Everything new technology that comes out has JavaScript support right from the bat.

If I need static typing, I drop in TypeScript.

The performance is also crazy good for a "mere scripting language". If you need more perfomance than JS has to offer, there is only C, C++, and Rust left.

Back in the days I used PHP for those exact reasons. It was simple, fast enough, and supported everywhere. Sadly, that isn't the case anymore.

Re: PHP in 2021

#122

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

It's easy to learn, fast and many people understand the code. And it just work.

Re: PHP in 2021

#123

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

Look at the abject failure of Discourse. If it had been written in PHP then it would have completely replaced all current forum software. But the devs there hate PHP and went for a modern stack which is all but impossible to install except for tech professionals. In other words, they chose a tech stack which suited them as developers, and not which suited the end users of the software. End users love PHP because you…

End users love PHP because you copy the files into a folder.

That's certainly how people deployed web apps built by other people a decade ago, but these days isn't it more common to use something like Docker?

Deploying a containerized app should be pretty much the same no matter what language it's written in. And Discourse does have a Docker container (https://github.com/discourse/discourse_docker), so I'm not sure the underlying language explains why it isn't popular.

Re: PHP in 2021

#124

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

I use php for my startup and all new things are made in php for these reasons.

the ecosystem is very much complete. There is nothing that has not been done and tested in php.

Plenty of developers know php and if you have done C#/Java/C++ etc its super easy to learn.

Its easy to setup and well documented and the LAMP/LEMP stack is battle tested and people know it well.

There is great Editor/IDE support with plenty of options to choose from.

You can run it on any kind of developer-os and do you development there then just deploy it to a linux server. Altho docker solves this now with any lang its still nice if you dont want to use solutions like this. I have devs developing on windows, linux and mac with no issues getting the whole development stack running and then deploy the app on linux with no issue. This has been a challange in ruby on rails last time i tired it (back in 2010).

The laravel framework is great.

Re: PHP in 2021

#125
post #62

I wish there was a nodejs equivalent to Laravel

This is very surprising to me honestly. Yeah, folks have pointed out some of the big players, but none of them have really risen above the competition. You would think NodeJS would have a clear cut dominant, monolithic web framework by now but there isn’t. Everyone seems to be happy to throw together hodge-podge Express apps.

That is because everyone is writing SPAs with node and thus only needs an api like express for the backend stuff.

Re: PHP in 2021

#126

Earlier quoted context omitted.

Look at the abject failure of Discourse. If it had been written in PHP then it would have completely replaced all current forum software. But the devs there hate PHP and went for a modern stack which is all but impossible to install except for tech professionals. In other words, they chose a tech stack which suited them as developers, and not which suited the end users of the software. End users love PHP because you…

You mean simply running Discourse (a Rails app) is so complicated no one wants to do it? And if it was simply PHP boom business would have been booming ? I find that a bit hard to believe.

Have you tried installing Discourse? It's not that straightforward. And then there's also the issue that you need a working e-mail setup, even if you only want to set up a local test environment.

Re: PHP in 2021

#127
post #68

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.

That's because the "stink of old PHP" never really went away. For example, Wordpress install guide [0] still talks about making your code directory writtable by web user -- practically guaranteed that any minute exploit will lead to permanent web shell. So does Nextcloud install guide [1]. I am sure there are nice, modernPHP somewhere, but a lot of time you I see old-style programs with horrible security practices. […

WordPress is about as old as Netscape Navigator. Am I judging JavaScript based on the hot mess it was in these days?

Using WordPress as an example for the state of PHP is disingenuous.

Re: PHP in 2021

#128

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

PHP/Laravel is a higher level of abstraction. With Laravel specifically, it's the closest thing I've seen to writing web-app business logic directly in English. Sure, like any abstraction, it comes at a cost. Your applications would be more performant and CS-theoretically-elegant if written in C++ or Elixir/Phoenix. But you would spend a lot more time digging into segfaults, manipulating databases, and writing CRUD form boilerplate, which is far removed from your business logic.

I chose PHP for my recent startup -- despite being less experienced with PHP. The speed of development in Laravel is insane, because most of the framework is focused on making the common features of web apps more convenient. Coupled with static analysis tools and IDE helpers, all of the Laravel magic is actually understood by your IDE (PHPStorm). I've worked with Python and NodeJS for most of my career, and I've never seen this level of dev tooling. My newest project was in Laravel. I was able to ship the whole thing in half of the time it would've taken me in Django or some NodeJS framework, simply because the Laravel "magic" around databases, forms, CRUD, IDE helpers, ORM and scheduling and task queues is so fantastic.

Re: PHP in 2021

#129

Earlier quoted context omitted.

Look at the abject failure of Discourse. If it had been written in PHP then it would have completely replaced all current forum software. But the devs there hate PHP and went for a modern stack which is all but impossible to install except for tech professionals. In other words, they chose a tech stack which suited them as developers, and not which suited the end users of the software. End users love PHP because you…

You mean simply running Discourse (a Rails app) is so complicated no one wants to do it? And if it was simply PHP boom business would have been booming ? I find that a bit hard to believe.

Deploying a Rails apps is, in general, harder than deploying a PHP app.

I'm not convinced that Discourse is the right example here, though. Arguably the actual steps for installing Discourse aren't significantly more complicated than WordPress's install, because they've gone out of their way to make it as easy as possible. (It does suffer from "you must use Docker for this," which would likely intimidate non-techies who could otherwise suffer through a WP install, though.) Also, I don't think Discourse can remotely be described as an abject failure, given that virtually every forum I've seen go up in the last five or six years runs on it, and I can think of more than a few sites that migrated to it from legacy PHP forums in that time.

Re: PHP in 2021

#130

Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel. My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language/ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff…

I think the points from "Taking PHP Seriously" are still interesting. https://www.infoq.com/presentations/php-history/

The argument is that PHP's strengths are its workflow, its state, and how you work with concurrency. i.e. PHP's execution model (per-request) allows for things like not having to worry about restarting the server when you're developing the files. The complete lack of shared state between requests means you don't get complex footguns.

Post reply on HN