Live data from Hacker News

PHP in 2021

stitcher.io

151–160 of 309 posts

Re: PHP in 2021

#151

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…

There are many reasons to use PHP: - you have already a dev team that are good PHP developers, it is stupid to switch to Python or Ruby , you lose their experience and any chance of reusing existing PHp code you have. The dev team probably knows JS so node might be an option. - maybe you want to build something super simple, like some third party needs to send you a notification event and you want to record that even…

> 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.

Re: PHP in 2021

#152

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…

> They care nothing about elegance and have but a dim conception of larger CS/SE principles.

Elegance and CS/SE principles don't usually have a business case.

Given a choice between PHP and Python for a web-service, there's no practical real-world difference between the two, except that it's slightly cheaper and faster to get your PHP service up.

Re: PHP in 2021

#153
post #149

PHP has astounding longevity. In maintaining my personal websites (static pages, web toys, projects with my writing groups), I always ask myself: how will I keep this running in 20 years? It's unrealistic to think that languages will stay static over 20 years -- servers get rebuilt, old versions languages get deprecated, frameworks disappear. So the question becomes - will I know how to fix or rebuild this, even if I…

> It's unrealistic to think that languages will stay static over 20 years

Depends on the language really. JavaScript? Yeah, good luck even spinning up a year old project on NodeJS without any breakages. Slightly better situation in the browser but most likely you'll need to change something if you're using NPM.

On the other hand, Clojure hasn't had a breaking change in their core API in almost 14 years now, since you can change the language yourself without affecting the core API for others, so new features are usually launched as libraries instead of changing the core API.

Coming from the JS world, being able to spin up old Clojure projects without having to do any changes is really a undervalued feature of the stability of Clojure.

Re: PHP in 2021

#154
post #79

Earlier quoted context omitted.

What stack do you recommend? Node/JS or GoLang or React, Java?

I am a fan of ASP.NET MVC. But honestly if you've used one MVC framework you've kind of used them all.

> if you've used one MVC framework you've kind of used them all

Same goes for C-like languages like PHP or C#. Most of the features and syntax are the same across all in the family, so who really cares if it's Ruby, PHP or C#, they are more alike than they are different.

Re: PHP in 2021

#155

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…

Please do not. I wouldn't like the next version of php to become hip and force me to learn kubernetes and a myriad more technologies just to run my app from 12 years ago. Keep php unsexy.

Re: PHP in 2021

#156

Earlier quoted context omitted.

There are many reasons to use PHP: - you have already a dev team that are good PHP developers, it is stupid to switch to Python or Ruby , you lose their experience and any chance of reusing existing PHp code you have. The dev team probably knows JS so node might be an option. - maybe you want to build something super simple, like some third party needs to send you a notification event and you want to record that even…

> 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.

Re: PHP in 2021

#157

Earlier quoted context omitted.

There are many reasons to use PHP: - you have already a dev team that are good PHP developers, it is stupid to switch to Python or Ruby , you lose their experience and any chance of reusing existing PHp code you have. The dev team probably knows JS so node might be an option. - maybe you want to build something super simple, like some third party needs to send you a notification event and you want to record that even…

> 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.

> with better development workflow

What languages have better development workflow? I'm myself biased towards repl-driven development with Clojure, but for example Rust's or Go's development workflow is a lot worse than PHP.

PHP: write file to disk, reload webpage/run curl

Rust/Go: write file to disk, compile file, run binary, reload webpage/run curl

The popularity of PHP is not hard to understand when it comes to ease of development.

Re: PHP in 2021

#158

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, same experience for me. Lots of fragile and bloated code bases. And I don't tell you about maintainability nightmare. Javascript in the server is another example.

So this is not the fact that PHP people can write useful things with it or that PHP can help them to put food on the table, etc.

Here some questions not only for PHP enthusiasts: Are you using the right tool for the job? If so, Are you do it well? Are those programs that you write easy to maintain over the time? Is the language providing you the necessary mechanisms to help you to do so?

Re: PHP in 2021

#159
I’m primarily a javascript dev who had to dive into php and wordpress this past year for a client.[0] The php docs often drive me nuts with their range of what info and examples are available per feature, and the language’s naming can be funny at times with a lack of consistency...

But I really like it. Php writes and reads like javascript. And working with dates has actually been pretty fun - I like the natural language manipulation layer it provides, ie: `last Sunday`, etc. And the built in url parsing.

I’m happy to have added it to my tool belt!

[0] https://www.zionbaltimore.org

Re: PHP in 2021

#160
post #149

PHP has astounding longevity. In maintaining my personal websites (static pages, web toys, projects with my writing groups), I always ask myself: how will I keep this running in 20 years? It's unrealistic to think that languages will stay static over 20 years -- servers get rebuilt, old versions languages get deprecated, frameworks disappear. So the question becomes - will I know how to fix or rebuild this, even if I…

> PHP has astounding longevity. In maintaining my personal websites (static pages, web toys, projects with my writing groups), I always ask myself: how will I keep this running in 20 years? PHP originally stands for Person Home Page. really!
Post reply on HN