Live data from Hacker News

PHP in 2021

stitcher.io

171–180 of 309 posts

Re: PHP in 2021

#171

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…

You can ask the same for any language, not only PHP: - Why would anyone want to start something new with Ruby? - Why would anyone want to start something new with Elixir? You can choose any reason to pick a language, do you want a language with a lot of demand in the job market, learn Javascript, you will see a lot of frontend open positions, even more React open positions if you want to specialize in something. Do y…

> Ruby

It has a very mature web dev ecosystem around Rails. It: is quick-to-learn, is OO to the bone, is FP where is fits with the OO, is easy to read, has little quirks.

Personally I'd go with something with stronger types, no "null" and proper sum types. But if you are cool with dynamic typing: Ruby is a great choice.

> Elixir

Ruby-like syntax (some advantages just mentioned) and BEAM runtime. Yields very scalable apps.

I do thing GP raises a valid concern. PHP is not for new apps, or even better put: for new teams. It's just too quirky and does not have the native browser support the other super popular + super quirky language JavaScript has.

As as a comparison: who'd start an app in Perl these days? Or COBOL?

At some point a language may be considered "legacy".

Re: PHP in 2021

#172
post #141

Earlier quoted context omitted.

> 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? Well, on Twitter the other day, I asked, only partly tongue-in-cheek: > Even in 2021, any new server-side web app with even a vain hope of being installed by people who are tech savvy but not modern web nerds should probably still be written in PHP. True or false? T…

> I appreciate Laravel and Symfony, but PHP in 2021 has traded the feeling of being a cargo cult version of Perl for the feeling of being a cargo cult version of Java. As a Symfony dev I agree. And the process to convert PHP into a Java-esqe Kotlin-esque language is continuing. Why not use a different language if you like it rather than change PHP? > If I do write a new project in PHP, it's probably not going to be w…

"the process to convert PHP into a Java-esqe Kotlin-esque language is continuing"

My observation is also that PHP is growing too much in language size. Depending on one's viewpoint, this can be seen as either matching the feature and syntax bloat of other languages, or taming the language to make it "saner".

Re: PHP in 2021

#173

Earlier quoted context omitted.

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.

Developers underestimate how difficult it can be to deploy server-side code for web apps or dynamic websites, particularly for less-technically minded users. As other posters have mentioned, PHP code can be as simple as uploading files to a folder on a server using a GUI FTP app. (And for some non-technical users, even that might be too complicated). By the way, Jeff Attwood (co-founder of Stack Overflow and one of t…

But almost no one writes php alone. Maybe hobbyists or Wordpress users. When we talk about actual applications that talk to a db - people use frameworks. Is deploying a Laravel app so much cheaper or different than a Rails app? Yes if all you need a wordpress website PHP is obviously the way to go. If you're an app developer PHP loses this edge quite quickly. Also I'm not sure an ftp setup is easier than Heroku.

Re: PHP in 2021

#174

Earlier quoted context omitted.

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…

What's harder about deploying a Rails app? Generally interested. How does it go in Laravel land then? Rails have quite a few dependencis (Node, webpack), how is Laravel handling front end?

Re: PHP in 2021

#175

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 have experience with JS (node) and PHP, and between the two I would choose PHP for any real website. I appreciate a lot of things JS gets right (including PNPM vs Composer), but Node is far less reliable and IMO PHP is the better language.

My Rails friends all recommend against using Rails for any new projects. I never bothered to get the laundry list, as that is enough to convince me not to learn a new language.

I wouldn't use Go or any language that requires compilation.

I don't know anyone who uses Elixir, which is enough to keep me away. I worked with Cold Fusion and with Erlang in the past. When I got stuck, finding someone to help me was not fun (with CF I even paid for consulting) and existing libraries were few and incomplete. (Although I enjoyed Erlang as a language).

For me, PHP is a go-to language for new projects, and it has become quick enough, stable enough, and complete enough to hit the check boxes I need.

Re: PHP in 2021

#176
post #127
post #68

Earlier quoted context omitted.

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.

1. WordPress was released in 2003, Netscape Navigator was basically dead by then.

2. It’s fair to judge a language by its dominant platform / use case. Rails (2004) and Django (2005) are barely younger than WordPress. Is it fair to judge Ruby and (one facet of) Python by examining Rails and Django respectively? Yes.

Re: PHP in 2021

#177

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.

Laravel docs are virtually non existent. The code comments are meh.

Their upgrades are frequent but are not backwards compatible. Many times after an upgrade we spent hours finding something that broke and was not documented in the upgrade guide.

Their code quality leaves much to be desired, and it very significantly will slow down every part of the site.

It is hard to call this a "extremely high quality framework" or even a "acceptable low quality framework". It may be possible to say this is unfortunately the best we've got in PHP.

Re: PHP in 2021

#178
post #156

Earlier quoted context omitted.

> You can do this with one PHP file , one a super cheap hosting , with code that is simple and clear. This. PHP is basically Functions-as-a-Service over commoditized virtual hosting. Maybe we need a toolchain that can transpile down to PHP, starting from more common languages with better development workflow.

You can also do it in one golang file. Or one python file. Or one nodejs file. With PHP you have more moving parts, Apache/Nginx with their configuration and then the PHP script. With golang/rust/python/nodejs you have direct access to the webserver and more control, but the same simplicity.

For someone who's not developer, PHP is way more simple to deal with. Upload to your FTP, follow some script or edit config file, get it up and running.

That's much more complicated with virtually every other language.

I mean, this has been going for decades, I didn't think it was up for debate. There's close to zero sysadmin skills required for dealing with PHP hostings, most of them have CPanel or something similar, most of them are very cheap, and there are plenty.

There's nothing similar for Python or any other language.

Re: PHP in 2021

#179

Earlier quoted context omitted.

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…

> 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

Two thoughts and personal observations on that:

1. Nobody was ever fired for buying IBM. In my impression it's usually deployed as default for and esp. by very tech affine communities. It was the new, hot - and is now save - thing in town.

2. You see postings boasting how the Discourse forum is now powered by a new six core 8 GB RAM server improving performance ... for 200 concurrent active users and 80k posts. Yes, Discourse offers a lot of flashy features, but that's just borderline disgusting.

Re: PHP in 2021

#180

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…

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…

Non technical people won't use Docker, it's too complicated. Unless you make some environment as easy and widespread as your typical CPANEL shared hosting, you won't compete with PHP for that kind of end-user.
Post reply on HN