Live data from Hacker News

PHP in 2021

stitcher.io

111–120 of 309 posts

Re: PHP in 2021

#111
post #91
post #3

As someone who works with Rails and Laravel, one of the huge benefits I find working with PHP/Laravel are the speed and consistency of releases. PHP seems to release versions more frequently, and Laravel tags every week. It means there's much less lead time to work with new features/functionality as it becomes available (when it's stable, rather than running on edge).

I once came back to a Laravel project after just one year of working on other projects and had to go through several upgrade guides just to stay up to date. Most changes were quite trivial (yet annoying to make), like namespace changes and other things that should probably have been weeded out before ever making it into a release... It’s why I prefer Symfony if I absolutely had to work with PHP nowadays.

Laravel did release major versions every 6 months in the past. The changes have not been much and https://laravelshift.com is able to it automatically. They‘ve now changed to yearly major releases because not everyone is able to upgrade every 6 months.

Re: PHP in 2021

#112

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 you want a lively developer community, choose any language, I learned Java, PHP, Javascript and Ruby and all of them always had helpful people and a lot of courses to help me learn and try to code with good practices.

Answering the question seriously (assuming this is not trolling) here are some reasons to start something new with PHP in 2021:

1. Learning PHP 8 and a popular framework like Laravel will make easier to get a job on some small and medium companies. In the last job I had in a consulting firm, customers were asking for more Laravel developers to the point they accepted outsourcing because there was not enough talented Laravel developers in the US to cover the demand. There are thousands of bad PHP and Laravel developers, but there is not enough supply of good ones, so if you are talented and follow best practices, choosing PHP will make you shine between all those average developers.

2. I probably won't develop anything new with PHP 8 this year, but there are a lot of existing libraries and frameworks (Laravel and Symfony for example) that will benefit from implementing the new features of the language (reducing mess or making code more concise and readable). For the end user of those libraries and frameworks, very little will change since the interfaces don't change too much in order to allow backwards compatibility, so the existing ecosystem is a great reason to use PHP.

Re: PHP in 2021

#113
post #17

So basically PHP is still catching up to Hack and but not quite there yet?

Hacks language is better, nobody will deny it. But outside of facebook there is barely no community, not many big open source projects. And as the language is now incompatible you even may not be able to use php libraries.

Re: PHP in 2021

#114
post #46
post #42

Earlier quoted context omitted.

With Hack's extensive static type checking and even contexts / coeffects, it's much more than just performance. The bigger your system grows, the more pain it removes. You still can mix it with plain PHP, much like you can mix TypeScript with plain JavaScript. I wish high-profile PHP projects, like Nextcloud, migrated to Hack eventually; it can be done piecemeal.

> With Hack's extensive static type checking and even contexts / coeffects Have you used contexts/coeffects? My understanding is that it's still yet to be fully rolled out to WWW, and nobody outside FB has yet played around with it. IMO it still has some DX issues ( https://github.com/facebook/hhvm/issues/8828 ) and the examples given in documentation don't actually work in real life ( https://github.com/hhvm/user-do…

Not extensively; rather, I had to pay attention to the limitations that a particular context enforces.

It's definitely a fresh feature, iirc rolled out last winter.

Re: PHP in 2021

#115

Earlier quoted context omitted.

- shared nothing architecture - single threaded code execution context - copy files deploy I was a PHP developer for over 15 years and those three concepts do more to lower the barrier to entry than any other language I’ve come across, and are constantly underestimated in their power to enable developers to concentrate on the business logic of their program.

Indeed, there's nothing like just logging in to a linux box you got access at school or pay $1/mo for and typing 'nano public_html/index.php' - stuff Just Works. Trying to get a python/ruby framework working in the same env, without root access? Whoooo boy. 20 years in the business and I still refuse to do that crap. FastCGI and the like just never work properly the first time in shared hosting. You need virtual envi…

idk if we're talking about ease of getting started Heroku kinda made it as easy as it can get (started with Ruby but now supports all languages).

Re: PHP in 2021

#116

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.

As a front-end developer I can agree with that.

Many times when I've wanted to install something for my needs, like forum engine or something similar, I was looking only for an PHP option.

Why?

Because it really is a copy-paste process with typing credentials to your database into dedicated file. No need to know any language/framework-specific commands, and no need to be overwhelmed by missing dependencies.

And in huge addition to that, simple PHP hosting is extremely cheap - for years I've been paying for my personal server ~$20 PER YEAR, where servers that enables you to use Node/Ruby etc. costs around at least $10 per month. This is a huge game changer for me.

Re: PHP in 2021

#117
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…

I never heard of the abstract/final thing, except maybe from one or two coworkers that don't produce much but talk about the language all day and will berate you about protected/private or ordering your "use" alphabetically.

It's true that the PHP community has a bit of an inferiority complex which result sometimes in abuse of patterns, like suddenly someday everyone wanted to do refactor everything with DDD/CQRS/etc for no good reason.

Re: PHP in 2021

#118

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 is just very simple and powerful. Check out levels making 100k per month with a single php file: https://twitter.com/levelsio/status/1381709793769979906?s=21

Re: PHP in 2021

#119

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'd love to debate the use of PHP vs. Ruby and Elixir, but your arguments basically are:

- The community is full of people who just care about hacking something together.

- Ruby/Elixir are fantastic, developer friendly, and have solid foundations.

The first happens with every popular scripting platform. Is JS community full of PhDs?

The second is highly subjective. Ruby is problematic, because it's supported by one framework which is showing its age, and the language itself has lagged behind in performance, which matters increasingly for web workloads. Elixir is a niche dialect of a niche language (Erlang). Don't get me wrong, Erlang is amazing. But you don't need Erlang to set-up a blog.

It seems the major reason going against PHP are:

- WordPress and the entire ecosystem around it sucks. Well, sure, but PHP has more frameworks with big mindshare like Symfony. It's not a "Ruby on Rails" situation.

- The meme about hating PHP is big. Everyone loves to hate PHP and Basic. Even when Visual Basic .NET evolved to be basically no different than C#, the meme of hating it lived on. Same with PHP.

The thing with memes is they're not rational. So fighting them with rational arguments is pointless. If peer approval matters to you, then code PHP in secret or don't code in it. If shipping projects matters more, PHP is a pretty good option for most websites.

Re: PHP in 2021

#120

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…

> the Elixir/Phoenix stack, really developer friendly

I do PHP/Symfony and Elixir/Phoenix and really it's more nuanced than that.

Really if I don't need things that are suited for the BEAM/Elixir/Phoenix I'll probably be more productive with PHP/Symfony, especially for CRUD: the strict type system is better, the templating is better, the framework includes way more functionalities, the static analysis is better, PhpStorm with the Symfony plugin is amazing, even the docs are better.

But yeah, the app will probably be slower (but probably less than you think nowadays) and coding will be less fun ;)

Post reply on HN