Live data from Hacker News

A look at modern PHP

lwn.net

131–140 of 610 posts

Re: A look at modern PHP

#131
post #74
post #51

Depicts language feature, PHP ecosystem is dying. For me, an example is latest MediaWiki syntax highlight extension dropped GeSHi (PHP) which is not updated anymore, to pygments (Python) using a sub process. I realized I have to drop MediaWiki because my host didn't expose PHP proc_open() feature. I don't even know where to start. A natively written syntax highlighter can be considered as an important brick in an eco…

This is a side effect of open source. GeSHi, and many others, suddenly stop getting maintained, and more often than not, project ownership doesn't get passed down. This problem isn't unique to PHP. I have seen this is many projects across all kinds of different languages and tooling. Unfortunately, if there's no good alternative written in PHP, MediaWiki could have either reimplement it from scratch. In my opinion, G…

That's not a side effect of open source: it's a side effect of any dependency. If you were using foxpro, any google service, apis from companies bought by Apple, etc then the dependencies stop being maintained or vanish altogether.

Re: A look at modern PHP

#132

Earlier quoted context omitted.

They had to write an installer ecosystem around installing docker images, whereas with PHP and most stock server configs you can SSH a file into a server and you're pretty much done. Still if I want to write a simple web app in < 1 day, I would definitely use PHP.

In such a manual workflow ( "you can SSH a file into a server" ), you still have to setup at least URL rewriting in nginx for any PHP app using routing (which is basically everything using any PHP framework or micro-framework). Plus if the deployed app has its own domain/subdomain, you need to set that up, set up TLS certs etc., so it is really no different in the end. You either configure nginx to proxy all requests…

URL rewriting in nginx for PHP is about copying 5 lines from a google search.

If using a popular framework the documentation usually provide these lines.

And surely you must be joking when comparing Kubernetes' complex configuration to anything else.

Re: A look at modern PHP

#133
post #14

Even with PHP7, PHP still feels like it is playing catch up. There is nothing new or revolutionary in PHP7, just adopting features present in other major languages. Adopting as other newer languages like Go and Rust seems to be moving beyond those features. A catch up into a world that's on its way out, if one will feel so blunt. PHP's raison d'être remains its ease of getting an instance running on a webserver. But…

> only stick around

Greenfield projects are much less important than brownfield projects. After all, a project is new only for the first few months of its existence. After that, it all becomes legacy code :-)

And techs with mainstream adoption in the post DotCom bust era, especially if they're free and Open Source, will be around for decades. A newbie PHP programmer in 2020 will most likely be able to retire in 2065 as a veteran PHP programmer, if he/she so wishes.

Re: A look at modern PHP

#134
post #17

I've been using PHP for over 15 years and always liked it. There is no other webserver language that's so easy to use and so deployable while still being fast. But for larger projects the available frameworks are just okayish. I think Symfony is closest to what a good framework should be. But every time I use it I wish it would be like .NET Today .NET core is also available on Linux and very easy to deploy so I don't…

What if you’re looking for a great way into .net web dev on Linux? I’ve been struggling to find a good guide that combines dev env, deployment and a good web framework. Any advice? I have quite a bit of xp with Python (Django/flask) and less with php.

Aren't there guide for ASP.NET Core? https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcor...

I think you need VS Code with some extensions, .NET Core installed and you should be off to the races in half an hour.

Re: A look at modern PHP

#135
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

I can't really understand the hate towards php in general, never was able to understand it. I started programming in PHP and then moved to c# and now mostly JS, but never really understood the motivations behind people bashing on PHP. Like, some of my friends that today mostly program in React/Nextjs praise the framework as something amazing and the SSR as something really innovative, and - honestly - it resembles PHP more than ever, but if you ask them about PHP they will immediately say it is a "bad language" and "a joke". Laravel, as you stated, is a really amazing framework, but some people are carrying baggage from the time of PHP4 or something even older and never really tried to see current/modern PHP and some other people just built their idea of the language around it because it was the cool thing to do.

Re: A look at modern PHP

#136
post #31

Earlier quoted context omitted.

Think of a simple landing page with a form to save data from a form and send out an email with confirmation. In PHP you just need to add to your HTML page a few lines of PHP code and copy it using scp to any share server hosting that costs 4 dollars a year. No "automation", no "cloud", no REST APIs, no WSGI/Gunicorn, etc. just plain Apache with mod_php enabled, which is available everywhere. I don't think anything ca…

Aren't there a zillion online services that provides that product out of the box, most likely for free, only requiring a browser and some monkey clicks around? -> No PHP, HTML or web server.

By that logic, nobody needs to write any thing because there's always some "online service" to "do stuff".

Re: A look at modern PHP

#138
post #61
post #14

Even with PHP7, PHP still feels like it is playing catch up. There is nothing new or revolutionary in PHP7, just adopting features present in other major languages. Adopting as other newer languages like Go and Rust seems to be moving beyond those features. A catch up into a world that's on its way out, if one will feel so blunt. PHP's raison d'être remains its ease of getting an instance running on a webserver. But…

> But with fewer people self-hosting these days, that has become less an advantage. I don't think fewer people self-host. There are some going to big clouds, there are some using integrated offerings like squarespace, but there are still many hosting their website with a regular hoster. And probably in total many more than in the past. > And even for those who do self-host, the advantage is becoming narrower as other…

> With PHP, all the users has to do is to fetch the project files and upload them with FTP to the directory the hoster told them to

Let's not idealize things. For moderately complex apps, even back in the days, this falls pretty fast: missing PHP modules in default distro installation, PECL/Pear extensions, hosters messing with the php.ini in bad ways, etc. And now the dependency management and deployement systems pushing you to access a shell on your server...

Re: A look at modern PHP

#139

so is PHP worth learning right now? and what is the job prospect looking like? if I study the language for the next few months what is the lickely scenario I will find a career in it.. I actually enjoy and like PHP unlike other people idk what it is about the languauge it looks fun and enjoyable to play with . Plus it's simple and easy opens doors to more complex languages later on down the road

There will be work for PHP developers for many years to come. It will not be the sexiest work, but you'll get paid to write code, and any day being paid to write code is better than any day not being paid, or a day being paid to do something you don't enjoy.

I stopped coding it professionally almost 20 years ago (!), but it was a great foundation to a ton of stuff, and going back through the release notes and modern frameworks I'm actually thinking I might use it for a few side projects.

Don't let anybody put you off, I say if it appeals to you that you should go and learn it and get some work with it.

Re: A look at modern PHP

#140
post #83
post #65

Earlier quoted context omitted.

Dropping PHP files to a FTP site is as easy as it gets.

That's an incredibly process-immature way of managing deployment. How do you know what version you have deployed unless you copy everything you deploy to some archive somewhere? How do you roll back? How do you find out if you monkey-patched something? Deploying Docker images or static binaries is vastly superior and no more difficult. It's just a new paradigm.

I don't think I even disagree with you here, but to use arguments for version control as your arguments for docker images and static binaries seems odd.

All three of the issues you raise would be solved by involving a VCS somewhere in your FTP deployment.

Incidentally, claiming that either option is "no more difficult" than FTP upload or even using VCS is either disingenuous or at least a little blinkered. FTP can work as simply as copying files between "folders", I've successfully taught my non-techy parents to use FTP. Setting up docker images or static binaries requires significantly more understanding of what's going on but of course provide speed, consistency and scalability benefits.

Post reply on HN