Live data from Hacker News

PHP in 2023

stitcher.io

161–170 of 285 posts

Re: PHP in 2023

#161

I started my career with PHP. Created my own apps, created client websites etc. Full of footguns, but I didn't know any better. Once I learned more languages, I never used PHP again. I actually started to feel like I'd been fooled into using PHP. Now the small PHP community keeps trying to justify their language choice with articles like these and comments like the ones on this submission. They claim it's a no braine…

I don't wish to be the bearer of bad news, but nobody is trying to convince you to use it: nobody cares what you're using for software development... and you're working with out of date information if you think that A Fractal of Bad Design is relevant any more. PHP has evolved a great deal over the last decade, as have the people using it and as has the ecosystem. Personally, as my username might hint, I've been usin…

Quoting myself:

> They claim that the article A Fractal of Bad Design (which was really cathartic to me when it came out) is out of date, but when I look, all the old footguns are still there, all the problems with the standard library are still there and stdout still writes directly to the browser.

Re: PHP in 2023

#162

Earlier quoted context omitted.

It feels large to you because you are in it. Other language communities feel small to you because you are not in them.

PHP is far from my primary language, but in no universe is the language that powers so so much of the internet "small".

Website traffic to servers running the language is not necessarily correlated with the size of the community

Re: PHP in 2023

#163
Started my career as a PHP dev, I dislike it so much I migrated to JavaME and Blackberry development. Then to Android. Best decision ever to ditch PHP.

Re: PHP in 2023

#164

Earlier quoted context omitted.

I don't wish to be the bearer of bad news, but nobody is trying to convince you to use it: nobody cares what you're using for software development... and you're working with out of date information if you think that A Fractal of Bad Design is relevant any more. PHP has evolved a great deal over the last decade, as have the people using it and as has the ecosystem. Personally, as my username might hint, I've been usin…

Quoting myself: > They claim that the article A Fractal of Bad Design (which was really cathartic to me when it came out) is out of date, but when I look, all the old footguns are still there, all the problems with the standard library are still there and stdout still writes directly to the browser.

You can quote yourself ad nauseam but that does not turn your incorrect statement into a correct statement. If you spent any amount of time looking at a modern PHP codebase, you'd discover that the type of code people write today is radically different to the type of code you'd have seen at the time A Fractal of Bad Design was written. There are still aspects of modern PHP that stand to be improved, absolutely, but that's true of all languages.

Re: PHP in 2023

#165

Earlier quoted context omitted.

Small PHP community, now I've heard everything.

It feels large to you because you are in it. Other language communities feel small to you because you are not in them.

PHP is still above Go, Rust, Ruby, and Perl in at least the TIOBE index: https://www.tiobe.com/tiobe-index/

Are those all small communities too?

Re: PHP in 2023

#166

Earlier quoted context omitted.

I'm on PHP 8 and I feel the same as parent. Sure, there's been a lot of progress since the PHP 5 days, but the core of the language has been left mostly untouched by design, and we haven't seen the kind of drastic moves like JS moving to ES6 syntax. It's a matter of taste, so there's no absolutr truth. I hate PHP's function and property access syntax differenciation and wildly prefer ruby's approach or instance. And…

"Can't find it pleasant" is a personal preference and not why no one should use PHP which the GP is suggesting.

GP’s take was way too salty, but to be honest I understand where he comes from.

Yes, it’s a matter of personal preference, but I also never worked with people that thought PHP was beautiful. Not that we look down on it, but it’s probably the same feeling construction people have towards their white vans. We value the good parts, hate the jagged parts, and if tomorrow it made more sense to ride Miata for whatever crazy reason, we wouldn’t look back. But I’m not holding my breath to have any decent reason to get out of PHP at my current job, and I appreciate the reasons why.

Re: PHP in 2023

#167
post #27
post #9

PHP was my first language back when I was a teenager in highschool - it all started because I wanted to get some data from users and store it (I just knew basic HTML and CSS back then), when a friend mentioned he used a PHP snippet to send an email from a website. That sounded like magic to me so I bought a book on PHP and my mind was blown by the possibilities. Several websites and years later I had a pretty good un…

> with no CI/build/deploy issues I miss those days. I think the amount of front end building we do for the web nowadays is absurd. We transpile everything - JS, CSS HTML, and then we bundle them in odd ways to circumvent all kinds of issues. The way we make webpages is so disconnected from the technologies that browsers offer us. Makes you wonder when people are going to realize that we're way past serving static pag…

> The way we make webpages is so disconnected from the technologies that browsers offer us.

Can you say more about this? I don't really see how "actual applications" differ from a React app in a meaningful way; React apps almost always leverage the capabilities of of course HTML/CSS/JS, history, AJAX/HTTP, cookies, and so on. As the JS distributions evolve, the build systems do too in terms of output.

Maybe I misunderstand something, but in general the idea that just writing vanillaJS or some analogue would be sufficient to deliver the quality of apps enabled by frameworks (and talented devs) seems a bit naive to me.

Re: PHP in 2023

#168

If you are thinking about building a web application, take a look at Laravel. I not a huge PHP user, but Laravel is always on the top of my list for building web applications. It's the greatest web framework to ever exists, even better than Rails IMHO. The ecosystem around Laravel is really incredible and unlike any other framework. They have libraries for every stage of a web application from taking payments all the…

Looking at the Laravel site, I’m concerned about Laravel’s reliance on an ORM. Not only because ORMs are widely derided, but because I have a legacy MySQL DB and PHP 5 project I want to resurrect. I’m down to rewrite the server, but how do I restore a database full of user data with Laravel?

I work on a project like this and you'll run into some papercuts, but it's not hard.

You can take a model for anything in your legacy code, and just set properties on the model to teach Laravel how to deal with things that don't follow conventions.

For example, you can override the table name. Suppose you had a legacy table called "postdata". In Laravel, this table would be called posts, and a model would be Post.

So you'd just tell Post to query postdata rather than posts.

Likewise, you can tell it which fields to cast as dates, booleans, etc. You can tell it which fields represent timestamps for updating, creating, deleting and so forth.

You can setup relations that don't follow naming conventions the same way.

The only issue I've run into is doing things like setting up relationships across databases. You can do it, it's just not super straightforward.

I think you'll find it's a breath of fresh air to have a modern wrapper around your legacy code, and that your legacy stuff will then fit in quite nicely with your new work.

Re: PHP in 2023

#169

I used to work way back in the day on PHP too, but even though I'm sure this will be downvoted, it's really sad people still take it seriously as a language in 2023. There's nothing remotely elegant about it. It's not expressive or programmatically succinct in the way Ruby is. It's not beautifully well thought-out the way Python is. It's not fast and modern in the way Rust is. It's not elegant or composable or client…

> It's not beautifully well thought-out the way Python is

Slagging PHP and then saying this just means you are trolling which is not exactly welcomed on HN.

Re: PHP in 2023

#170

Earlier quoted context omitted.

Quoting myself: > They claim that the article A Fractal of Bad Design (which was really cathartic to me when it came out) is out of date, but when I look, all the old footguns are still there, all the problems with the standard library are still there and stdout still writes directly to the browser.

You can quote yourself ad nauseam but that does not turn your incorrect statement into a correct statement. If you spent any amount of time looking at a modern PHP codebase, you'd discover that the type of code people write today is radically different to the type of code you'd have seen at the time A Fractal of Bad Design was written. There are still aspects of modern PHP that stand to be improved, absolutely, but t…

Your argument is basically:

"Yes, yes, the footguns are still there front and center, but we added more guns that don't shoot you on the foot."

If I was using PHP, I'd be livid that the cruft is never removed. Just deprecate and remove it

Post reply on HN